2024-02-21 21:44:45

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 0/8] Remove unused variables from rtllib_rx_stats

Remove unused or unevaluated variables from struct rtllib_rx_stats.

Tested with rtl8192e (WLL6130-D99) in Mode n (12.5 MB/s)
Transferred this patch over wlan connection of rtl8192e.

Philipp Hortmann (8):
staging: rtl8192e: Remove variables tsf, beacon_time and Antenna
staging: rtl8192e: Remove variables Wakeup, Reserved0 and AGC
staging: rtl8192e: Remove unused variable bShift
staging: rtl8192e: Remove variables bIsQosData and RxIs40MHzPacket
staging: rtl8192e: Remove variables fraglength and packetlength
staging: rtl8192e: Remove unused variables nic_type and RxPower
staging: rtl8192e: Remove unused variables bShortPreamble and
fragoffset
staging: rtl8192e: Remove unused variables ntotalfrag and Seq_Num

.../staging/rtl8192e/rtl8192e/r8192E_dev.c | 20 -------------------
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 --
drivers/staging/rtl8192e/rtllib.h | 17 ----------------
drivers/staging/rtl8192e/rtllib_rx.c | 3 ---
4 files changed, 42 deletions(-)

--
2.43.2



2024-02-21 21:45:03

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 1/8] staging: rtl8192e: Remove variables tsf, beacon_time and Antenna

Remove unused variables tsf, beacon_time and Antenna.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtllib.h | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 348644998744..945874c1495d 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -474,8 +474,6 @@ struct rtllib_rx_stats {
u8 control;
u8 mask;
u16 len;
- u64 tsf;
- u32 beacon_time;
u8 nic_type;
u16 Length;
u8 SignalQuality;
@@ -486,7 +484,6 @@ struct rtllib_rx_stats {
u16 bCRC:1;
u16 bICV:1;
u16 bShortPreamble:1;
- u16 Antenna:1;
u16 Decrypted:1;
u16 Wakeup:1;
u16 Reserved0:1;
--
2.43.2


2024-02-21 21:45:32

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 2/8] staging: rtl8192e: Remove variables Wakeup, Reserved0 and AGC

Remove unused variables Wakeup, Reserved0 and AGC.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtllib.h | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 945874c1495d..bc4479f7d089 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -485,9 +485,6 @@ struct rtllib_rx_stats {
u16 bICV:1;
u16 bShortPreamble:1;
u16 Decrypted:1;
- u16 Wakeup:1;
- u16 Reserved0:1;
- u8 AGC;
u32 TimeStampLow;
u32 TimeStampHigh;
bool bShift;
--
2.43.2


2024-02-21 21:45:54

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 5/8] staging: rtl8192e: Remove variables fraglength and packetlength

Remove unused variables fraglength and packetlength as they are set and
never evaluated.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 3 ---
drivers/staging/rtl8192e/rtllib.h | 2 --
2 files changed, 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index ad453a94b5c7..07218edab746 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -1674,9 +1674,6 @@ bool rtl92e_get_rx_stats(struct net_device *dev, struct rtllib_rx_stats *stats,
_rtl92e_translate_rx_signal_stats(dev, skb, stats, pdesc, pDrvInfo);
skb_trim(skb, skb->len - S_CRC_LEN);

-
- stats->packetlength = stats->Length - 4;
- stats->fraglength = stats->packetlength;
stats->fragoffset = 0;
stats->ntotalfrag = 1;
return true;
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 943a16ead903..d764de9459e2 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -499,8 +499,6 @@ struct rtllib_rx_stats {
bool bPacketMatchBSSID;
bool bIsCCK;
bool bPacketToSelf;
- u16 packetlength;
- u16 fraglength;
u16 fragoffset;
u16 ntotalfrag;
bool bPacketBeacon;
--
2.43.2


2024-02-21 21:46:21

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 7/8] staging: rtl8192e: Remove unused variables bShortPreamble and fragoffset

Remove unused variables bShortPreamble and fragoffset as they are set and
never evaluated.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 2 --
drivers/staging/rtl8192e/rtllib.h | 2 --
2 files changed, 4 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index e7494b548749..f1e97da8f077 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -1659,7 +1659,6 @@ bool rtl92e_get_rx_stats(struct net_device *dev, struct rtllib_rx_stats *stats,

stats->rate = _rtl92e_rate_hw_to_mgn((bool)pDrvInfo->RxHT,
pDrvInfo->RxRate);
- stats->bShortPreamble = pDrvInfo->SPLCP;

_rtl92e_update_received_rate_histogram_stats(dev, stats);

@@ -1673,7 +1672,6 @@ bool rtl92e_get_rx_stats(struct net_device *dev, struct rtllib_rx_stats *stats,
_rtl92e_translate_rx_signal_stats(dev, skb, stats, pdesc, pDrvInfo);
skb_trim(skb, skb->len - S_CRC_LEN);

- stats->fragoffset = 0;
stats->ntotalfrag = 1;
return true;
}
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index d238fce712a4..6b33643ddae0 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -481,7 +481,6 @@ struct rtllib_rx_stats {
u16 bHwError:1;
u16 bCRC:1;
u16 bICV:1;
- u16 bShortPreamble:1;
u16 Decrypted:1;
u32 TimeStampLow;
u32 TimeStampHigh;
@@ -497,7 +496,6 @@ struct rtllib_rx_stats {
bool bPacketMatchBSSID;
bool bIsCCK;
bool bPacketToSelf;
- u16 fragoffset;
u16 ntotalfrag;
bool bPacketBeacon;
bool bToSelfBA;
--
2.43.2


2024-02-21 21:47:11

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 3/8] staging: rtl8192e: Remove unused variable bShift

Remove unused variable bShift as it is set and never evaluated.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 4 ----
drivers/staging/rtl8192e/rtllib.h | 1 -
2 files changed, 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index 59110da6c4f3..aeff01e921e4 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -1649,7 +1649,6 @@ bool rtl92e_get_rx_stats(struct net_device *dev, struct rtllib_rx_stats *stats,
stats->bHwError |= 1;

if (stats->bHwError) {
- stats->bShift = false;
return false;
}

@@ -1672,9 +1671,6 @@ bool rtl92e_get_rx_stats(struct net_device *dev, struct rtllib_rx_stats *stats,
stats->TimeStampLow = pDrvInfo->TSFL;
stats->TimeStampHigh = rtl92e_readl(dev, TSFR + 4);

- if ((stats->RxBufShift + stats->RxDrvInfoSize) > 0)
- stats->bShift = 1;
-
stats->RxIs40MHzPacket = pDrvInfo->BW;

_rtl92e_translate_rx_signal_stats(dev, skb, stats, pdesc, pDrvInfo);
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index bc4479f7d089..1949fad401d0 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -487,7 +487,6 @@ struct rtllib_rx_stats {
u16 Decrypted:1;
u32 TimeStampLow;
u32 TimeStampHigh;
- bool bShift;
bool bIsQosData;

u8 RxDrvInfoSize;
--
2.43.2


2024-02-21 21:47:18

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 4/8] staging: rtl8192e: Remove variables bIsQosData and RxIs40MHzPacket

Remove unused variables bIsQosData and RxIs40MHzPacket as they are set
and never evaluated.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 2 --
drivers/staging/rtl8192e/rtllib.h | 2 --
drivers/staging/rtl8192e/rtllib_rx.c | 3 ---
3 files changed, 7 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index aeff01e921e4..ad453a94b5c7 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -1671,8 +1671,6 @@ bool rtl92e_get_rx_stats(struct net_device *dev, struct rtllib_rx_stats *stats,
stats->TimeStampLow = pDrvInfo->TSFL;
stats->TimeStampHigh = rtl92e_readl(dev, TSFR + 4);

- stats->RxIs40MHzPacket = pDrvInfo->BW;
-
_rtl92e_translate_rx_signal_stats(dev, skb, stats, pdesc, pDrvInfo);
skb_trim(skb, skb->len - S_CRC_LEN);

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 1949fad401d0..943a16ead903 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -487,14 +487,12 @@ struct rtllib_rx_stats {
u16 Decrypted:1;
u32 TimeStampLow;
u32 TimeStampHigh;
- bool bIsQosData;

u8 RxDrvInfoSize;
u8 RxBufShift;
bool bIsAMPDU;
bool bFirstMPDU;
bool bContainHTC;
- bool RxIs40MHzPacket;
u32 RxPWDBAll;
u8 RxMIMOSignalStrength[4];
s8 RxMIMOSignalQuality[2];
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 29bdaff4cbab..1e4956fc6754 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -865,9 +865,6 @@ static size_t rtllib_rx_get_hdrlen(struct rtllib_device *ieee,
rx_stats->bContainHTC = true;
}

- if (RTLLIB_QOS_HAS_SEQ(fc))
- rx_stats->bIsQosData = true;
-
return hdrlen;
}

--
2.43.2


2024-02-21 22:03:40

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 6/8] staging: rtl8192e: Remove unused variables nic_type and RxPower

Remove unused variables nic_type and RxPower as they are set and never
evaluated.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 --
drivers/staging/rtl8192e/rtllib.h | 2 --
3 files changed, 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index 07218edab746..e7494b548749 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -1295,7 +1295,6 @@ static void _rtl92e_query_rxphystatus(
pwdb_all = rtl92e_rx_db_to_percent(rx_pwr_all);

pstats->RxPWDBAll = precord_stats->RxPWDBAll = pwdb_all;
- pstats->RxPower = precord_stats->RxPower = rx_pwr_all;
pstats->RecvSignalPower = rx_pwr_all;
if (pdrvinfo->RxHT && pdrvinfo->RxRate >= DESC90_RATEMCS8 &&
pdrvinfo->RxRate <= DESC90_RATEMCS15)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 705b94f0911e..605bce803b5f 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -1500,8 +1500,6 @@ static void _rtl92e_rx_normal(struct net_device *dev)
};
unsigned int count = priv->rxringcount;

- stats.nic_type = NIC_8192E;
-
while (count--) {
struct rx_desc *pdesc = &priv->rx_ring
[priv->rx_idx];
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index d764de9459e2..d238fce712a4 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -474,11 +474,9 @@ struct rtllib_rx_stats {
u8 control;
u8 mask;
u16 len;
- u8 nic_type;
u16 Length;
u8 SignalQuality;
s32 RecvSignalPower;
- s8 RxPower;
u8 SignalStrength;
u16 bHwError:1;
u16 bCRC:1;
--
2.43.2


2024-02-21 22:04:18

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 8/8] staging: rtl8192e: Remove unused variables ntotalfrag and Seq_Num

Remove unused variables ntotalfrag and Seq_Num as they are set and never
evaluated. Remove resulting local variables seq, sc and hdr as well.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 8 --------
drivers/staging/rtl8192e/rtllib.h | 2 --
2 files changed, 10 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index f1e97da8f077..b54dbc97d4ba 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -1346,14 +1346,7 @@ static void _rtl92e_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
static u32 slide_beacon_adc_pwdb_index;
static u32 slide_beacon_adc_pwdb_statistics;
static u32 last_beacon_adc_pwdb;
- struct ieee80211_hdr_3addr *hdr;
- u16 sc;
- unsigned int seq;

- hdr = (struct ieee80211_hdr_3addr *)buffer;
- sc = le16_to_cpu(hdr->seq_ctrl);
- seq = WLAN_GET_SEQ_SEQ(sc);
- curr_st->Seq_Num = seq;
if (!prev_st->bIsAMPDU)
bcheck = true;

@@ -1672,7 +1665,6 @@ bool rtl92e_get_rx_stats(struct net_device *dev, struct rtllib_rx_stats *stats,
_rtl92e_translate_rx_signal_stats(dev, skb, stats, pdesc, pDrvInfo);
skb_trim(skb, skb->len - S_CRC_LEN);

- stats->ntotalfrag = 1;
return true;
}

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 6b33643ddae0..c18169725452 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -496,10 +496,8 @@ struct rtllib_rx_stats {
bool bPacketMatchBSSID;
bool bIsCCK;
bool bPacketToSelf;
- u16 ntotalfrag;
bool bPacketBeacon;
bool bToSelfBA;
- u16 Seq_Num;
};

/* IEEE 802.11 requires that STA supports concurrent reception of at least
--
2.43.2