summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8188eu
diff options
context:
space:
mode:
authorShraddha Barke2015-10-08 21:25:19 +0200
committerGreg Kroah-Hartman2015-10-13 05:45:38 +0200
commite525e7a63ba4b544f47fe57a3ed3480af288f8eb (patch)
treed916aa060dec9167794ceb2604bf60719bf50f0d /drivers/staging/rtl8188eu
parentstaging: rtl8188eu: unused macro read_next_pair removed (diff)
downloadkernel-qcow2-linux-e525e7a63ba4b544f47fe57a3ed3480af288f8eb.tar.gz
kernel-qcow2-linux-e525e7a63ba4b544f47fe57a3ed3480af288f8eb.tar.xz
kernel-qcow2-linux-e525e7a63ba4b544f47fe57a3ed3480af288f8eb.zip
Staging: rtl8188eu: core: Use ARRAY_SIZE macro
ARRAY_SIZE is more concise to use when the size of an array is divided by the size of its type. Changes made using Coccinelle- @@ type T; T[] E; @@ - (sizeof(E)/sizeof(T)) + ARRAY_SIZE(E) Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu')
-rw-r--r--drivers/staging/rtl8188eu/core/rtw_mlme_ext.c2
-rw-r--r--drivers/staging/rtl8188eu/core/rtw_rf.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 0270755ec546..d8a0895aa86f 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -3926,7 +3926,7 @@ static unsigned int OnAction(struct adapter *padapter,
category = frame_body[0];
- for (i = 0; i < sizeof(OnAction_tbl)/sizeof(struct action_handler); i++) {
+ for (i = 0; i < ARRAY_SIZE(OnAction_tbl); i++) {
ptable = &OnAction_tbl[i];
if (category == ptable->num)
ptable->func(padapter, precv_frame);
diff --git a/drivers/staging/rtl8188eu/core/rtw_rf.c b/drivers/staging/rtl8188eu/core/rtw_rf.c
index 1170dd001c1f..6983c572b358 100644
--- a/drivers/staging/rtl8188eu/core/rtw_rf.c
+++ b/drivers/staging/rtl8188eu/core/rtw_rf.c
@@ -52,7 +52,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)
{