mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: r8188eu: fix array_size.cocci warning
@ 2021-11-16  6:41 Guo Zhengkui
  2021-11-16  6:41 ` Guo Zhengkui
  2021-11-16  6:54 ` Pavel Skripkin
  0 siblings, 2 replies; 3+ messages in thread
From: Guo Zhengkui @ 2021-11-16  6:41 UTC (permalink / raw)
  To: Larry Finger, Phillip Potter, Greg Kroah-Hartman, Guo Zhengkui,
	Michael Straube, open list:STAGING SUBSYSTEM, open list
  Cc: kernel

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>
---
 drivers/staging/r8188eu/core/rtw_rf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/r8188eu/core/rtw_rf.c b/drivers/staging/r8188eu/core/rtw_rf.c
index 2ec56012516e..e704092d31d0 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)
 {
-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-16  6:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16  6:41 [PATCH] staging: r8188eu: fix array_size.cocci warning Guo Zhengkui
2021-11-16  6:41 ` Guo Zhengkui
2021-11-16  6:54 ` Pavel Skripkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®