* re: iwlwifi: mvm: rs: use correct max expected throughput figures
@ 2014-04-17 10:44 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2014-04-17 10:44 UTC (permalink / raw)
To: eyal; +Cc: linux-wireless
Hello Eyal Shapira,
The patch 198266a3c110: "iwlwifi: mvm: rs: use correct max expected
throughput figures" from Mar 31, 2014, leads to the following static
checker warning:
drivers/net/wireless/iwlwifi/mvm/rs.c:2433 iwl_mvm_rs_rate_init()
warn: was expecting a 64 bit value instead of '(2)'
drivers/net/wireless/iwlwifi/mvm/rs.c
2427 /* active_siso_rate mask includes 9 MBits (bit 5),
2428 * and CCK (bits 0-3), supp_rates[] does not;
2429 * shift to convert format, force 9 MBits off.
2430 */
2431 lq_sta->active_siso_rate = ht_cap->mcs.rx_mask[0] << 1;
2432 lq_sta->active_siso_rate |= ht_cap->mcs.rx_mask[0] & 0x1;
2433 lq_sta->active_siso_rate &= ~((u16)0x2);
Your patch changes this from being a u16 to being a unsigned long and
triggers this static checker warning. The code still works fine because
the u16 cast is a no-op which ends up being processed as
"~((type promote to int)(u16)0x2)". The negative bit gets pushed out to
64 bits giving "0xfffffffffffffffd" which we want. But it's still a
confusing left over remnant.
Also this struct has another definition where it is still a u16 in the
drivers/net/wireless/iwlwifi/dvm/ driver.
2434 lq_sta->active_siso_rate <<= IWL_FIRST_OFDM_RATE;
2435
2436 /* Same here */
2437 lq_sta->active_mimo2_rate = ht_cap->mcs.rx_mask[1] << 1;
2438 lq_sta->active_mimo2_rate |= ht_cap->mcs.rx_mask[1] & 0x1;
2439 lq_sta->active_mimo2_rate &= ~((u16)0x2);
^^^^^^^
Same here.
2440 lq_sta->active_mimo2_rate <<= IWL_FIRST_OFDM_RATE;
2441
2442 lq_sta->is_vht = false;
2443 } else {
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-04-17 10:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-17 10:44 iwlwifi: mvm: rs: use correct max expected throughput figures Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).