staging: rtl8723bs: use ARRAY_SIZE
authorJérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Sun, 1 Oct 2017 19:30:55 +0000 (15:30 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Oct 2017 16:34:57 +0000 (18:34 +0200)
commit60db8d10ee3339840d88e57605276bb568af6031
treee5093170ab3ac17a0745a1c282a2ac1c2e82d27c
parent2595587d7e227a9181750110f50e02a2511821dd
staging: rtl8723bs: use ARRAY_SIZE

Using the ARRAY_SIZE macro improves the readability of the code. Also,
it is not always useful to use a variable to store this constant
calculated at compile time.

Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
 (sizeof(E)@p /sizeof(*E))
|
 (sizeof(E)@p /sizeof(E[...]))
|
 (sizeof(E)@p /sizeof(T))
)

Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
drivers/staging/rtl8723bs/core/rtw_rf.c
drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c
drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c
drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c
drivers/staging/rtl8723bs/hal/hal_com.c
drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c