staging: rtl8188eu: sizeof/sizeof replaced by ARRAY_SIZE kernel macro
authorIvan Safonov <insafonov@gmail.com>
Tue, 27 Oct 2015 15:13:57 +0000 (22:13 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2015 00:09:08 +0000 (09:09 +0900)
ARRAY_SIZE shorter and more difficult to create bugs.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/hal/mac_cfg.c
drivers/staging/rtl8188eu/hal/rf_cfg.c
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c

index febc83a5adb874318b89383abce87b8681752828..b867db5d20bf0d2a40b456b723e74fb1e873f64d 100644 (file)
@@ -123,7 +123,7 @@ bool rtl88eu_phy_mac_config(struct adapter *adapt)
        u32 arraylength;
        u32 *ptrarray;
 
-       arraylength = sizeof(array_MAC_REG_8188E)/sizeof(u32);
+       arraylength = ARRAY_SIZE(array_MAC_REG_8188E);
        ptrarray = array_MAC_REG_8188E;
 
        for (i = 0; i < arraylength; i = i + 2)
index a3f1abaf60d9f89fd9967a116f757c2635c372de..44945427cc3464dbc23c88568985d5ac2b824160 100644 (file)
@@ -198,7 +198,7 @@ static void rtl8188e_config_rf_reg(struct adapter *adapt,
 static bool rtl88e_phy_config_rf_with_headerfile(struct adapter *adapt)
 {
        u32 i;
-       u32 array_len = sizeof(Array_RadioA_1T_8188E)/sizeof(u32);
+       u32 array_len = ARRAY_SIZE(Array_RadioA_1T_8188E);
        u32 *array = Array_RadioA_1T_8188E;
 
        for (i = 0; i < array_len; i += 2) {
index 969574926e21c939defa1e0967a614afeef0421a..bda423e72fa8d2409001eeca04450353e0d7eb50 100644 (file)
@@ -3091,7 +3091,7 @@ static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev)
 
 struct iw_handler_def rtw_handlers_def = {
        .standard = rtw_handlers,
-       .num_standard = sizeof(rtw_handlers) / sizeof(iw_handler),
+       .num_standard = ARRAY_SIZE(rtw_handlers),
        .get_wireless_stats = rtw_get_wireless_stats,
 };