linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] staging: r8188eu: remove haldata's EEPROMVID / PID
@ 2021-11-11 21:26 Martin Kaiser
  2021-11-11 21:26 ` [PATCH 2/7] staging: r8188eu: remove haldata's EEPROMCustomerID Martin Kaiser
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Martin Kaiser @ 2021-11-11 21:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

They are used only in a (disabled) debug print.

In practice, lsusb can be used to read the actual vid and pid.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/usb_halinit.c       | 8 --------
 drivers/staging/r8188eu/include/rtl8188e_hal.h  | 2 --
 drivers/staging/r8188eu/include/rtl8188e_spec.h | 2 --
 3 files changed, 12 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index ef1ae95d7db0..563b7c0a2c90 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -985,23 +985,15 @@ static void Hal_EfuseParsePIDVID_8188EU(struct adapter *adapt, u8 *hwinfo, bool
 	struct hal_data_8188e	*haldata = GET_HAL_DATA(adapt);
 
 	if (!AutoLoadFail) {
-		/*  VID, PID */
-		haldata->EEPROMVID = EF2BYTE(*(__le16 *)&hwinfo[EEPROM_VID_88EU]);
-		haldata->EEPROMPID = EF2BYTE(*(__le16 *)&hwinfo[EEPROM_PID_88EU]);
-
 		/*  Customer ID, 0x00 and 0xff are reserved for Realtek. */
 		haldata->EEPROMCustomerID = *(u8 *)&hwinfo[EEPROM_CUSTOMERID_88E];
 		haldata->EEPROMSubCustomerID = EEPROM_Default_SubCustomerID;
 	} else {
-		haldata->EEPROMVID			= EEPROM_Default_VID;
-		haldata->EEPROMPID			= EEPROM_Default_PID;
-
 		/*  Customer ID, 0x00 and 0xff are reserved for Realtek. */
 		haldata->EEPROMCustomerID		= EEPROM_Default_CustomerID;
 		haldata->EEPROMSubCustomerID	= EEPROM_Default_SubCustomerID;
 	}
 
-	DBG_88E("VID = 0x%04X, PID = 0x%04X\n", haldata->EEPROMVID, haldata->EEPROMPID);
 	DBG_88E("Customer ID: 0x%02X, SubCustomer ID: 0x%02X\n", haldata->EEPROMCustomerID, haldata->EEPROMSubCustomerID);
 }
 
diff --git a/drivers/staging/r8188eu/include/rtl8188e_hal.h b/drivers/staging/r8188eu/include/rtl8188e_hal.h
index d7db1dfc39d0..84fa65972039 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_hal.h
@@ -175,8 +175,6 @@ struct hal_data_8188e {
 	u8	BoardType;
 
 	/*  EEPROM setting. */
-	u16	EEPROMVID;
-	u16	EEPROMPID;
 	u16	EEPROMSVID;
 	u16	EEPROMSDID;
 	u8	EEPROMCustomerID;
diff --git a/drivers/staging/r8188eu/include/rtl8188e_spec.h b/drivers/staging/r8188eu/include/rtl8188e_spec.h
index 01aeaa4ac605..cfab7ad08947 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_spec.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_spec.h
@@ -1345,8 +1345,6 @@ Current IOREG MAP
 #define	EEPROM_DEFAULT_BT_OPTION		0x10
 
 /*  For debug */
-#define EEPROM_Default_PID			0x1234
-#define EEPROM_Default_VID			0x5678
 #define EEPROM_Default_CustomerID		0xAB
 #define	EEPROM_Default_CustomerID_8188E		0x00
 #define EEPROM_Default_SubCustomerID		0xCD
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/7] staging: r8188eu: remove haldata's EEPROMCustomerID
  2021-11-11 21:26 [PATCH 1/7] staging: r8188eu: remove haldata's EEPROMVID / PID Martin Kaiser
@ 2021-11-11 21:26 ` Martin Kaiser
  2021-11-11 21:26 ` [PATCH 3/7] staging: r8188eu: remove haldata's EEPROMSubCustomerID Martin Kaiser
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Martin Kaiser @ 2021-11-11 21:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

It is used only in a (disabled) debug print.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 7 +------
 drivers/staging/r8188eu/hal/usb_halinit.c       | 4 +---
 drivers/staging/r8188eu/include/rtl8188e_hal.h  | 1 -
 drivers/staging/r8188eu/include/rtl8188e_spec.h | 2 --
 4 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
index 84f3cfd571c6..9efdc846ba33 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
@@ -1588,13 +1588,8 @@ void Hal_EfuseParseCustomerID88E(struct adapter *padapter, u8 *hwinfo, bool Auto
 {
 	struct hal_data_8188e	*pHalData = GET_HAL_DATA(padapter);
 
-	if (!AutoLoadFail) {
-		pHalData->EEPROMCustomerID = hwinfo[EEPROM_CUSTOMERID_88E];
-	} else {
-		pHalData->EEPROMCustomerID = 0;
+	if (AutoLoadFail)
 		pHalData->EEPROMSubCustomerID = 0;
-	}
-	DBG_88E("EEPROM Customer ID: 0x%2x\n", pHalData->EEPROMCustomerID);
 }
 
 void Hal_ReadAntennaDiversity88E(struct adapter *pAdapter, u8 *PROMContent, bool AutoLoadFail)
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 563b7c0a2c90..caef99d0926f 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -986,15 +986,13 @@ static void Hal_EfuseParsePIDVID_8188EU(struct adapter *adapt, u8 *hwinfo, bool
 
 	if (!AutoLoadFail) {
 		/*  Customer ID, 0x00 and 0xff are reserved for Realtek. */
-		haldata->EEPROMCustomerID = *(u8 *)&hwinfo[EEPROM_CUSTOMERID_88E];
 		haldata->EEPROMSubCustomerID = EEPROM_Default_SubCustomerID;
 	} else {
 		/*  Customer ID, 0x00 and 0xff are reserved for Realtek. */
-		haldata->EEPROMCustomerID		= EEPROM_Default_CustomerID;
 		haldata->EEPROMSubCustomerID	= EEPROM_Default_SubCustomerID;
 	}
 
-	DBG_88E("Customer ID: 0x%02X, SubCustomer ID: 0x%02X\n", haldata->EEPROMCustomerID, haldata->EEPROMSubCustomerID);
+	DBG_88E("SubCustomer ID: 0x%02X\n", haldata->EEPROMSubCustomerID);
 }
 
 static void Hal_EfuseParseMACAddr_8188EU(struct adapter *adapt, u8 *hwinfo, bool AutoLoadFail)
diff --git a/drivers/staging/r8188eu/include/rtl8188e_hal.h b/drivers/staging/r8188eu/include/rtl8188e_hal.h
index 84fa65972039..19aac5c7cffb 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_hal.h
@@ -177,7 +177,6 @@ struct hal_data_8188e {
 	/*  EEPROM setting. */
 	u16	EEPROMSVID;
 	u16	EEPROMSDID;
-	u8	EEPROMCustomerID;
 	u8	EEPROMSubCustomerID;
 	u8	EEPROMVersion;
 	u8	EEPROMRegulatory;
diff --git a/drivers/staging/r8188eu/include/rtl8188e_spec.h b/drivers/staging/r8188eu/include/rtl8188e_spec.h
index cfab7ad08947..8c62e8a2ca40 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_spec.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_spec.h
@@ -1345,8 +1345,6 @@ Current IOREG MAP
 #define	EEPROM_DEFAULT_BT_OPTION		0x10
 
 /*  For debug */
-#define EEPROM_Default_CustomerID		0xAB
-#define	EEPROM_Default_CustomerID_8188E		0x00
 #define EEPROM_Default_SubCustomerID		0xCD
 #define EEPROM_Default_Version			0
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/7] staging: r8188eu: remove haldata's EEPROMSubCustomerID
  2021-11-11 21:26 [PATCH 1/7] staging: r8188eu: remove haldata's EEPROMVID / PID Martin Kaiser
  2021-11-11 21:26 ` [PATCH 2/7] staging: r8188eu: remove haldata's EEPROMCustomerID Martin Kaiser
@ 2021-11-11 21:26 ` Martin Kaiser
  2021-11-11 21:26 ` [PATCH 4/7] staging: r8188eu: remove autoload check Martin Kaiser
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Martin Kaiser @ 2021-11-11 21:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

It is used only in a (disabled) debug print.

We can now remove two functions that parsed eeprom info and populated
haldata components.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/rtl8188e_hal_init.c |  8 --------
 drivers/staging/r8188eu/hal/usb_halinit.c       | 17 -----------------
 drivers/staging/r8188eu/include/rtl8188e_hal.h  |  3 ---
 drivers/staging/r8188eu/include/rtl8188e_spec.h |  1 -
 4 files changed, 29 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
index 9efdc846ba33..566b49fd7478 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
@@ -1584,14 +1584,6 @@ void rtl8188e_EfuseParseChnlPlan(struct adapter *padapter, u8 *hwinfo, bool Auto
 	DBG_88E("mlmepriv.ChannelPlan = 0x%02x\n", padapter->mlmepriv.ChannelPlan);
 }
 
-void Hal_EfuseParseCustomerID88E(struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail)
-{
-	struct hal_data_8188e	*pHalData = GET_HAL_DATA(padapter);
-
-	if (AutoLoadFail)
-		pHalData->EEPROMSubCustomerID = 0;
-}
-
 void Hal_ReadAntennaDiversity88E(struct adapter *pAdapter, u8 *PROMContent, bool AutoLoadFail)
 {
 	struct hal_data_8188e	*pHalData = GET_HAL_DATA(pAdapter);
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index caef99d0926f..1625873aa742 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -980,21 +980,6 @@ static void _ReadLEDSetting(struct adapter *Adapter, u8 *PROMContent, bool Autol
 	haldata->bLedOpenDrain = true;/*  Support Open-drain arrangement for controlling the LED. */
 }
 
-static void Hal_EfuseParsePIDVID_8188EU(struct adapter *adapt, u8 *hwinfo, bool AutoLoadFail)
-{
-	struct hal_data_8188e	*haldata = GET_HAL_DATA(adapt);
-
-	if (!AutoLoadFail) {
-		/*  Customer ID, 0x00 and 0xff are reserved for Realtek. */
-		haldata->EEPROMSubCustomerID = EEPROM_Default_SubCustomerID;
-	} else {
-		/*  Customer ID, 0x00 and 0xff are reserved for Realtek. */
-		haldata->EEPROMSubCustomerID	= EEPROM_Default_SubCustomerID;
-	}
-
-	DBG_88E("SubCustomer ID: 0x%02X\n", haldata->EEPROMSubCustomerID);
-}
-
 static void Hal_EfuseParseMACAddr_8188EU(struct adapter *adapt, u8 *hwinfo, bool AutoLoadFail)
 {
 	u16 i;
@@ -1019,7 +1004,6 @@ readAdapterInfo_8188EU(
 
 	/* parse the eeprom/efuse content */
 	Hal_EfuseParseIDCode88E(adapt, eeprom->efuse_eeprom_data);
-	Hal_EfuseParsePIDVID_8188EU(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
 	Hal_EfuseParseMACAddr_8188EU(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
 
 	Hal_ReadPowerSavingMode88E(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
@@ -1027,7 +1011,6 @@ readAdapterInfo_8188EU(
 	Hal_EfuseParseEEPROMVer88E(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
 	rtl8188e_EfuseParseChnlPlan(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
 	Hal_EfuseParseXtal_8188E(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
-	Hal_EfuseParseCustomerID88E(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
 	Hal_ReadAntennaDiversity88E(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
 	Hal_EfuseParseBoardType88E(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
 	Hal_ReadThermalMeter_88E(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
diff --git a/drivers/staging/r8188eu/include/rtl8188e_hal.h b/drivers/staging/r8188eu/include/rtl8188e_hal.h
index 19aac5c7cffb..3593334e24b6 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_hal.h
@@ -177,7 +177,6 @@ struct hal_data_8188e {
 	/*  EEPROM setting. */
 	u16	EEPROMSVID;
 	u16	EEPROMSDID;
-	u8	EEPROMSubCustomerID;
 	u8	EEPROMVersion;
 	u8	EEPROMRegulatory;
 
@@ -327,8 +326,6 @@ void Hal_EfuseParseEEPROMVer88E(struct adapter *padapter, u8 *hwinfo,
 				bool AutoLoadFail);
 void rtl8188e_EfuseParseChnlPlan(struct adapter *padapter, u8 *hwinfo,
 				 bool AutoLoadFail);
-void Hal_EfuseParseCustomerID88E(struct adapter *padapter, u8 *hwinfo,
-				 bool AutoLoadFail);
 void Hal_ReadAntennaDiversity88E(struct adapter *pAdapter,u8 *PROMContent,
 				 bool AutoLoadFail);
 void Hal_ReadThermalMeter_88E(struct adapter *	dapter, u8 *PROMContent,
diff --git a/drivers/staging/r8188eu/include/rtl8188e_spec.h b/drivers/staging/r8188eu/include/rtl8188e_spec.h
index 8c62e8a2ca40..7dd55212e1be 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_spec.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_spec.h
@@ -1345,7 +1345,6 @@ Current IOREG MAP
 #define	EEPROM_DEFAULT_BT_OPTION		0x10
 
 /*  For debug */
-#define EEPROM_Default_SubCustomerID		0xCD
 #define EEPROM_Default_Version			0
 
 #define EEPROM_CHANNEL_PLAN_FCC			0x0
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/7] staging: r8188eu: remove autoload check
  2021-11-11 21:26 [PATCH 1/7] staging: r8188eu: remove haldata's EEPROMVID / PID Martin Kaiser
  2021-11-11 21:26 ` [PATCH 2/7] staging: r8188eu: remove haldata's EEPROMCustomerID Martin Kaiser
  2021-11-11 21:26 ` [PATCH 3/7] staging: r8188eu: remove haldata's EEPROMSubCustomerID Martin Kaiser
@ 2021-11-11 21:26 ` Martin Kaiser
  2021-11-12  9:08   ` Fabio M. De Francesco
  2021-11-11 21:26 ` [PATCH 5/7] staging: r8188eu: rf_chip is constant Martin Kaiser
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: Martin Kaiser @ 2021-11-11 21:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

In Hal_InitPGData88E, the same code is run, regardless of
bautoload_fail_flag.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
index 566b49fd7478..019e67a7989f 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
@@ -1312,18 +1312,8 @@ s32 InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy)
 void
 Hal_InitPGData88E(struct adapter *padapter)
 {
-	struct eeprom_priv *pEEPROM = &padapter->eeprompriv;
-
-	if (!pEEPROM->bautoload_fail_flag) { /*  autoload OK. */
-		if (!is_boot_from_eeprom(padapter)) {
-			/*  Read EFUSE real map to shadow. */
-			EFUSE_ShadowMapUpdate(padapter, EFUSE_WIFI, false);
-		}
-	} else {/* autoload fail */
-		/* update to default value 0xFF */
-		if (!is_boot_from_eeprom(padapter))
-			EFUSE_ShadowMapUpdate(padapter, EFUSE_WIFI, false);
-	}
+	if (!is_boot_from_eeprom(padapter))
+		EFUSE_ShadowMapUpdate(padapter, EFUSE_WIFI, false);
 }
 
 void
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/7] staging: r8188eu: rf_chip is constant
  2021-11-11 21:26 [PATCH 1/7] staging: r8188eu: remove haldata's EEPROMVID / PID Martin Kaiser
                   ` (2 preceding siblings ...)
  2021-11-11 21:26 ` [PATCH 4/7] staging: r8188eu: remove autoload check Martin Kaiser
@ 2021-11-11 21:26 ` Martin Kaiser
  2021-11-11 21:26 ` [PATCH 6/7] staging: r8188eu: merge three small functions Martin Kaiser
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Martin Kaiser @ 2021-11-11 21:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

For this driver, rf_chip is always RF_6052. Remove the rf_chip component
from struct hal_data_8188e and resulting dead code.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 26 +------------------
 drivers/staging/r8188eu/hal/usb_halinit.c     |  8 ------
 .../staging/r8188eu/include/Hal8188EPhyCfg.h  | 10 -------
 .../staging/r8188eu/include/rtl8188e_hal.h    |  1 -
 4 files changed, 1 insertion(+), 44 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
index bb0cda0c16a0..47402851700b 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
@@ -756,13 +756,6 @@ _PHY_SetBWMode92C(
 	u8 regBwOpMode;
 	u8 regRRSR_RSC;
 
-	if (pHalData->rf_chip == RF_PSEUDO_11N)
-		return;
-
-	/*  There is no 40MHz mode in RF_8225. */
-	if (pHalData->rf_chip == RF_8225)
-		return;
-
 	if (Adapter->bDriverStopped)
 		return;
 
@@ -814,21 +807,7 @@ _PHY_SetBWMode92C(
 	}
 	/* Skip over setting of J-mode in BB register here. Default value is "None J mode". Emily 20070315 */
 
-	/* 3<3>Set RF related register */
-	switch (pHalData->rf_chip) {
-	case RF_8225:
-		break;
-	case RF_8256:
-		/*  Please implement this function in Hal8190PciPhy8256.c */
-		break;
-	case RF_PSEUDO_11N:
-		break;
-	case RF_6052:
-		rtl8188e_PHY_RF6052SetBandwidth(Adapter, pHalData->CurrentChannelBW);
-		break;
-	default:
-		break;
-	}
+	rtl8188e_PHY_RF6052SetBandwidth(Adapter, pHalData->CurrentChannelBW);
 }
 
  /*-----------------------------------------------------------------------------
@@ -885,9 +864,6 @@ void PHY_SwChnl8188E(struct adapter *Adapter, u8 channel)
 	/*  Call after initialization */
 	struct hal_data_8188e	*pHalData = GET_HAL_DATA(Adapter);
 
-	if (pHalData->rf_chip == RF_PSEUDO_11N)
-		return;		/* return immediately if it is peudo-phy */
-
 	if (channel == 0)
 		channel = 1;
 
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 1625873aa742..119523d9c38a 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -1037,16 +1037,8 @@ static void _ReadPROMContent(
 	readAdapterInfo_8188EU(Adapter);
 }
 
-static void _ReadRFType(struct adapter *Adapter)
-{
-	struct hal_data_8188e	*haldata = GET_HAL_DATA(Adapter);
-
-	haldata->rf_chip = RF_6052;
-}
-
 static int _ReadAdapterInfo8188EU(struct adapter *Adapter)
 {
-	_ReadRFType(Adapter);/* rf_chip -> _InitRFType() */
 	_ReadPROMContent(Adapter);
 
 	return _SUCCESS;
diff --git a/drivers/staging/r8188eu/include/Hal8188EPhyCfg.h b/drivers/staging/r8188eu/include/Hal8188EPhyCfg.h
index 6f901ce607e8..b1ba7acb454c 100644
--- a/drivers/staging/r8188eu/include/Hal8188EPhyCfg.h
+++ b/drivers/staging/r8188eu/include/Hal8188EPhyCfg.h
@@ -48,16 +48,6 @@ enum rf_radio_path {
 						 * total three groups */
 #define CHANNEL_GROUP_MAX_88E		6
 
-/* BB/RF related */
-enum RF_TYPE_8190P {
-	RF_TYPE_MIN,		/*  0 */
-	RF_8225 = 1,		/*  1 11b/g RF for verification only */
-	RF_8256 = 2,		/*  2 11b/g/n */
-	RF_6052 = 4,		/*  4 11b/g/n RF */
-	/*  TODO: We should remove this psudo PHY RF after we get new RF. */
-	RF_PSEUDO_11N = 5,	/*  5, It is a temporality RF. */
-};
-
 struct bb_reg_def {
 	u32 rfintfs;		/*  set software control: */
 				/*	0x870~0x877[8 bytes] */
diff --git a/drivers/staging/r8188eu/include/rtl8188e_hal.h b/drivers/staging/r8188eu/include/rtl8188e_hal.h
index 3593334e24b6..6630cb5c5e55 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_hal.h
@@ -169,7 +169,6 @@ struct hal_data_8188e {
 	u16	BasicRateSet;
 
 	/* rf_ctrl */
-	u8	rf_chip;
 	u8	rf_type;
 
 	u8	BoardType;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/7] staging: r8188eu: merge three small functions
  2021-11-11 21:26 [PATCH 1/7] staging: r8188eu: remove haldata's EEPROMVID / PID Martin Kaiser
                   ` (3 preceding siblings ...)
  2021-11-11 21:26 ` [PATCH 5/7] staging: r8188eu: rf_chip is constant Martin Kaiser
@ 2021-11-11 21:26 ` Martin Kaiser
  2021-11-11 21:26 ` [PATCH 7/7] staging: r8188eu: simplify two boolean assignments Martin Kaiser
  2021-11-12  9:00 ` [PATCH 1/7] staging: r8188eu: remove haldata's EEPROMVID / PID Fabio M. De Francesco
  6 siblings, 0 replies; 10+ messages in thread
From: Martin Kaiser @ 2021-11-11 21:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

ReadAdapterInfo8188EU calls _ReadAdapterInfo8188EU.
_ReadAdapterInfo8188EU calls _ReadPROMContent.

Each of these functions is small and has only one caller. Move all
their code into ReadAdapterInfo8188EU.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/usb_halinit.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 119523d9c38a..004622f7a85f 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -1018,13 +1018,14 @@ readAdapterInfo_8188EU(
 	_ReadLEDSetting(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
 }
 
-static void _ReadPROMContent(
-	struct adapter *Adapter
-	)
+void ReadAdapterInfo8188EU(struct adapter *Adapter)
 {
 	struct eeprom_priv *eeprom = &Adapter->eeprompriv;
 	u8 eeValue;
 
+	/*  Read EEPROM size before call any EEPROM function */
+	Adapter->EepromAddressSize = GetEEPROMSize8188E(Adapter);
+
 	/* check system boot selection */
 	eeValue = rtw_read8(Adapter, REG_9346CR);
 	eeprom->EepromOrEfuse		= (eeValue & BOOT_FROM_EEPROM) ? true : false;
@@ -1037,21 +1038,6 @@ static void _ReadPROMContent(
 	readAdapterInfo_8188EU(Adapter);
 }
 
-static int _ReadAdapterInfo8188EU(struct adapter *Adapter)
-{
-	_ReadPROMContent(Adapter);
-
-	return _SUCCESS;
-}
-
-void ReadAdapterInfo8188EU(struct adapter *Adapter)
-{
-	/*  Read EEPROM size before call any EEPROM function */
-	Adapter->EepromAddressSize = GetEEPROMSize8188E(Adapter);
-
-	_ReadAdapterInfo8188EU(Adapter);
-}
-
 static void ResumeTxBeacon(struct adapter *adapt)
 {
 	struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/7] staging: r8188eu: simplify two boolean assignments
  2021-11-11 21:26 [PATCH 1/7] staging: r8188eu: remove haldata's EEPROMVID / PID Martin Kaiser
                   ` (4 preceding siblings ...)
  2021-11-11 21:26 ` [PATCH 6/7] staging: r8188eu: merge three small functions Martin Kaiser
@ 2021-11-11 21:26 ` Martin Kaiser
  2021-11-12  9:00 ` [PATCH 1/7] staging: r8188eu: remove haldata's EEPROMVID / PID Fabio M. De Francesco
  6 siblings, 0 replies; 10+ messages in thread
From: Martin Kaiser @ 2021-11-11 21:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

There's no need to use the ? operator and to set true and
false explicitly.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/usb_halinit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 004622f7a85f..2a1620fe0556 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -1028,8 +1028,8 @@ void ReadAdapterInfo8188EU(struct adapter *Adapter)
 
 	/* check system boot selection */
 	eeValue = rtw_read8(Adapter, REG_9346CR);
-	eeprom->EepromOrEfuse		= (eeValue & BOOT_FROM_EEPROM) ? true : false;
-	eeprom->bautoload_fail_flag	= (eeValue & EEPROM_EN) ? false : true;
+	eeprom->EepromOrEfuse		= (eeValue & BOOT_FROM_EEPROM);
+	eeprom->bautoload_fail_flag	= !(eeValue & EEPROM_EN);
 
 	DBG_88E("Boot from %s, Autoload %s !\n", (eeprom->EepromOrEfuse ? "EEPROM" : "EFUSE"),
 		(eeprom->bautoload_fail_flag ? "Fail" : "OK"));
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/7] staging: r8188eu: remove haldata's EEPROMVID / PID
  2021-11-11 21:26 [PATCH 1/7] staging: r8188eu: remove haldata's EEPROMVID / PID Martin Kaiser
                   ` (5 preceding siblings ...)
  2021-11-11 21:26 ` [PATCH 7/7] staging: r8188eu: simplify two boolean assignments Martin Kaiser
@ 2021-11-12  9:00 ` Fabio M. De Francesco
  2021-11-13 16:21   ` Martin Kaiser
  6 siblings, 1 reply; 10+ messages in thread
From: Fabio M. De Francesco @ 2021-11-12  9:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Martin Kaiser
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

On Thursday, November 11, 2021 10:26:38 PM CET Martin Kaiser wrote:

> They are used only in a (disabled) debug print.
> 
> In practice, lsusb can be used to read the actual vid and pid.

Hi Martin,

You seem to have overlooked the usual rules for writing conformant commit 
messages :)

Please say "what" you did along with "why" you made the changes.

Here, and in two or three other patches of your series, you forgot to 
describe "what" you did. You actually wrote it in the "Subject" lines but, as 
you know for sure, commit messages must be self-contained entities.

Also, it would be nice to have a cover letter and have all seven patches in 
one thread in response to the above, even if it (AFAIK) is not strictly 
required.

Anyway, many thanks for your work.
Regards,

Fabio

> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
>  drivers/staging/r8188eu/hal/usb_halinit.c       | 8 --------
>  drivers/staging/r8188eu/include/rtl8188e_hal.h  | 2 --
>  drivers/staging/r8188eu/include/rtl8188e_spec.h | 2 --
>  3 files changed, 12 deletions(-)




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/7] staging: r8188eu: remove autoload check
  2021-11-11 21:26 ` [PATCH 4/7] staging: r8188eu: remove autoload check Martin Kaiser
@ 2021-11-12  9:08   ` Fabio M. De Francesco
  0 siblings, 0 replies; 10+ messages in thread
From: Fabio M. De Francesco @ 2021-11-12  9:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Martin Kaiser
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

On Thursday, November 11, 2021 10:26:41 PM CET Martin Kaiser wrote:
> In Hal_InitPGData88E, the same code is run, regardless of
> bautoload_fail_flag.

Same comment I made for patch 1/7.

Greetings,

Fabio

> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
>  drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 14 ++------------
>  1 file changed, 2 insertions(+), 12 deletions(-)






^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/7] staging: r8188eu: remove haldata's EEPROMVID / PID
  2021-11-12  9:00 ` [PATCH 1/7] staging: r8188eu: remove haldata's EEPROMVID / PID Fabio M. De Francesco
@ 2021-11-13 16:21   ` Martin Kaiser
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Kaiser @ 2021-11-13 16:21 UTC (permalink / raw)
  To: Fabio M. De Francesco
  Cc: Greg Kroah-Hartman, Larry Finger, Phillip Potter,
	Michael Straube, linux-staging, linux-kernel

Thus wrote Fabio M. De Francesco (fmdefrancesco@gmail.com):

> On Thursday, November 11, 2021 10:26:38 PM CET Martin Kaiser wrote:

> > They are used only in a (disabled) debug print.

> > In practice, lsusb can be used to read the actual vid and pid.

> Hi Martin,

> You seem to have overlooked the usual rules for writing conformant commit 
> messages :)

> Please say "what" you did along with "why" you made the changes.

> Here, and in two or three other patches of your series, you forgot to 
> describe "what" you did. You actually wrote it in the "Subject" lines but, as 
> you know for sure, commit messages must be self-contained entities.

Hi Fabio,

thanks for the reminder. The commit message should indeed make sense
without the title.

> Also, it would be nice to have a cover letter and have all seven patches in 
> one thread in response to the above, even if it (AFAIK) is not strictly 
> required.

There wasn't a common topic in this series so I decided to add no cover
letter.

Best regards,
Martin

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-11-13 16:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 21:26 [PATCH 1/7] staging: r8188eu: remove haldata's EEPROMVID / PID Martin Kaiser
2021-11-11 21:26 ` [PATCH 2/7] staging: r8188eu: remove haldata's EEPROMCustomerID Martin Kaiser
2021-11-11 21:26 ` [PATCH 3/7] staging: r8188eu: remove haldata's EEPROMSubCustomerID Martin Kaiser
2021-11-11 21:26 ` [PATCH 4/7] staging: r8188eu: remove autoload check Martin Kaiser
2021-11-12  9:08   ` Fabio M. De Francesco
2021-11-11 21:26 ` [PATCH 5/7] staging: r8188eu: rf_chip is constant Martin Kaiser
2021-11-11 21:26 ` [PATCH 6/7] staging: r8188eu: merge three small functions Martin Kaiser
2021-11-11 21:26 ` [PATCH 7/7] staging: r8188eu: simplify two boolean assignments Martin Kaiser
2021-11-12  9:00 ` [PATCH 1/7] staging: r8188eu: remove haldata's EEPROMVID / PID Fabio M. De Francesco
2021-11-13 16:21   ` Martin Kaiser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).