staging: r8188eu: fix array_size.cocci warning

Fix following array_size.cocci warning:
./drivers/staging/r8188eu/core/rtw_rf.c:38:48-49: WARNING: Use ARRAY_SIZE.

ARRAY_SIZE() defined in <linux/kernel.h> is safer because it uses
__must_be_array().

Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
Link: https://lore.kernel.org/r/20211116064124.8833-2-guozhengkui@vivo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Guo Zhengkui
2021-11-16 14:41:07 +08:00
committed by Greg Kroah-Hartman
parent 944f0f697a
commit fce0490dcb

View File

@@ -35,7 +35,7 @@ static struct ch_freq ch_freq_map[] = {
{216, 5080},/* Japan, means J16 */
};
static int ch_freq_map_num = (sizeof(ch_freq_map) / sizeof(struct ch_freq));
static int ch_freq_map_num = ARRAY_SIZE(ch_freq_map);
u32 rtw_ch2freq(u32 channel)
{