mirror of
https://github.com/torvalds/linux.git
synced 2024-12-24 11:51:27 +00:00
mwifiex: don't open-code ARRAY_SIZE()
Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
fe8d730ada
commit
8395fd9b19
@ -180,11 +180,9 @@ static struct region_code_mapping region_code_mapping_t[] = {
|
||||
u8 *mwifiex_11d_code_2_region(u8 code)
|
||||
{
|
||||
u8 i;
|
||||
u8 size = sizeof(region_code_mapping_t)/
|
||||
sizeof(struct region_code_mapping);
|
||||
|
||||
/* Look for code in mapping table */
|
||||
for (i = 0; i < size; i++)
|
||||
for (i = 0; i < ARRAY_SIZE(region_code_mapping_t); i++)
|
||||
if (region_code_mapping_t[i].code == code)
|
||||
return region_code_mapping_t[i].region;
|
||||
|
||||
|
@ -189,9 +189,7 @@ static int mwifiex_cmd_tx_rate_cfg(struct mwifiex_private *priv,
|
||||
if (pbitmap_rates != NULL) {
|
||||
rate_scope->hr_dsss_rate_bitmap = cpu_to_le16(pbitmap_rates[0]);
|
||||
rate_scope->ofdm_rate_bitmap = cpu_to_le16(pbitmap_rates[1]);
|
||||
for (i = 0;
|
||||
i < sizeof(rate_scope->ht_mcs_rate_bitmap) / sizeof(u16);
|
||||
i++)
|
||||
for (i = 0; i < ARRAY_SIZE(rate_scope->ht_mcs_rate_bitmap); i++)
|
||||
rate_scope->ht_mcs_rate_bitmap[i] =
|
||||
cpu_to_le16(pbitmap_rates[2 + i]);
|
||||
if (priv->adapter->fw_api_ver == MWIFIEX_FW_V15) {
|
||||
@ -206,9 +204,7 @@ static int mwifiex_cmd_tx_rate_cfg(struct mwifiex_private *priv,
|
||||
cpu_to_le16(priv->bitmap_rates[0]);
|
||||
rate_scope->ofdm_rate_bitmap =
|
||||
cpu_to_le16(priv->bitmap_rates[1]);
|
||||
for (i = 0;
|
||||
i < sizeof(rate_scope->ht_mcs_rate_bitmap) / sizeof(u16);
|
||||
i++)
|
||||
for (i = 0; i < ARRAY_SIZE(rate_scope->ht_mcs_rate_bitmap); i++)
|
||||
rate_scope->ht_mcs_rate_bitmap[i] =
|
||||
cpu_to_le16(priv->bitmap_rates[2 + i]);
|
||||
if (priv->adapter->fw_api_ver == MWIFIEX_FW_V15) {
|
||||
|
@ -298,9 +298,8 @@ static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv,
|
||||
priv->bitmap_rates[1] =
|
||||
le16_to_cpu(rate_scope->ofdm_rate_bitmap);
|
||||
for (i = 0;
|
||||
i <
|
||||
sizeof(rate_scope->ht_mcs_rate_bitmap) /
|
||||
sizeof(u16); i++)
|
||||
i < ARRAY_SIZE(rate_scope->ht_mcs_rate_bitmap);
|
||||
i++)
|
||||
priv->bitmap_rates[2 + i] =
|
||||
le16_to_cpu(rate_scope->
|
||||
ht_mcs_rate_bitmap[i]);
|
||||
|
Loading…
Reference in New Issue
Block a user