Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: bebob: sizeof() vs ARRAY_SIZE() typo

ARRAY_SIZE() was intended here instead of sizeof(). The
"bridgeco_freq_table" array holds integers so the original condition is
never true.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewd-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Dan Carpenter and committed by
Takashi Iwai
33a5f989 14577c25

+1 -1
+1 -1
sound/firewire/bebob/bebob_stream.c
··· 749 749 if (buf[2] == bridgeco_freq_table[i]) 750 750 break; 751 751 } 752 - if (i == sizeof(bridgeco_freq_table)) 752 + if (i == ARRAY_SIZE(bridgeco_freq_table)) 753 753 return -ENOSYS; 754 754 755 755 /* Avoid double count by different entries for the same rate. */