From: Guo Zhengkui Date: Tue, 16 Nov 2021 06:41:07 +0000 (+0800) Subject: staging: r8188eu: fix array_size.cocci warning X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=fce0490dcbeecee828f829a56201b1c5999edf81;p=linux.git 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 is safer because it uses __must_be_array(). Signed-off-by: Guo Zhengkui Link: https://lore.kernel.org/r/20211116064124.8833-2-guozhengkui@vivo.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/r8188eu/core/rtw_rf.c b/drivers/staging/r8188eu/core/rtw_rf.c index 2ec56012516e6..e704092d31d0b 100644 --- a/drivers/staging/r8188eu/core/rtw_rf.c +++ b/drivers/staging/r8188eu/core/rtw_rf.c @@ -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) {