Skip to content

Commit c8a8ab4

Browse files
committed
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>
1 parent 8d96bb6 commit c8a8ab4

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

  • drivers/net/wireless/iwlwifi/dvm

‎drivers/net/wireless/iwlwifi/dvm/tx.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv,
305305
u8 hdr_len;
306306
u16 len, seq_number = 0;
307307
u8 sta_id, tid = IWL_MAX_TID_COUNT;
308-
bool is_agg = false;
308+
bool is_agg = false, is_data_qos = false;
309309
int txq_id;
310310

311311
if (info->control.vif)
@@ -378,9 +378,6 @@ int iwlagn_tx_skb(struct iwl_priv *priv,
378378
iwl_sta_modify_sleep_tx_count(priv, sta_id, 1);
379379
}
380380

381-
if (info->flags & IEEE80211_TX_CTL_AMPDU)
382-
is_agg = true;
383-
384381
dev_cmd = iwl_trans_alloc_tx_cmd(priv->trans);
385382

386383
if (unlikely(!dev_cmd))
@@ -442,6 +439,10 @@ int iwlagn_tx_skb(struct iwl_priv *priv,
442439
hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
443440
hdr->seq_ctrl |= cpu_to_le16(seq_number);
444441
seq_number += 0x10;
442+
443+
if (info->flags & IEEE80211_TX_CTL_AMPDU)
444+
is_agg = true;
445+
is_data_qos = true;
445446
}
446447

447448
/* Copy MAC header from skb into command buffer */
@@ -474,8 +475,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv,
474475
if (iwl_trans_tx(priv->trans, skb, dev_cmd, txq_id))
475476
goto drop_unlock_sta;
476477

477-
if (ieee80211_is_data_qos(fc) && !ieee80211_is_qos_nullfunc(fc) &&
478-
!ieee80211_has_morefrags(fc))
478+
if (is_data_qos && !ieee80211_has_morefrags(fc))
479479
priv->tid_data[sta_id][tid].seq_number = seq_number;
480480

481481
spin_unlock(&priv->sta_lock);

0 commit comments

Comments
 (0)