[1/2] staging: rtl8192e: Remove empty Array Rtl8192PciEPHY_REGArray

Message ID 511bd239bf033dca3efcc64a640d5343c98fa897.1677955334.git.philipp.g.hortmann@gmail.com
State New
Headers
Series staging: rtl8192e: Removing rf_type RF_2T4R from driver |

Commit Message

Philipp Hortmann March 4, 2023, 7:13 p.m. UTC
  Remove empty array Rtl8192PciEPHY_REGArray and the code where it is used
because it is dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 5 +----
 drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h | 2 --
 drivers/staging/rtl8192e/rtl8192e/table.c      | 2 --
 drivers/staging/rtl8192e/rtl8192e/table.h      | 2 --
 4 files changed, 1 insertion(+), 10 deletions(-)
  

Comments

Dan Carpenter March 6, 2023, 9:25 a.m. UTC | #1
On Sat, Mar 04, 2023 at 08:13:22PM +0100, Philipp Hortmann wrote:
> Remove empty array Rtl8192PciEPHY_REGArray and the code where it is used
> because it is dead code.
> 
> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
> ---
>  drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 5 +----
>  drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h | 2 --
>  drivers/staging/rtl8192e/rtl8192e/table.c      | 2 --
>  drivers/staging/rtl8192e/rtl8192e/table.h      | 2 --

What are these table.[ch] files?  I don't seem to have them.

regards,
dan carpenter
  
Philipp Hortmann March 6, 2023, 8:49 p.m. UTC | #2
On 3/6/23 10:25, Dan Carpenter wrote:
> On Sat, Mar 04, 2023 at 08:13:22PM +0100, Philipp Hortmann wrote:
>> Remove empty array Rtl8192PciEPHY_REGArray and the code where it is used
>> because it is dead code.
>>
>> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
>> ---
>>   drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 5 +----
>>   drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h | 2 --
>>   drivers/staging/rtl8192e/rtl8192e/table.c      | 2 --
>>   drivers/staging/rtl8192e/rtl8192e/table.h      | 2 --
> 
> What are these table.[ch] files?  I don't seem to have them.
> 
> regards,
> dan carpenter
> 


Hi Dan,

thanks for the review. Here some answers to your questions:

With patch: "[PATCH] staging: rtl8192e: Change filename r8192E_hwimg.x 
to table.x" I changed the filename of r8192E_hwimg.c to table.c and 
r8192E_hwimg.h to table.h to adapt filenames from 
drivers/net/wireless/realtek/rtlwifi rtl8192ee and rtl8192se. Task is 
from TODO file.

Thanks for your support.

Bye Philipp
  

Patch

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index 6388f1220575..385ceb3a9636 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -334,10 +334,7 @@  static void _rtl92e_phy_config_bb(struct net_device *dev, u8 ConfigType)
 
 	AGCTAB_ArrayLen = AGCTAB_ArrayLength;
 	Rtl819XAGCTAB_Array_Table = Rtl819XAGCTAB_Array;
-	if (priv->rf_type == RF_2T4R) {
-		PHY_REGArrayLen = PHY_REGArrayLength;
-		Rtl819XPHY_REGArray_Table = Rtl819XPHY_REGArray;
-	} else if (priv->rf_type == RF_1T2R) {
+	if (priv->rf_type == RF_1T2R) {
 		PHY_REGArrayLen = PHY_REG_1T2RArrayLength;
 		Rtl819XPHY_REGArray_Table = Rtl819XPHY_REG_1T2RArray;
 	}
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
index 75629f5df954..561a4c874fe3 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
@@ -16,7 +16,6 @@ 
 #define MACPHY_Array_PGLength			MACPHY_Array_PGLengthPciE
 #define RadioC_ArrayLength			RadioC_ArrayLengthPciE
 #define RadioD_ArrayLength			RadioD_ArrayLengthPciE
-#define PHY_REGArrayLength			PHY_REGArrayLengthPciE
 #define PHY_REG_1T2RArrayLength			PHY_REG_1T2RArrayLengthPciE
 
 #define Rtl819XMACPHY_Array_PG			Rtl8192PciEMACPHY_Array_PG
@@ -26,7 +25,6 @@ 
 #define Rtl819XRadioC_Array			Rtl8192PciERadioC_Array
 #define Rtl819XRadioD_Array			Rtl8192PciERadioD_Array
 #define Rtl819XAGCTAB_Array			Rtl8192PciEAGCTAB_Array
-#define Rtl819XPHY_REGArray			Rtl8192PciEPHY_REGArray
 #define Rtl819XPHY_REG_1T2RArray		Rtl8192PciEPHY_REG_1T2RArray
 
 extern u32 rtl819XAGCTAB_Array[];
diff --git a/drivers/staging/rtl8192e/rtl8192e/table.c b/drivers/staging/rtl8192e/rtl8192e/table.c
index 1f80dbeb17b5..d04608d99cbf 100644
--- a/drivers/staging/rtl8192e/rtl8192e/table.c
+++ b/drivers/staging/rtl8192e/rtl8192e/table.c
@@ -6,8 +6,6 @@ 
  */
 #include "table.h"
 
-u32 Rtl8192PciEPHY_REGArray[PHY_REGArrayLengthPciE] = {0x0,};
-
 u32 Rtl8192PciEPHY_REG_1T2RArray[PHY_REG_1T2RArrayLengthPciE] = {
 	0x800, 0x00000000,
 	0x804, 0x00000001,
diff --git a/drivers/staging/rtl8192e/rtl8192e/table.h b/drivers/staging/rtl8192e/rtl8192e/table.h
index 7d63f5a5c1b7..177fe2173430 100644
--- a/drivers/staging/rtl8192e/rtl8192e/table.h
+++ b/drivers/staging/rtl8192e/rtl8192e/table.h
@@ -11,8 +11,6 @@ 
 
 #include <linux/types.h>
 
-#define PHY_REGArrayLengthPciE 1
-extern u32 Rtl8192PciEPHY_REGArray[PHY_REGArrayLengthPciE];
 #define PHY_REG_1T2RArrayLengthPciE 296
 extern u32 Rtl8192PciEPHY_REG_1T2RArray[PHY_REG_1T2RArrayLengthPciE];
 #define RadioA_ArrayLengthPciE 246