All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: johannes@sipsolutions.net
Cc: luca@coelho.fi, linux-wireless@vger.kernel.org
Subject: [PATCH 10/14] mac80211: airtime: avoid variable shadowing
Date: Wed,  2 Feb 2022 10:49:43 +0200	[thread overview]
Message-ID: <iwlwifi.20220202104617.8e9b2bfaa0f5.I41c53f754eef28206d04dafc7263ccb99b63d490@changeid> (raw)
In-Reply-To: <20220202084947.370289-1-luca@coelho.fi>

From: Johannes Berg <johannes.berg@intel.com>

This isn't very dangerous, since the outer 'rate' variable
isn't even a pointer, but it's still confusing, so use a
different variable inside.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 net/mac80211/airtime.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/airtime.c b/net/mac80211/airtime.c
index 26d2f8ba7029..ffb7559b36d4 100644
--- a/net/mac80211/airtime.c
+++ b/net/mac80211/airtime.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: ISC
 /*
  * Copyright (C) 2019 Felix Fietkau <nbd@nbd.name>
+ * Copyright (C) 2021 Intel Corporation
  */
 
 #include <net/mac80211.h>
@@ -650,12 +651,12 @@ u32 ieee80211_calc_expected_tx_airtime(struct ieee80211_hw *hw,
 		struct sta_info *sta = container_of(pubsta, struct sta_info,
 						    sta);
 		struct ieee80211_rx_status stat;
-		struct ieee80211_tx_rate *rate = &sta->tx_stats.last_rate;
+		struct ieee80211_tx_rate *tx_rate = &sta->tx_stats.last_rate;
 		struct rate_info *ri = &sta->tx_stats.last_rate_info;
 		u32 duration, overhead;
 		u8 agg_shift;
 
-		if (ieee80211_fill_rx_status(&stat, hw, rate, ri, band, len))
+		if (ieee80211_fill_rx_status(&stat, hw, tx_rate, ri, band, len))
 			return 0;
 
 		if (stat.encoding == RX_ENC_LEGACY || !ampdu)
-- 
2.34.1


  parent reply	other threads:[~2022-02-02  8:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-02  8:49 [PATCH 00/14] cfg80211/mac80211 patches from our internal tree 2022-02-02 Luca Coelho
2022-02-02  8:49 ` [PATCH 01/14] mac80211: limit bandwidth in HE capabilities Luca Coelho
2022-02-02  8:49 ` [PATCH 02/14] mac80211: consider RX NSS in UHB connection Luca Coelho
2022-02-02  8:49 ` [PATCH 03/14] cfg80211/mac80211: assume CHECKSUM_COMPLETE includes SNAP Luca Coelho
2022-02-02  8:49 ` [PATCH 04/14] cfg80211: don't add non transmitted BSS to 6GHz scanned channels Luca Coelho
2022-02-02  8:49 ` [PATCH 05/14] ieee80211: fix -Wcast-qual warnings Luca Coelho
2022-02-02  8:49 ` [PATCH 06/14] cfg80211: " Luca Coelho
2022-02-02  8:49 ` [PATCH 07/14] ieee80211: radiotap: " Luca Coelho
2022-02-02  8:49 ` [PATCH 08/14] mac80211: vht: use HE macros for parsing HE capabilities Luca Coelho
2022-02-02  8:49 ` [PATCH 09/14] mac80211: mlme: add documentation from spec to code Luca Coelho
2022-02-08 22:45   ` Jeff Johnson
2022-02-02  8:49 ` Luca Coelho [this message]
2022-02-02  8:49 ` [PATCH 11/14] cfg80211: pmsr: remove useless ifdef guards Luca Coelho
2022-02-02  8:49 ` [PATCH 12/14] mac80211: remove unused macros Luca Coelho
2022-02-02  8:49 ` [PATCH 13/14] mac80211: mlme: validate peer HE supported rates Luca Coelho
2022-02-02  8:49 ` [PATCH 14/14] mac80211: fix struct ieee80211_tx_info size Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=iwlwifi.20220202104617.8e9b2bfaa0f5.I41c53f754eef28206d04dafc7263ccb99b63d490@changeid \
    --to=luca@coelho.fi \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.