mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH 1/9] staging: rtl8192e: Remove variable stats->freq as it is constant
Date: Sat, 17 Jun 2023 15:56:41 +0200	[thread overview]
Message-ID: <4d8801d37889e6af4f43dff10d1426fc7918f562.1687007788.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1687007788.git.philipp.g.hortmann@gmail.com>

stats->freq is initialized with 1 and then unchanged. All evaluations
will result accordingly. Remove resulting dead code and unused defines.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c |  1 -
 drivers/staging/rtl8192e/rtllib.h            |  5 -----
 drivers/staging/rtl8192e/rtllib_rx.c         | 19 +++++--------------
 3 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 17b70dde7eeb..20c0308eb3c1 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -1769,7 +1769,6 @@ static void _rtl92e_rx_normal(struct net_device *dev)
 		.signal = 0,
 		.noise = (u8)-98,
 		.rate = 0,
-		.freq = RTLLIB_24GHZ_BAND,
 	};
 	unsigned int count = priv->rxringcount;
 
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 87e9169214f6..b4fad9bf0f03 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -500,9 +500,6 @@ enum _REG_PREAMBLE_MODE {
 #define RTLLIB_CCK_MODULATION    (1<<0)
 #define RTLLIB_OFDM_MODULATION   (1<<1)
 
-#define RTLLIB_24GHZ_BAND     (1<<0)
-#define RTLLIB_52GHZ_BAND     (1<<1)
-
 #define RTLLIB_CCK_RATE_LEN		4
 #define RTLLIB_CCK_RATE_1MB			0x02
 #define RTLLIB_CCK_RATE_2MB			0x04
@@ -549,10 +546,8 @@ struct rtllib_rx_stats {
 	u8  signal;
 	u8  noise;
 	u16 rate; /* in 100 kbps */
-	u8  received_channel;
 	u8  control;
 	u8  mask;
-	u8  freq;
 	u16 len;
 	u64 tsf;
 	u32 beacon_time;
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 46c77ed335ab..36dace010203 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -2301,12 +2301,7 @@ static inline int rtllib_network_init(
 	network->CountryIeLen = 0;
 	memset(network->CountryIeBuf, 0, MAX_IE_LEN);
 	HTInitializeBssDesc(&network->bssht);
-	if (stats->freq == RTLLIB_52GHZ_BAND) {
-		/* for A band (No DS info) */
-		network->channel = stats->received_channel;
-	} else {
-		network->flags |= NETWORK_HAS_CCK;
-	}
+	network->flags |= NETWORK_HAS_CCK;
 
 	network->wpa_ie_len = 0;
 	network->rsn_ie_len = 0;
@@ -2321,14 +2316,10 @@ static inline int rtllib_network_init(
 
 	network->mode = 0;
 
-	if (stats->freq == RTLLIB_52GHZ_BAND) {
-		network->mode = IEEE_A;
-	} else {
-		if (network->flags & NETWORK_HAS_OFDM)
-			network->mode |= IEEE_G;
-		if (network->flags & NETWORK_HAS_CCK)
-			network->mode |= IEEE_B;
-	}
+	if (network->flags & NETWORK_HAS_OFDM)
+		network->mode |= IEEE_G;
+	if (network->flags & NETWORK_HAS_CCK)
+		network->mode |= IEEE_B;
 
 	if (network->mode == 0) {
 		netdev_dbg(ieee->dev, "Filtered out '%s (%pM)' network.\n",
-- 
2.40.1


  reply	other threads:[~2023-06-17 13:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-17 13:56 [PATCH 0/9] staging: rtl8192e: Remove unsupported modes a and 5G Philipp Hortmann
2023-06-17 13:56 ` Philipp Hortmann [this message]
2023-06-17 13:56 ` [PATCH 2/9] staging: rtl8192e: Remove unsupported modes IEEE_N_5G and IEEE_A Philipp Hortmann
2023-06-17 13:56 ` [PATCH 3/9] staging: rtl8192e: Rename constant IEEE_x to WIRELESS_MODE_x Philipp Hortmann
2023-06-17 13:57 ` [PATCH 4/9] staging: rtl8192e: Remove unused enum led_ctl_mode Philipp Hortmann
2023-06-17 13:57 ` [PATCH 5/9] staging: rtl8192e: Rename rtllib_state to rtl_link_state Philipp Hortmann
2023-06-17 13:57 ` [PATCH 6/9] staging: rtl8192e: Rename state to link_state Philipp Hortmann
2023-06-17 13:57 ` [PATCH 7/9] staging: rtl8192e: Rename RTLLIB_NOLINK to MAC80211_NOLINK Philipp Hortmann
2023-06-17 13:57 ` [PATCH 8/9] staging: rtl8192e: Rename RTLLIB_LINKED to MAC80211_LINKED Philipp Hortmann
2023-06-17 13:57 ` [PATCH 9/9] staging: rtl8192e: Rename RTLLIB_LINKED_SCANNING Philipp Hortmann

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=4d8801d37889e6af4f43dff10d1426fc7918f562.1687007788.git.philipp.g.hortmann@gmail.com \
    --to=philipp.g.hortmann@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®