2023-10-23 06:39:38

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 00/11] staging: rtl8192e: Remove unused variable ucReserved and further

Replace custom macros with standard kernel macros.
Remove unused variables.

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

Philipp Hortmann (11):
staging: rtl8192e: Replace BIT0 to BIT9 with BIT(0) to BIT(9)
staging: rtl8192e: Replace BIT10 to BIT31 with BIT(10) to BIT(31)
staging: rtl8192e: Remove unused variables ucReserved and friends
staging: rtl8192e: Remove written but unevaluated variable ucUP
staging: rtl8192e: Remove unused variables from union tspec_body
staging: rtl8192e: Replace union tspec_body including embedded struct
staging: rtl8192e: Replace union qos_tsinfo with embedded struct
staging: rtl8192e: Remove unused struct acm
staging: rtl8192e: Remove last three parameters of MakeTSEntry()
staging: rtl8192e: Remove unused union qos_tclas
staging: rtl8192e: Remove unused variables TClasProc and TClasNum

drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h | 104 +++++++-------
.../staging/rtl8192e/rtl8192e/r8192E_phy.c | 4 +-
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 8 +-
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 22 +--
drivers/staging/rtl8192e/rtl8192e/rtl_pci.c | 2 +-
drivers/staging/rtl8192e/rtl819x_BAProc.c | 2 +-
drivers/staging/rtl8192e/rtl819x_Qos.h | 129 +-----------------
drivers/staging/rtl8192e/rtl819x_TS.h | 5 +-
drivers/staging/rtl8192e/rtl819x_TSProc.c | 42 ++----
drivers/staging/rtl8192e/rtllib.h | 12 +-
10 files changed, 92 insertions(+), 238 deletions(-)

--
2.42.0


2023-10-23 06:39:57

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 02/11] staging: rtl8192e: Replace BIT10 to BIT31 with BIT(10) to BIT(31)

Replace custom macros BIT10 to BIT31 with standard kernel macros BIT(10) to
BIT(31) to shorten code.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h | 34 +++++++++----------
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 8 ++---
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 20 +++++------
drivers/staging/rtl8192e/rtl819x_Qos.h | 23 -------------
drivers/staging/rtl8192e/rtllib.h | 8 ++---
5 files changed, 35 insertions(+), 58 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
index 80f44ffe00e6..1b444529b59c 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
@@ -61,12 +61,12 @@ enum _RTL8192PCI_HW {
#define CR_TE 0x04
SIFS = 0x03E,
RCR = 0x044,
-#define RCR_ONLYERLPKT BIT31
-#define RCR_CBSSID BIT23
-#define RCR_ADD3 BIT21
-#define RCR_AMF BIT20
-#define RCR_ADF BIT18
-#define RCR_AICV BIT12
+#define RCR_ONLYERLPKT BIT(31)
+#define RCR_CBSSID BIT(23)
+#define RCR_ADD3 BIT(21)
+#define RCR_AMF BIT(20)
+#define RCR_ADF BIT(18)
+#define RCR_AICV BIT(12)
#define RCR_AB BIT(3)
#define RCR_AM BIT(2)
#define RCR_APM BIT(1)
@@ -102,14 +102,14 @@ enum _RTL8192PCI_HW {
#define SCR_NoSKMC BIT(5)
SWREGULATOR = 0x0BD,
INTA_MASK = 0x0f4,
-#define IMR_TBDOK BIT27
-#define IMR_TBDER BIT26
-#define IMR_TXFOVW BIT15
-#define IMR_TIMEOUT0 BIT14
-#define IMR_BcnInt BIT13
-#define IMR_RXFOVW BIT12
-#define IMR_RDU BIT11
-#define IMR_RXCMDOK BIT10
+#define IMR_TBDOK BIT(27)
+#define IMR_TBDER BIT(26)
+#define IMR_TXFOVW BIT(15)
+#define IMR_TIMEOUT0 BIT(14)
+#define IMR_BcnInt BIT(13)
+#define IMR_RXFOVW BIT(12)
+#define IMR_RDU BIT(11)
+#define IMR_RXCMDOK BIT(10)
#define IMR_BDOK BIT(9)
#define IMR_HIGHDOK BIT(8)
#define IMR_COMDOK BIT(7)
@@ -188,9 +188,9 @@ enum _RTL8192PCI_HW {
#define RRSR_18M BIT(7)
#define RRSR_24M BIT(8)
#define RRSR_36M BIT(9)
-#define RRSR_48M BIT10
-#define RRSR_54M BIT11
-#define BRSR_AckShortPmb BIT23
+#define RRSR_48M BIT(10)
+#define RRSR_54M BIT(11)
+#define BRSR_AckShortPmb BIT(23)
UFWP = 0x318,
RATR0 = 0x320,
#define RATR_1M 0x00000001
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
index 76ec4ed967c4..69298c7c129a 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
@@ -17,7 +17,7 @@ void rtl92e_cam_reset(struct net_device *dev)
{
u32 ulcommand = 0;

- ulcommand |= BIT31 | BIT30;
+ ulcommand |= BIT(31) | BIT(30);
rtl92e_writel(dev, RWCAM, ulcommand);
}

@@ -89,13 +89,13 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
}

if (DefaultKey)
- usConfig |= BIT15 | (KeyType << 2);
+ usConfig |= BIT(15) | (KeyType << 2);
else
- usConfig |= BIT15 | (KeyType << 2) | KeyIndex;
+ usConfig |= BIT(15) | (KeyType << 2) | KeyIndex;

for (i = 0; i < CAM_CONTENT_COUNT; i++) {
TargetCommand = i + CAM_CONTENT_COUNT * EntryNo;
- TargetCommand |= BIT31 | BIT16;
+ TargetCommand |= BIT(31) | BIT(16);

if (i == 0) {
TargetContent = (u32)(*(MacAddr + 0)) << 16 |
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index e88963a4b1f1..330dafd62656 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -292,25 +292,25 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev)
ht_info->bCurShortGI20MHz);

pra->upper_rssi_threshold_ratr =
- (pra->upper_rssi_threshold_ratr & (~BIT31)) |
- ((bshort_gi_enabled) ? BIT31 : 0);
+ (pra->upper_rssi_threshold_ratr & (~BIT(31))) |
+ ((bshort_gi_enabled) ? BIT(31) : 0);

pra->middle_rssi_threshold_ratr =
- (pra->middle_rssi_threshold_ratr & (~BIT31)) |
- ((bshort_gi_enabled) ? BIT31 : 0);
+ (pra->middle_rssi_threshold_ratr & (~BIT(31))) |
+ ((bshort_gi_enabled) ? BIT(31) : 0);

if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) {
pra->low_rssi_threshold_ratr =
- (pra->low_rssi_threshold_ratr_40M & (~BIT31)) |
- ((bshort_gi_enabled) ? BIT31 : 0);
+ (pra->low_rssi_threshold_ratr_40M & (~BIT(31))) |
+ ((bshort_gi_enabled) ? BIT(31) : 0);
} else {
pra->low_rssi_threshold_ratr =
- (pra->low_rssi_threshold_ratr_20M & (~BIT31)) |
- ((bshort_gi_enabled) ? BIT31 : 0);
+ (pra->low_rssi_threshold_ratr_20M & (~BIT(31))) |
+ ((bshort_gi_enabled) ? BIT(31) : 0);
}
pra->ping_rssi_ratr =
- (pra->ping_rssi_ratr & (~BIT31)) |
- ((bshort_gi_enabled) ? BIT31 : 0);
+ (pra->ping_rssi_ratr & (~BIT(31))) |
+ ((bshort_gi_enabled) ? BIT(31) : 0);

if (pra->ratr_state == DM_RATR_STA_HIGH) {
high_rssi_thresh_for_ra = pra->high2low_rssi_thresh_for_ra;
diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h
index 519a3160933b..a43a5142e96f 100644
--- a/drivers/staging/rtl8192e/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192e/rtl819x_Qos.h
@@ -7,29 +7,6 @@
#ifndef __INC_QOS_TYPE_H
#define __INC_QOS_TYPE_H

-#define BIT10 0x00000400
-#define BIT11 0x00000800
-#define BIT12 0x00001000
-#define BIT13 0x00002000
-#define BIT14 0x00004000
-#define BIT15 0x00008000
-#define BIT16 0x00010000
-#define BIT17 0x00020000
-#define BIT18 0x00040000
-#define BIT19 0x00080000
-#define BIT20 0x00100000
-#define BIT21 0x00200000
-#define BIT22 0x00400000
-#define BIT23 0x00800000
-#define BIT24 0x01000000
-#define BIT25 0x02000000
-#define BIT26 0x04000000
-#define BIT27 0x08000000
-#define BIT28 0x10000000
-#define BIT29 0x20000000
-#define BIT30 0x40000000
-#define BIT31 0x80000000
-
union qos_tsinfo {
u8 charData[3];
struct {
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 7f0aa0779c78..dc3488d9693f 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -1085,10 +1085,10 @@ struct rt_pwr_save_ctrl {

#define RT_RF_CHANGE_SOURCE u32

-#define RF_CHANGE_BY_SW BIT31
-#define RF_CHANGE_BY_HW BIT30
-#define RF_CHANGE_BY_PS BIT29
-#define RF_CHANGE_BY_IPS BIT28
+#define RF_CHANGE_BY_SW BIT(31)
+#define RF_CHANGE_BY_HW BIT(30)
+#define RF_CHANGE_BY_PS BIT(29)
+#define RF_CHANGE_BY_IPS BIT(28)
#define RF_CHANGE_BY_INIT 0

enum country_code_type {
--
2.42.0

2023-10-23 06:39:58

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 01/11] staging: rtl8192e: Replace BIT0 to BIT9 with BIT(0) to BIT(9)

Replace custom macros BIT0 to BIT9 with standard kernel macros BIT(0) to
BIT(9) to shorten code.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h | 70 +++++++++----------
.../staging/rtl8192e/rtl8192e/r8192E_phy.c | 4 +-
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 2 +-
drivers/staging/rtl8192e/rtl8192e/rtl_pci.c | 2 +-
drivers/staging/rtl8192e/rtl819x_Qos.h | 10 ---
drivers/staging/rtl8192e/rtllib.h | 4 +-
6 files changed, 41 insertions(+), 51 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
index 09f8c76b7e65..80f44ffe00e6 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
@@ -43,7 +43,7 @@ enum _RTL8192PCI_HW {
PMR = 0x00c,
EPROM_CMD = 0x00e,

-#define EPROM_CMD_9356SEL BIT4
+#define EPROM_CMD_9356SEL BIT(4)
#define EPROM_CMD_OPERATING_MODE_SHIFT 6
#define EPROM_CMD_NORMAL 0
#define EPROM_CMD_PROGRAM 2
@@ -67,10 +67,10 @@ enum _RTL8192PCI_HW {
#define RCR_AMF BIT20
#define RCR_ADF BIT18
#define RCR_AICV BIT12
-#define RCR_AB BIT3
-#define RCR_AM BIT2
-#define RCR_APM BIT1
-#define RCR_AAP BIT0
+#define RCR_AB BIT(3)
+#define RCR_AM BIT(2)
+#define RCR_APM BIT(1)
+#define RCR_AAP BIT(0)
#define RCR_MXDMA_OFFSET 8
#define RCR_FIFO_OFFSET 13
SLOT_TIME = 0x049,
@@ -95,11 +95,11 @@ enum _RTL8192PCI_HW {
#define TOTAL_CAM_ENTRY 32
WCAMI = 0x0A4,
SECR = 0x0B0,
-#define SCR_TxUseDK BIT0
-#define SCR_RxUseDK BIT1
-#define SCR_TxEncEnable BIT2
-#define SCR_RxDecEnable BIT3
-#define SCR_NoSKMC BIT5
+#define SCR_TxUseDK BIT(0)
+#define SCR_RxUseDK BIT(1)
+#define SCR_TxEncEnable BIT(2)
+#define SCR_RxDecEnable BIT(3)
+#define SCR_NoSKMC BIT(5)
SWREGULATOR = 0x0BD,
INTA_MASK = 0x0f4,
#define IMR_TBDOK BIT27
@@ -110,19 +110,19 @@ enum _RTL8192PCI_HW {
#define IMR_RXFOVW BIT12
#define IMR_RDU BIT11
#define IMR_RXCMDOK BIT10
-#define IMR_BDOK BIT9
-#define IMR_HIGHDOK BIT8
-#define IMR_COMDOK BIT7
-#define IMR_MGNTDOK BIT6
-#define IMR_HCCADOK BIT5
-#define IMR_BKDOK BIT4
-#define IMR_BEDOK BIT3
-#define IMR_VIDOK BIT2
-#define IMR_VODOK BIT1
-#define IMR_ROK BIT0
+#define IMR_BDOK BIT(9)
+#define IMR_HIGHDOK BIT(8)
+#define IMR_COMDOK BIT(7)
+#define IMR_MGNTDOK BIT(6)
+#define IMR_HCCADOK BIT(5)
+#define IMR_BKDOK BIT(4)
+#define IMR_BEDOK BIT(3)
+#define IMR_VIDOK BIT(2)
+#define IMR_VODOK BIT(1)
+#define IMR_ROK BIT(0)
ISR = 0x0f8,
TP_POLL = 0x0fd,
-#define TP_POLL_CQ BIT5
+#define TP_POLL_CQ BIT(5)
PSR = 0x0ff,
CPU_GEN = 0x100,
#define CPU_CCK_LOOPBACK 0x00030000
@@ -136,9 +136,9 @@ enum _RTL8192PCI_HW {
#define CPU_GEN_NO_LOOPBACK_MSK 0xFFF8FFFF
#define CPU_GEN_NO_LOOPBACK_SET 0x00080000
ACM_HW_CTRL = 0x171,
-#define ACM_HW_BEQ_EN BIT1
-#define ACM_HW_VIQ_EN BIT2
-#define ACM_HW_VOQ_EN BIT3
+#define ACM_HW_BEQ_EN BIT(1)
+#define ACM_HW_VIQ_EN BIT(2)
+#define ACM_HW_VOQ_EN BIT(3)
RQPN1 = 0x180,
RQPN2 = 0x184,
RQPN3 = 0x188,
@@ -159,7 +159,7 @@ enum _RTL8192PCI_HW {
WFCRC2 = 0x2f8,

BW_OPMODE = 0x300,
-#define BW_OPMODE_20MHZ BIT2
+#define BW_OPMODE_20MHZ BIT(2)
IC_VERRSION = 0x301,
MSR = 0x303,
#define MSR_LINK_MASK (BIT(1) | BIT(0))
@@ -178,16 +178,16 @@ enum _RTL8192PCI_HW {
TSFR = 0x308,
RRSR = 0x310,
#define RRSR_SHORT_OFFSET 23
-#define RRSR_1M BIT0
-#define RRSR_2M BIT1
-#define RRSR_5_5M BIT2
-#define RRSR_11M BIT3
-#define RRSR_6M BIT4
-#define RRSR_9M BIT5
-#define RRSR_12M BIT6
-#define RRSR_18M BIT7
-#define RRSR_24M BIT8
-#define RRSR_36M BIT9
+#define RRSR_1M BIT(0)
+#define RRSR_2M BIT(1)
+#define RRSR_5_5M BIT(2)
+#define RRSR_11M BIT(3)
+#define RRSR_6M BIT(4)
+#define RRSR_9M BIT(5)
+#define RRSR_12M BIT(6)
+#define RRSR_18M BIT(7)
+#define RRSR_24M BIT(8)
+#define RRSR_36M BIT(9)
#define RRSR_48M BIT10
#define RRSR_54M BIT11
#define BRSR_AckShortPmb BIT23
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index a5e16bf99cd6..4d12d7385041 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -965,7 +965,7 @@ void rtl92e_init_gain(struct net_device *dev, u8 Operation)

void rtl92e_set_rf_off(struct net_device *dev)
{
- rtl92e_set_bb_reg(dev, rFPGA0_XA_RFInterfaceOE, BIT4, 0x0);
+ rtl92e_set_bb_reg(dev, rFPGA0_XA_RFInterfaceOE, BIT(4), 0x0);
rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter4, 0x300, 0x0);
rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter1, 0x18, 0x0);
rtl92e_set_bb_reg(dev, rOFDM0_TRxPathEnable, 0xf, 0x0);
@@ -1016,7 +1016,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
0x4, 0x1);
priv->hw_rf_off_action = 0;
rtl92e_set_bb_reg(dev, rFPGA0_XA_RFInterfaceOE,
- BIT4, 0x1);
+ BIT(4), 0x1);
rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter4,
0x300, 0x3);
rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter1,
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index 97de404840df..e88963a4b1f1 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -1247,7 +1247,7 @@ static void _rtl92e_dm_check_rf_ctrl_gpio(void *data)

tmp1byte = rtl92e_readb(dev, GPI);

- rf_power_state_to_set = (tmp1byte & BIT1) ? rf_on : rf_off;
+ rf_power_state_to_set = (tmp1byte & BIT(1)) ? rf_on : rf_off;

if (priv->hw_radio_off && (rf_power_state_to_set == rf_on)) {
netdev_info(dev, "gpiochangeRF - HW Radio ON\n");
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c b/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c
index 0bc3e013001e..1aa73561581b 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c
@@ -21,7 +21,7 @@ static void _rtl92e_parse_pci_configuration(struct pci_dev *pdev,
pcie_capability_read_word(priv->pdev, PCI_EXP_LNKCTL, &link_ctrl_reg);

pci_read_config_byte(pdev, 0x98, &tmp);
- tmp |= BIT4;
+ tmp |= BIT(4);
pci_write_config_byte(pdev, 0x98, tmp);

tmp = 0x17;
diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h
index 37677366c397..519a3160933b 100644
--- a/drivers/staging/rtl8192e/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192e/rtl819x_Qos.h
@@ -7,16 +7,6 @@
#ifndef __INC_QOS_TYPE_H
#define __INC_QOS_TYPE_H

-#define BIT0 0x00000001
-#define BIT1 0x00000002
-#define BIT2 0x00000004
-#define BIT3 0x00000008
-#define BIT4 0x00000010
-#define BIT5 0x00000020
-#define BIT6 0x00000040
-#define BIT7 0x00000080
-#define BIT8 0x00000100
-#define BIT9 0x00000200
#define BIT10 0x00000400
#define BIT11 0x00000800
#define BIT12 0x00001000
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 9d141aad8cd5..7f0aa0779c78 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -91,7 +91,7 @@ static inline void *netdev_priv_rsl(struct net_device *dev)
#define IE_CISCO_FLAG_POSITION 0x08
#define SUPPORT_CKIP_MIC 0x08
#define SUPPORT_CKIP_PK 0x10
-#define RT_RF_OFF_LEVL_HALT_NIC BIT3
+#define RT_RF_OFF_LEVL_HALT_NIC BIT(3)
#define RT_IN_PS_LEVEL(psc, _PS_FLAG) \
((psc->CurPsLevel & _PS_FLAG) ? true : false)
#define RT_CLEAR_PS_LEVEL(psc, _PS_FLAG) \
@@ -341,7 +341,7 @@ enum rt_op_mode {
/* QOS control */
#define RTLLIB_QCTL_TID 0x000F

-#define FC_QOS_BIT BIT7
+#define FC_QOS_BIT BIT(7)
#define IsDataFrame(pdu) (((pdu[0] & 0x0C) == 0x08) ? true : false)
#define IsLegacyDataFrame(pdu) (IsDataFrame(pdu) && (!(pdu[0]&FC_QOS_BIT)))
#define IsQoSDataFrame(pframe) \
--
2.42.0

2023-10-23 06:40:01

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 03/11] staging: rtl8192e: Remove unused variables ucReserved and friends

Remove unused variables ucReserved, ucSchedule, ucTSInfoAckPolicy, ucPSB,
ucAggregation, ucAccessPolicy, ucTrafficType and charData.

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

diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h
index a43a5142e96f..5cdecec496e0 100644
--- a/drivers/staging/rtl8192e/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192e/rtl819x_Qos.h
@@ -8,18 +8,10 @@
#define __INC_QOS_TYPE_H

union qos_tsinfo {
- u8 charData[3];
struct {
- u8 ucTrafficType:1;
u8 ucTSID:4;
u8 ucDirection:2;
- u8 ucAccessPolicy:2;
- u8 ucAggregation:1;
- u8 ucPSB:1;
u8 ucUP:3;
- u8 ucTSInfoAckPolicy:2;
- u8 ucSchedule:1;
- u8 ucReserved:7;
} field;
};

diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c
index 95e735c078e4..af4d31a66853 100644
--- a/drivers/staging/rtl8192e/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c
@@ -318,15 +318,9 @@ bool rtllib_get_ts(struct rtllib_device *ieee, struct ts_common_info **ppTS,
netdev_dbg(ieee->dev,
"to init current TS, UP:%d, Dir:%d, addr: %pM ppTs=%p\n",
UP, Dir, addr, *ppTS);
- ts_info->field.ucTrafficType = 0;
ts_info->field.ucTSID = UP;
ts_info->field.ucDirection = Dir;
- ts_info->field.ucAccessPolicy = 1;
- ts_info->field.ucAggregation = 0;
- ts_info->field.ucPSB = 0;
ts_info->field.ucUP = UP;
- ts_info->field.ucTSInfoAckPolicy = 0;
- ts_info->field.ucSchedule = 0;

MakeTSEntry(*ppTS, addr, &TSpec, NULL, 0, 0);
list_add_tail(&((*ppTS)->List), pAddmitList);
--
2.42.0

2023-10-23 06:40:19

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 04/11] staging: rtl8192e: Remove written but unevaluated variable ucUP

Remove variable ucUP as its value is written but never evaluated.

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

diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h
index 5cdecec496e0..7f086b7a1b88 100644
--- a/drivers/staging/rtl8192e/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192e/rtl819x_Qos.h
@@ -11,7 +11,6 @@ union qos_tsinfo {
struct {
u8 ucTSID:4;
u8 ucDirection:2;
- u8 ucUP:3;
} field;
};

diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c
index af4d31a66853..879e169539c8 100644
--- a/drivers/staging/rtl8192e/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c
@@ -320,7 +320,6 @@ bool rtllib_get_ts(struct rtllib_device *ieee, struct ts_common_info **ppTS,
UP, Dir, addr, *ppTS);
ts_info->field.ucTSID = UP;
ts_info->field.ucDirection = Dir;
- ts_info->field.ucUP = UP;

MakeTSEntry(*ppTS, addr, &TSpec, NULL, 0, 0);
list_add_tail(&((*ppTS)->List), pAddmitList);
--
2.42.0

2023-10-23 06:40:56

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 07/11] staging: rtl8192e: Replace union qos_tsinfo with embedded struct

Replace union qos_tsinfo with embedded struct as it has only one element.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl819x_BAProc.c | 2 +-
drivers/staging/rtl8192e/rtl819x_Qos.h | 8 +++-----
drivers/staging/rtl8192e/rtl819x_TS.h | 2 +-
drivers/staging/rtl8192e/rtl819x_TSProc.c | 18 +++++++++---------
4 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c
index f01fb7131c7e..4af8055d2489 100644
--- a/drivers/staging/rtl8192e/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c
@@ -474,7 +474,7 @@ void rtllib_ts_init_add_ba(struct rtllib_device *ieee, struct tx_ts_record *ts,
ba->dialog_token++;
ba->ba_param_set.field.amsdu_support = 0;
ba->ba_param_set.field.ba_policy = policy;
- ba->ba_param_set.field.tid = ts->TsCommonInfo.TSpec.field.ucTSID;
+ ba->ba_param_set.field.tid = ts->TsCommonInfo.TSpec.ucTSID;
ba->ba_param_set.field.buffer_size = 32;
ba->ba_timeout_value = 0;
ba->ba_start_seq_ctrl.field.seq_num = (ts->TxCurSeq + 3) % 4096;
diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h
index 73fdf6aaed67..64a1e6aa501b 100644
--- a/drivers/staging/rtl8192e/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192e/rtl819x_Qos.h
@@ -7,11 +7,9 @@
#ifndef __INC_QOS_TYPE_H
#define __INC_QOS_TYPE_H

-union qos_tsinfo {
- struct {
- u8 ucTSID:4;
- u8 ucDirection:2;
- } field;
+struct qos_tsinfo {
+ u8 ucTSID:4;
+ u8 ucDirection:2;
};

struct octet_string {
diff --git a/drivers/staging/rtl8192e/rtl819x_TS.h b/drivers/staging/rtl8192e/rtl819x_TS.h
index ed77763bb1fc..b63edb815902 100644
--- a/drivers/staging/rtl8192e/rtl819x_TS.h
+++ b/drivers/staging/rtl8192e/rtl819x_TS.h
@@ -20,7 +20,7 @@ enum tr_select {
struct ts_common_info {
struct list_head List;
u8 addr[ETH_ALEN];
- union qos_tsinfo TSpec;
+ struct qos_tsinfo TSpec;
union qos_tclas TClass[TCLAS_NUM];
u8 TClasProc;
u8 TClasNum;
diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c
index 969418031f5f..fbbe538f0632 100644
--- a/drivers/staging/rtl8192e/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c
@@ -94,7 +94,7 @@ static void TsAddBaProcess(struct timer_list *t)
static void ResetTsCommonInfo(struct ts_common_info *pTsCommonInfo)
{
eth_zero_addr(pTsCommonInfo->addr);
- memset(&pTsCommonInfo->TSpec, 0, sizeof(union qos_tsinfo));
+ memset(&pTsCommonInfo->TSpec, 0, sizeof(struct qos_tsinfo));
memset(&pTsCommonInfo->TClass, 0, sizeof(union qos_tclas) * TCLAS_NUM);
pTsCommonInfo->TClasProc = 0;
pTsCommonInfo->TClasNum = 0;
@@ -201,8 +201,8 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee,
continue;
list_for_each_entry(pRet, psearch_list, List) {
if (memcmp(pRet->addr, addr, 6) == 0 &&
- pRet->TSpec.field.ucTSID == TID &&
- pRet->TSpec.field.ucDirection == dir)
+ pRet->TSpec.ucTSID == TID &&
+ pRet->TSpec.ucDirection == dir)
break;
}
if (&pRet->List != psearch_list)
@@ -215,7 +215,7 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee,
}

static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *addr,
- union qos_tsinfo *pTSPEC, union qos_tclas *pTCLAS,
+ struct qos_tsinfo *pTSPEC, union qos_tclas *pTCLAS,
u8 TCLAS_Num, u8 TCLAS_Proc)
{
u8 count;
@@ -227,7 +227,7 @@ static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *addr,

if (pTSPEC)
memcpy((u8 *)(&(pTsCommonInfo->TSpec)), (u8 *)pTSPEC,
- sizeof(union qos_tsinfo));
+ sizeof(struct qos_tsinfo));

for (count = 0; count < TCLAS_Num; count++)
memcpy((u8 *)(&(pTsCommonInfo->TClass[count])),
@@ -241,8 +241,8 @@ bool rtllib_get_ts(struct rtllib_device *ieee, struct ts_common_info **ppTS,
u8 *addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs)
{
u8 UP = 0;
- union qos_tsinfo TSpec;
- union qos_tsinfo *ts_info = &TSpec;
+ struct qos_tsinfo TSpec;
+ struct qos_tsinfo *ts_info = &TSpec;
struct list_head *pUnusedList;
struct list_head *pAddmitList;
enum direction_value Dir;
@@ -318,8 +318,8 @@ bool rtllib_get_ts(struct rtllib_device *ieee, struct ts_common_info **ppTS,
netdev_dbg(ieee->dev,
"to init current TS, UP:%d, Dir:%d, addr: %pM ppTs=%p\n",
UP, Dir, addr, *ppTS);
- ts_info->field.ucTSID = UP;
- ts_info->field.ucDirection = Dir;
+ ts_info->ucTSID = UP;
+ ts_info->ucDirection = Dir;

MakeTSEntry(*ppTS, addr, &TSpec, NULL, 0, 0);
list_add_tail(&((*ppTS)->List), pAddmitList);
--
2.42.0

2023-10-23 06:41:21

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 06/11] staging: rtl8192e: Replace union tspec_body including embedded struct

Replace union tspec_body including embedded struct with embedded union as
it has only one element. This will increase readability of the code.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl819x_BAProc.c | 2 +-
drivers/staging/rtl8192e/rtl819x_Qos.h | 6 ------
drivers/staging/rtl8192e/rtl819x_TS.h | 2 +-
drivers/staging/rtl8192e/rtl819x_TSProc.c | 14 +++++++-------
4 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c
index 93b566482149..f01fb7131c7e 100644
--- a/drivers/staging/rtl8192e/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c
@@ -474,7 +474,7 @@ void rtllib_ts_init_add_ba(struct rtllib_device *ieee, struct tx_ts_record *ts,
ba->dialog_token++;
ba->ba_param_set.field.amsdu_support = 0;
ba->ba_param_set.field.ba_policy = policy;
- ba->ba_param_set.field.tid = ts->TsCommonInfo.TSpec.f.ts_info.field.ucTSID;
+ ba->ba_param_set.field.tid = ts->TsCommonInfo.TSpec.field.ucTSID;
ba->ba_param_set.field.buffer_size = 32;
ba->ba_timeout_value = 0;
ba->ba_start_seq_ctrl.field.seq_num = (ts->TxCurSeq + 3) % 4096;
diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h
index ac321952f7b3..73fdf6aaed67 100644
--- a/drivers/staging/rtl8192e/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192e/rtl819x_Qos.h
@@ -14,12 +14,6 @@ union qos_tsinfo {
} field;
};

-union tspec_body {
- struct {
- union qos_tsinfo ts_info;
- } f;
-};
-
struct octet_string {
u8 *Octet;
u16 Length;
diff --git a/drivers/staging/rtl8192e/rtl819x_TS.h b/drivers/staging/rtl8192e/rtl819x_TS.h
index a9770592a8c9..ed77763bb1fc 100644
--- a/drivers/staging/rtl8192e/rtl819x_TS.h
+++ b/drivers/staging/rtl8192e/rtl819x_TS.h
@@ -20,7 +20,7 @@ enum tr_select {
struct ts_common_info {
struct list_head List;
u8 addr[ETH_ALEN];
- union tspec_body TSpec;
+ union qos_tsinfo TSpec;
union qos_tclas TClass[TCLAS_NUM];
u8 TClasProc;
u8 TClasNum;
diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c
index 879e169539c8..969418031f5f 100644
--- a/drivers/staging/rtl8192e/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c
@@ -94,7 +94,7 @@ static void TsAddBaProcess(struct timer_list *t)
static void ResetTsCommonInfo(struct ts_common_info *pTsCommonInfo)
{
eth_zero_addr(pTsCommonInfo->addr);
- memset(&pTsCommonInfo->TSpec, 0, sizeof(union tspec_body));
+ memset(&pTsCommonInfo->TSpec, 0, sizeof(union qos_tsinfo));
memset(&pTsCommonInfo->TClass, 0, sizeof(union qos_tclas) * TCLAS_NUM);
pTsCommonInfo->TClasProc = 0;
pTsCommonInfo->TClasNum = 0;
@@ -201,8 +201,8 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee,
continue;
list_for_each_entry(pRet, psearch_list, List) {
if (memcmp(pRet->addr, addr, 6) == 0 &&
- pRet->TSpec.f.ts_info.field.ucTSID == TID &&
- pRet->TSpec.f.ts_info.field.ucDirection == dir)
+ pRet->TSpec.field.ucTSID == TID &&
+ pRet->TSpec.field.ucDirection == dir)
break;
}
if (&pRet->List != psearch_list)
@@ -215,7 +215,7 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee,
}

static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *addr,
- union tspec_body *pTSPEC, union qos_tclas *pTCLAS,
+ union qos_tsinfo *pTSPEC, union qos_tclas *pTCLAS,
u8 TCLAS_Num, u8 TCLAS_Proc)
{
u8 count;
@@ -227,7 +227,7 @@ static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *addr,

if (pTSPEC)
memcpy((u8 *)(&(pTsCommonInfo->TSpec)), (u8 *)pTSPEC,
- sizeof(union tspec_body));
+ sizeof(union qos_tsinfo));

for (count = 0; count < TCLAS_Num; count++)
memcpy((u8 *)(&(pTsCommonInfo->TClass[count])),
@@ -241,8 +241,8 @@ bool rtllib_get_ts(struct rtllib_device *ieee, struct ts_common_info **ppTS,
u8 *addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs)
{
u8 UP = 0;
- union tspec_body TSpec;
- union qos_tsinfo *ts_info = &TSpec.f.ts_info;
+ union qos_tsinfo TSpec;
+ union qos_tsinfo *ts_info = &TSpec;
struct list_head *pUnusedList;
struct list_head *pAddmitList;
enum direction_value Dir;
--
2.42.0

2023-10-23 06:41:30

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 08/11] staging: rtl8192e: Remove unused struct acm

Remove unused struct acm to shorten code.

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

diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h
index 64a1e6aa501b..9a9ef5fef6e0 100644
--- a/drivers/staging/rtl8192e/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192e/rtl819x_Qos.h
@@ -30,12 +30,6 @@ enum direction_value {
DIR_BI_DIR = 3,
};

-struct acm {
- u64 UsedTime;
- u64 MediumTime;
- u8 HwAcmCtl;
-};
-
union qos_tclas {
struct _TYPE_GENERAL {
u8 Priority;
--
2.42.0

2023-10-23 06:41:32

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 10/11] staging: rtl8192e: Remove unused union qos_tclas

Remove union qos_tclas as it is just set to 0 and never used.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl819x_Qos.h | 50 -----------------------
drivers/staging/rtl8192e/rtl819x_TS.h | 1 -
drivers/staging/rtl8192e/rtl819x_TSProc.c | 1 -
3 files changed, 52 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h
index 9a9ef5fef6e0..f547de4c1da3 100644
--- a/drivers/staging/rtl8192e/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192e/rtl819x_Qos.h
@@ -30,56 +30,6 @@ enum direction_value {
DIR_BI_DIR = 3,
};

-union qos_tclas {
- struct _TYPE_GENERAL {
- u8 Priority;
- u8 ClassifierType;
- u8 Mask;
- } TYPE_GENERAL;
-
- struct _TYPE0_ETH {
- u8 Priority;
- u8 ClassifierType;
- u8 Mask;
- u8 SrcAddr[ETH_ALEN];
- u8 DstAddr[ETH_ALEN];
- u16 Type;
- } TYPE0_ETH;
-
- struct _TYPE1_IPV4 {
- u8 Priority;
- u8 ClassifierType;
- u8 Mask;
- u8 Version;
- u8 SrcIP[4];
- u8 DstIP[4];
- u16 SrcPort;
- u16 DstPort;
- u8 DSCP;
- u8 Protocol;
- u8 Reserved;
- } TYPE1_IPV4;
-
- struct _TYPE1_IPV6 {
- u8 Priority;
- u8 ClassifierType;
- u8 Mask;
- u8 Version;
- u8 SrcIP[16];
- u8 DstIP[16];
- u16 SrcPort;
- u16 DstPort;
- u8 FlowLabel[3];
- } TYPE1_IPV6;
-
- struct _TYPE2_8021Q {
- u8 Priority;
- u8 ClassifierType;
- u8 Mask;
- u16 TagType;
- } TYPE2_8021Q;
-};
-
union aci_aifsn {
u8 charData;

diff --git a/drivers/staging/rtl8192e/rtl819x_TS.h b/drivers/staging/rtl8192e/rtl819x_TS.h
index b63edb815902..240e808fc4b2 100644
--- a/drivers/staging/rtl8192e/rtl819x_TS.h
+++ b/drivers/staging/rtl8192e/rtl819x_TS.h
@@ -21,7 +21,6 @@ struct ts_common_info {
struct list_head List;
u8 addr[ETH_ALEN];
struct qos_tsinfo TSpec;
- union qos_tclas TClass[TCLAS_NUM];
u8 TClasProc;
u8 TClasNum;
};
diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c
index 96022c5ed60f..7151827408b9 100644
--- a/drivers/staging/rtl8192e/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c
@@ -95,7 +95,6 @@ static void ResetTsCommonInfo(struct ts_common_info *pTsCommonInfo)
{
eth_zero_addr(pTsCommonInfo->addr);
memset(&pTsCommonInfo->TSpec, 0, sizeof(struct qos_tsinfo));
- memset(&pTsCommonInfo->TClass, 0, sizeof(union qos_tclas) * TCLAS_NUM);
pTsCommonInfo->TClasProc = 0;
pTsCommonInfo->TClasNum = 0;
}
--
2.42.0

2023-10-23 06:41:41

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 05/11] staging: rtl8192e: Remove unused variables from union tspec_body

Remove unused variables to shorten code.

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

diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h
index 7f086b7a1b88..ac321952f7b3 100644
--- a/drivers/staging/rtl8192e/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192e/rtl819x_Qos.h
@@ -15,25 +15,8 @@ union qos_tsinfo {
};

union tspec_body {
- u8 charData[55];
-
struct {
union qos_tsinfo ts_info;
- u16 NominalMSDUsize;
- u16 MaxMSDUsize;
- u32 MinServiceItv;
- u32 MaxServiceItv;
- u32 InactivityItv;
- u32 SuspenItv;
- u32 ServiceStartTime;
- u32 MinDataRate;
- u32 MeanDataRate;
- u32 PeakDataRate;
- u32 MaxBurstSize;
- u32 DelayBound;
- u32 MinPhyRate;
- u16 SurplusBandwidthAllowance;
- u16 MediumTime;
} f;
};

--
2.42.0

2023-10-23 06:41:47

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 09/11] staging: rtl8192e: Remove last three parameters of MakeTSEntry()

Remove last three parameters of MakeTSEntry() as those are always Null
or 0.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/rtl819x_TSProc.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c
index fbbe538f0632..96022c5ed60f 100644
--- a/drivers/staging/rtl8192e/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c
@@ -215,11 +215,8 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee,
}

static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *addr,
- struct qos_tsinfo *pTSPEC, union qos_tclas *pTCLAS,
- u8 TCLAS_Num, u8 TCLAS_Proc)
+ struct qos_tsinfo *pTSPEC)
{
- u8 count;
-
if (!pTsCommonInfo)
return;

@@ -228,13 +225,6 @@ static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *addr,
if (pTSPEC)
memcpy((u8 *)(&(pTsCommonInfo->TSpec)), (u8 *)pTSPEC,
sizeof(struct qos_tsinfo));
-
- for (count = 0; count < TCLAS_Num; count++)
- memcpy((u8 *)(&(pTsCommonInfo->TClass[count])),
- (u8 *)pTCLAS, sizeof(union qos_tclas));
-
- pTsCommonInfo->TClasProc = TCLAS_Proc;
- pTsCommonInfo->TClasNum = TCLAS_Num;
}

bool rtllib_get_ts(struct rtllib_device *ieee, struct ts_common_info **ppTS,
@@ -321,7 +311,7 @@ bool rtllib_get_ts(struct rtllib_device *ieee, struct ts_common_info **ppTS,
ts_info->ucTSID = UP;
ts_info->ucDirection = Dir;

- MakeTSEntry(*ppTS, addr, &TSpec, NULL, 0, 0);
+ MakeTSEntry(*ppTS, addr, &TSpec);
list_add_tail(&((*ppTS)->List), pAddmitList);

return true;
--
2.42.0

2023-10-23 06:41:48

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 11/11] staging: rtl8192e: Remove unused variables TClasProc and TClasNum

Remove unused variables to shorten code.

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

diff --git a/drivers/staging/rtl8192e/rtl819x_TS.h b/drivers/staging/rtl8192e/rtl819x_TS.h
index 240e808fc4b2..ab737428d4a7 100644
--- a/drivers/staging/rtl8192e/rtl819x_TS.h
+++ b/drivers/staging/rtl8192e/rtl819x_TS.h
@@ -21,8 +21,6 @@ struct ts_common_info {
struct list_head List;
u8 addr[ETH_ALEN];
struct qos_tsinfo TSpec;
- u8 TClasProc;
- u8 TClasNum;
};

struct tx_ts_record {
diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c
index 7151827408b9..3206fdb3e65a 100644
--- a/drivers/staging/rtl8192e/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c
@@ -95,8 +95,6 @@ static void ResetTsCommonInfo(struct ts_common_info *pTsCommonInfo)
{
eth_zero_addr(pTsCommonInfo->addr);
memset(&pTsCommonInfo->TSpec, 0, sizeof(struct qos_tsinfo));
- pTsCommonInfo->TClasProc = 0;
- pTsCommonInfo->TClasNum = 0;
}

static void ResetTxTsEntry(struct tx_ts_record *ts)
--
2.42.0