diff options
author | Ivan Safonov <insafonov@gmail.com> | 2015-10-10 19:21:54 +0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-12 20:48:09 -0700 |
commit | 59056281af5d4b011380bfbb59436a392c452bde (patch) | |
tree | ae15942e3b08da0018186a40b6d2eb77b655cf82 /drivers/staging/rtl8188eu | |
parent | e525e7a63ba4b544f47fe57a3ed3480af288f8eb (diff) | |
download | lwn-59056281af5d4b011380bfbb59436a392c452bde.tar.gz lwn-59056281af5d4b011380bfbb59436a392c452bde.zip |
staging: rtl8188eu: ARRAY_SIZE instead of sizeof/sizeof used
This patch inserts ARRAY_SIZE instead of sizeof(type array[])/sizeof(type),
made arraylen variable constant
and removes unnecessary default value in variable definition.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu')
-rw-r--r-- | drivers/staging/rtl8188eu/hal/bb_cfg.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c index fa461b45b82a..88c3ad7a1cc7 100644 --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c @@ -158,7 +158,7 @@ static u32 array_agc_tab_1t_8188e[] = { static bool set_baseband_agc_config(struct adapter *adapt) { u32 i; - u32 arraylen = sizeof(array_agc_tab_1t_8188e)/sizeof(u32); + const u32 arraylen = ARRAY_SIZE(array_agc_tab_1t_8188e); u32 *array = array_agc_tab_1t_8188e; for (i = 0; i < arraylen; i += 2) { @@ -393,7 +393,7 @@ static void rtl_bb_delay(struct adapter *adapt, u32 addr, u32 data) static bool set_baseband_phy_config(struct adapter *adapt) { u32 i; - u32 arraylen = sizeof(array_phy_reg_1t_8188e)/sizeof(u32); + const u32 arraylen = ARRAY_SIZE(array_phy_reg_1t_8188e); u32 *array = array_phy_reg_1t_8188e; for (i = 0; i < arraylen; i += 2) { @@ -574,8 +574,8 @@ static void rtl_addr_delay(struct adapter *adapt, static bool config_bb_with_pgheader(struct adapter *adapt) { - u32 i = 0; - u32 arraylen = sizeof(array_phy_reg_pg_8188e) / sizeof(u32); + u32 i; + const u32 arraylen = ARRAY_SIZE(array_phy_reg_pg_8188e); u32 *array = array_phy_reg_pg_8188e; for (i = 0; i < arraylen; i += 3) { |