diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-12-06 07:46:54 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-12-07 03:37:40 -0500 |
commit | c8a8ab4472619e6936a224c5a950750d640aefbb (patch) | |
tree | 9ecae1e0cabe4d98ff27fba521310170d169d9dd /drivers | |
parent | 8d96bb61fcfa11fb0c0da0d4f1331b7ca231bec1 (diff) |
iwlwifi: change TX code to suppress smatch warning
By using a few temporary variables, smatch can track
what's happening and stops complaining that we access
beyond the tid_data array.
This also makes the generated code a bit smaller, so
it's a win all around.
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/dvm/tx.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/tx.c b/drivers/net/wireless/iwlwifi/dvm/tx.c index 7d6cc5dffc20..517562b90fda 100644 --- a/drivers/net/wireless/iwlwifi/dvm/tx.c +++ b/drivers/net/wireless/iwlwifi/dvm/tx.c | |||
@@ -305,7 +305,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, | |||
305 | u8 hdr_len; | 305 | u8 hdr_len; |
306 | u16 len, seq_number = 0; | 306 | u16 len, seq_number = 0; |
307 | u8 sta_id, tid = IWL_MAX_TID_COUNT; | 307 | u8 sta_id, tid = IWL_MAX_TID_COUNT; |
308 | bool is_agg = false; | 308 | bool is_agg = false, is_data_qos = false; |
309 | int txq_id; | 309 | int txq_id; |
310 | 310 | ||
311 | if (info->control.vif) | 311 | if (info->control.vif) |
@@ -378,9 +378,6 @@ int iwlagn_tx_skb(struct iwl_priv *priv, | |||
378 | iwl_sta_modify_sleep_tx_count(priv, sta_id, 1); | 378 | iwl_sta_modify_sleep_tx_count(priv, sta_id, 1); |
379 | } | 379 | } |
380 | 380 | ||
381 | if (info->flags & IEEE80211_TX_CTL_AMPDU) | ||
382 | is_agg = true; | ||
383 | |||
384 | dev_cmd = iwl_trans_alloc_tx_cmd(priv->trans); | 381 | dev_cmd = iwl_trans_alloc_tx_cmd(priv->trans); |
385 | 382 | ||
386 | if (unlikely(!dev_cmd)) | 383 | if (unlikely(!dev_cmd)) |
@@ -442,6 +439,10 @@ int iwlagn_tx_skb(struct iwl_priv *priv, | |||
442 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); | 439 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); |
443 | hdr->seq_ctrl |= cpu_to_le16(seq_number); | 440 | hdr->seq_ctrl |= cpu_to_le16(seq_number); |
444 | seq_number += 0x10; | 441 | seq_number += 0x10; |
442 | |||
443 | if (info->flags & IEEE80211_TX_CTL_AMPDU) | ||
444 | is_agg = true; | ||
445 | is_data_qos = true; | ||
445 | } | 446 | } |
446 | 447 | ||
447 | /* Copy MAC header from skb into command buffer */ | 448 | /* Copy MAC header from skb into command buffer */ |
@@ -474,8 +475,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, | |||
474 | if (iwl_trans_tx(priv->trans, skb, dev_cmd, txq_id)) | 475 | if (iwl_trans_tx(priv->trans, skb, dev_cmd, txq_id)) |
475 | goto drop_unlock_sta; | 476 | goto drop_unlock_sta; |
476 | 477 | ||
477 | if (ieee80211_is_data_qos(fc) && !ieee80211_is_qos_nullfunc(fc) && | 478 | if (is_data_qos && !ieee80211_has_morefrags(fc)) |
478 | !ieee80211_has_morefrags(fc)) | ||
479 | priv->tid_data[sta_id][tid].seq_number = seq_number; | 479 | priv->tid_data[sta_id][tid].seq_number = seq_number; |
480 | 480 | ||
481 | spin_unlock(&priv->sta_lock); | 481 | spin_unlock(&priv->sta_lock); |