]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iwlwifi: mvm: remove division by size of sizeof(struct ieee80211_wmm_rule)
authorColin Ian King <colin.king@canonical.com>
Wed, 11 Apr 2018 13:05:33 +0000 (14:05 +0100)
committerLuca Coelho <luciano.coelho@intel.com>
Wed, 30 May 2018 06:49:38 +0000 (09:49 +0300)
The subtraction of two struct ieee80211_wmm_rule pointers leaves a result
that is automatically scaled down by the size of the size of pointed-to
type, hence the division by sizeof(struct ieee80211_wmm_rule) is
bogus and should be removed.

Detected by CoverityScan, CID#1467777 ("Extra sizeof expression")

Fixes: 77e30e10ee28 ("iwlwifi: mvm: query regdb for wmm rule if needed")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c

index 0f9d56420c42447431bbb5dfe74099536b8e8a60..b815ba38dbdb177e6a2fe2e235c2a4f5cac8d725 100644 (file)
@@ -1025,8 +1025,7 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
                        continue;
 
                copy_rd->reg_rules[i].wmm_rule = d_wmm +
-                       (regd->reg_rules[i].wmm_rule - s_wmm) /
-                       sizeof(struct ieee80211_wmm_rule);
+                       (regd->reg_rules[i].wmm_rule - s_wmm);
        }
 
 out: