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

Using the ARRAY_SIZE macro improves the readability of the code. Also,
it is useless 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/rtlwifi/phydm/phydm_debug.c
drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_bb.c
drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_mac.c
drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_rf.c