Skip to contentSkip to conversation

staging: rtl8192e: Cleanup multiple issues

PATCH In review Teddy Engel 2 participants 7 messages Jun 13, 2024 – Jun 14, 2024 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover staging: rtl8192e: Cleanup multiple issues

Remove some unused constants, macros, and structs. Capitalize a constant.

The patch order matters - please apply in order.

Teddy Engel (5):
staging: rtl8192e: Remove unused constants
staging: rtl8192e: Remove unused struct phy_ofdm_rx_status_rxsc
staging: rtl8192e: Capitalize constant RegC38_TH
staging: rtl8192e: Remove unused macro dm_tx_bb_gain_idx_to_amplify
staging: rtl8192e: Remove unnecessary pre-declaration of struct
net_device

 drivers/staging/rtl8192e/rtl8192e/r8190P_def.h | 9 ---------
 drivers/staging/rtl8192e/rtl8192e/rtl_cam.h    | 1 -
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c     | 4 ++--
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.h     | 6 +-----
 drivers/staging/rtl8192e/rtl8192e/rtl_pci.h    | 1 -
 5 files changed, 3 insertions(+), 18 deletions(-)
Signature · 1 line
2.39.2
#1 lore raw

PATCH v2 1/5 staging: rtl8192e: Remove unused constants

Remove unused constants: IC_VersionCut_C, IC_VersionCut_E, WA_IOT_TH_VAL

---
v2: Combine unused constants patches

---
 drivers/staging/rtl8192e/rtl8192e/r8190P_def.h | 2 --
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.h     | 2 --
 2 files changed, 4 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8190P_def.h +0 -2
index 8c85f1c866d3..486397d7db84 100644
@@ -88,9 +88,7 @@ enum version_8190_loopback {
 	VERSION_8190_BE
 };
 
-#define IC_VersionCut_C	0x2
 #define IC_VersionCut_D	0x3
-#define IC_VersionCut_E	0x4
 
 enum rf_optype {
 	RF_OP_By_SW_3wire = 0,
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h +0 -2
index 84e673452be4..863af8ef9f94 100644
@@ -33,8 +33,6 @@
 #define		RATE_ADAPTIVE_TH_LOW_40M		10
 #define		VERY_LOW_RSSI				15
 
-#define		WA_IOT_TH_VAL				25
-
 #define		E_FOR_TX_POWER_TRACK	       300
 #define		TX_POWER_NEAR_FIELD_THRESH_HIGH		68
 #define		TX_POWER_NEAR_FIELD_THRESH_LOW		62
Signature · 1 line
2.39.2
#2 lore raw

PATCH v2 2/5 staging: rtl8192e: Remove unused struct phy_ofdm_rx_status_rxsc

In reply to Teddy Engel

Remove unused struct declaration.

---
 drivers/staging/rtl8192e/rtl8192e/r8190P_def.h | 7 -------
 1 file changed, 7 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8190P_def.h +0 -7
index 486397d7db84..d87bace0a19b 100644
@@ -136,13 +136,6 @@ struct tx_fwinfo_8190pci {
 	u32			PacketID:13;
 };
 
-struct phy_ofdm_rx_status_rxsc_sgien_exintfflag {
-	u8			reserved:4;
-	u8			rxsc:2;
-	u8			sgi_en:1;
-	u8			ex_intf_flag:1;
-};
-
 struct phy_sts_ofdm_819xpci {
 	u8	trsw_gain_X[4];
 	u8	pwdb_all;
Signature · 1 line
2.39.2
#3 lore raw

PATCH v2 3/5 staging: rtl8192e: Capitalize constant RegC38_TH

In reply to Teddy Engel

According to kernel coding style, capitalize defined constant.

---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 4 ++--
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +2 -2
index 5392d2daf870..4863ced04916 100644
@@ -1752,7 +1752,7 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev)
 
 		if (priv->rtllib->link_state == MAC80211_LINKED) {
 			if (priv->undecorated_smoothed_pwdb <=
-			    RegC38_TH) {
+			    REG_C38_TH) {
 				if (reg_c38_State !=
 				    RegC38_NonFsync_Other_AP) {
 					rtl92e_writeb(dev,
@@ -1763,7 +1763,7 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev)
 					     RegC38_NonFsync_Other_AP;
 				}
 			} else if (priv->undecorated_smoothed_pwdb >=
-				   (RegC38_TH + 5)) {
+				   (REG_C38_TH + 5)) {
 				if (reg_c38_State) {
 					rtl92e_writeb(dev,
 						rOFDM0_RxDetector3,
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h +1 -1
index 863af8ef9f94..3add5aa933b8 100644
@@ -42,7 +42,7 @@
 #define		CURRENT_TX_RATE_REG		0x1e0
 #define		INITIAL_TX_RATE_REG		0x1e1
 #define		TX_RETRY_COUNT_REG		0x1ac
-#define		RegC38_TH				 20
+#define		REG_C38_TH				 20
 
 /*--------------------------Define Parameters-------------------------------*/
 
Signature · 1 line
2.39.2
#4 lore raw

PATCH v2 4/5 staging: rtl8192e: Remove unused macro dm_tx_bb_gain_idx_to_amplify

In reply to Teddy Engel

Remove unused macro.

---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h +0 -2
index 3add5aa933b8..55641f17412b 100644
@@ -133,8 +133,6 @@ extern	struct dig_t dm_digtable;
 extern const u32 dm_tx_bb_gain[TX_BB_GAIN_TABLE_LEN];
 extern const u8 dm_cck_tx_bb_gain[CCK_TX_BB_GAIN_TABLE_LEN][8];
 extern const u8 dm_cck_tx_bb_gain_ch14[CCK_TX_BB_GAIN_TABLE_LEN][8];
-/* Maps table index to iq amplify gain (dB, 12 to -24dB) */
-#define dm_tx_bb_gain_idx_to_amplify(idx) (-idx + 12)
 
 /*------------------------Export global variable----------------------------*/
 
Signature · 1 line
2.39.2
#5 lore raw

PATCH v2 5/5 staging: rtl8192e: Remove unnecessary pre-declaration of struct net_device

In reply to Teddy Engel

Remove pre-declaration of struct.

---
 drivers/staging/rtl8192e/rtl8192e/rtl_cam.h | 1 -
 drivers/staging/rtl8192e/rtl8192e/rtl_pci.h | 1 -
 2 files changed, 2 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_cam.h +0 -1
index 615b84bca9b8..3a5635494385 100644
@@ -11,7 +11,6 @@
 #define _RTL_CAM_H
 
 #include <linux/types.h>
-struct net_device;
 
 void rtl92e_cam_reset(struct net_device *dev);
 void rtl92e_enable_hw_security_config(struct net_device *dev);
drivers/staging/rtl8192e/rtl8192e/rtl_pci.h +0 -1
index 866e0efbc4fd..c645775b2150 100644
@@ -13,7 +13,6 @@
 #include <linux/types.h>
 #include <linux/pci.h>
 
-struct net_device;
 bool rtl92e_check_adapter(struct pci_dev *pdev, struct net_device *dev);
 
 #endif
Signature · 1 line
2.39.2
Tested-by on the v2 series
#6 lore raw
In reply to Teddy Engel
Quoted 13 lines · Teddy Engel

Remove some unused constants, macros, and structs. Capitalize a constant.

The patch order matters - please apply in order.

Teddy Engel (5):
staging: rtl8192e: Remove unused constants
staging: rtl8192e: Remove unused struct phy_ofdm_rx_status_rxsc
staging: rtl8192e: Capitalize constant RegC38_TH
staging: rtl8192e: Remove unused macro dm_tx_bb_gain_idx_to_amplify
staging: rtl8192e: Remove unnecessary pre-declaration of struct
net_device

Quoted 7 lines
  drivers/staging/rtl8192e/rtl8192e/r8190P_def.h | 9 ---------
  drivers/staging/rtl8192e/rtl8192e/rtl_cam.h    | 1 -
  drivers/staging/rtl8192e/rtl8192e/rtl_dm.c     | 4 ++--
  drivers/staging/rtl8192e/rtl8192e/rtl_dm.h     | 6 +-----
  drivers/staging/rtl8192e/rtl8192e/rtl_pci.h    | 1 -
  5 files changed, 3 insertions(+), 18 deletions(-)