linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] staging: rtl8192e: Removing unused arrays ..RadioC_A.. and ..ERadioD_A..
@ 2023-03-07 21:00 Philipp Hortmann
  2023-03-07 21:01 ` [PATCH v2 1/2] staging: rtl8192e: Remove unused Array Rtl8192PciERadioC_Array Philipp Hortmann
  2023-03-07 21:01 ` [PATCH v2 2/2] staging: rtl8192e: Remove unused Array Rtl8192PciERadioD_Array Philipp Hortmann
  0 siblings, 2 replies; 5+ messages in thread
From: Philipp Hortmann @ 2023-03-07 21:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

The array Rtl8192PciERadioC_Array and ..RadioD.. is only used in function
rtl92e_config_rf_path which is only called in function rtl92e_config_rf.
In function rtl92e_config_rf a termination condition for the loop is set
to priv->num_total_rf_path = RTL819X_TOTAL_RF_PATH = 2. The loop is only
executed with numbers 0 and 1 for eRFPath. So the function 
rtl92e_config_rf_path is only called with eRFPath for 0 and 1 and never
with 2 or 3 that would make the "case RF90_PATH_C:" and 
"case RF90_PATH_D:" be called. Remove resulting dead code.
---
V1->V2: Changed argumentation in the description and subject

Tested with rtl8192e
Transferred this patch over wlan connection of rtl8192e

This patch series requires the patches:
"[PATCH 0/2] staging: rtl8192e: Removing rf_type RF_2T4R from driver"
"[PATCH] staging: rtl8192e: Change filename r8192E_hwimg.x to table.x"
"[PATCH] staging: rtl8192e: Remove call_usermodehelper starting RadioPower.sh"
"[PATCH] staging: rtl8192e: Remove function ..dm_check_ac_dc_power calling a script"

Philipp Hortmann (2):
  staging: rtl8192e: Remove unused Array Rtl8192PciERadioC_Array
  staging: rtl8192e: Remove unused Array Rtl8192PciERadioD_Array

 .../staging/rtl8192e/rtl8192e/r8192E_phy.c    | 24 -------------------
 .../staging/rtl8192e/rtl8192e/r8192E_phy.h    |  4 ----
 drivers/staging/rtl8192e/rtl8192e/table.c     |  6 -----
 drivers/staging/rtl8192e/rtl8192e/table.h     |  4 ----
 4 files changed, 38 deletions(-)

-- 
2.39.2


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

* [PATCH v2 1/2] staging: rtl8192e: Remove unused Array Rtl8192PciERadioC_Array
  2023-03-07 21:00 [PATCH v2 0/2] staging: rtl8192e: Removing unused arrays ..RadioC_A.. and ..ERadioD_A Philipp Hortmann
@ 2023-03-07 21:01 ` Philipp Hortmann
  2023-03-08  7:58   ` Dan Carpenter
  2023-03-07 21:01 ` [PATCH v2 2/2] staging: rtl8192e: Remove unused Array Rtl8192PciERadioD_Array Philipp Hortmann
  1 sibling, 1 reply; 5+ messages in thread
From: Philipp Hortmann @ 2023-03-07 21:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

The array Rtl8192PciERadioC_Array is only used in function
rtl92e_config_rf_path which is only called in function rtl92e_config_rf.
In function rtl92e_config_rf a termination condition for the loop is set
to priv->num_total_rf_path = RTL819X_TOTAL_RF_PATH = 2. The loop is only
executed with numbers 0 and 1 for eRFPath. So the function
rtl92e_config_rf_path is only called with eRFPath for 0 and 1 and never
with 2 that would make the "case RF90_PATH_C:" be called. Remove
resulting dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
V1->V2: Changed argumentation in the description and subject
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 12 ------------
 drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h |  2 --
 drivers/staging/rtl8192e/rtl8192e/table.c      |  3 ---
 drivers/staging/rtl8192e/rtl8192e/table.h      |  2 --
 4 files changed, 19 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index 35ca01ab65ff..fe0ef52c163a 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -649,18 +649,6 @@ u8 rtl92e_config_rf_path(struct net_device *dev, enum rf90_radio_path eRFPath)
 					  bMask12Bits,
 					  Rtl819XRadioB_Array[i+1]);
 
-		}
-		break;
-	case RF90_PATH_C:
-		for (i = 0; i < RadioC_ArrayLength; i += 2) {
-			if (Rtl819XRadioC_Array[i] == 0xfe) {
-				msleep(100);
-				continue;
-			}
-			rtl92e_set_rf_reg(dev, eRFPath, Rtl819XRadioC_Array[i],
-					  bMask12Bits,
-					  Rtl819XRadioC_Array[i+1]);
-
 		}
 		break;
 	case RF90_PATH_D:
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
index 561a4c874fe3..6772ed300591 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
@@ -14,7 +14,6 @@
 #define RadioA_ArrayLength			RadioA_ArrayLengthPciE
 #define RadioB_ArrayLength			RadioB_ArrayLengthPciE
 #define MACPHY_Array_PGLength			MACPHY_Array_PGLengthPciE
-#define RadioC_ArrayLength			RadioC_ArrayLengthPciE
 #define RadioD_ArrayLength			RadioD_ArrayLengthPciE
 #define PHY_REG_1T2RArrayLength			PHY_REG_1T2RArrayLengthPciE
 
@@ -22,7 +21,6 @@
 #define Rtl819XMACPHY_Array			Rtl8192PciEMACPHY_Array
 #define Rtl819XRadioA_Array			Rtl8192PciERadioA_Array
 #define Rtl819XRadioB_Array			Rtl8192PciERadioB_Array
-#define Rtl819XRadioC_Array			Rtl8192PciERadioC_Array
 #define Rtl819XRadioD_Array			Rtl8192PciERadioD_Array
 #define Rtl819XAGCTAB_Array			Rtl8192PciEAGCTAB_Array
 #define Rtl819XPHY_REG_1T2RArray		Rtl8192PciEPHY_REG_1T2RArray
diff --git a/drivers/staging/rtl8192e/rtl8192e/table.c b/drivers/staging/rtl8192e/rtl8192e/table.c
index d04608d99cbf..4e97ad4b8fd7 100644
--- a/drivers/staging/rtl8192e/rtl8192e/table.c
+++ b/drivers/staging/rtl8192e/rtl8192e/table.c
@@ -325,9 +325,6 @@ u32 Rtl8192PciERadioB_Array[RadioB_ArrayLengthPciE] = {
 	0x007, 0x00000700,
 };
 
-u32 Rtl8192PciERadioC_Array[RadioC_ArrayLengthPciE] = {
-	0x0,  };
-
 u32 Rtl8192PciERadioD_Array[RadioD_ArrayLengthPciE] = {
 	0x0, };
 
diff --git a/drivers/staging/rtl8192e/rtl8192e/table.h b/drivers/staging/rtl8192e/rtl8192e/table.h
index 177fe2173430..981e8b57d3de 100644
--- a/drivers/staging/rtl8192e/rtl8192e/table.h
+++ b/drivers/staging/rtl8192e/rtl8192e/table.h
@@ -17,8 +17,6 @@ extern u32 Rtl8192PciEPHY_REG_1T2RArray[PHY_REG_1T2RArrayLengthPciE];
 extern u32 Rtl8192PciERadioA_Array[RadioA_ArrayLengthPciE];
 #define RadioB_ArrayLengthPciE 78
 extern u32 Rtl8192PciERadioB_Array[RadioB_ArrayLengthPciE];
-#define RadioC_ArrayLengthPciE 2
-extern u32 Rtl8192PciERadioC_Array[RadioC_ArrayLengthPciE];
 #define RadioD_ArrayLengthPciE 2
 extern u32 Rtl8192PciERadioD_Array[RadioD_ArrayLengthPciE];
 #define MACPHY_ArrayLengthPciE 18
-- 
2.39.2


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

* [PATCH v2 2/2] staging: rtl8192e: Remove unused Array Rtl8192PciERadioD_Array
  2023-03-07 21:00 [PATCH v2 0/2] staging: rtl8192e: Removing unused arrays ..RadioC_A.. and ..ERadioD_A Philipp Hortmann
  2023-03-07 21:01 ` [PATCH v2 1/2] staging: rtl8192e: Remove unused Array Rtl8192PciERadioC_Array Philipp Hortmann
@ 2023-03-07 21:01 ` Philipp Hortmann
  2023-03-08  7:59   ` Dan Carpenter
  1 sibling, 1 reply; 5+ messages in thread
From: Philipp Hortmann @ 2023-03-07 21:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

The array Rtl8192PciERadioD_Array is only used in function
rtl92e_config_rf_path which is only called in function rtl92e_config_rf.
In function rtl92e_config_rf a termination condition for the loop is set
to priv->num_total_rf_path = RTL819X_TOTAL_RF_PATH = 2. The loop is only
executed with numbers 0 and 1 for eRFPath. So the function
rtl92e_config_rf_path is only called with eRFPath for 0 and 1 and never
with 3 that would make the "case RF90_PATH_D:" be called. Remove
resulting dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
V1->V2: Changed argumentation in the description and subject
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 12 ------------
 drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h |  2 --
 drivers/staging/rtl8192e/rtl8192e/table.c      |  3 ---
 drivers/staging/rtl8192e/rtl8192e/table.h      |  2 --
 4 files changed, 19 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index fe0ef52c163a..a9e83ba811b0 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -649,18 +649,6 @@ u8 rtl92e_config_rf_path(struct net_device *dev, enum rf90_radio_path eRFPath)
 					  bMask12Bits,
 					  Rtl819XRadioB_Array[i+1]);
 
-		}
-		break;
-	case RF90_PATH_D:
-		for (i = 0; i < RadioD_ArrayLength; i += 2) {
-			if (Rtl819XRadioD_Array[i] == 0xfe) {
-				msleep(100);
-				continue;
-			}
-			rtl92e_set_rf_reg(dev, eRFPath, Rtl819XRadioD_Array[i],
-					  bMask12Bits,
-					  Rtl819XRadioD_Array[i+1]);
-
 		}
 		break;
 	default:
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
index 6772ed300591..ac640033e843 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
@@ -14,14 +14,12 @@
 #define RadioA_ArrayLength			RadioA_ArrayLengthPciE
 #define RadioB_ArrayLength			RadioB_ArrayLengthPciE
 #define MACPHY_Array_PGLength			MACPHY_Array_PGLengthPciE
-#define RadioD_ArrayLength			RadioD_ArrayLengthPciE
 #define PHY_REG_1T2RArrayLength			PHY_REG_1T2RArrayLengthPciE
 
 #define Rtl819XMACPHY_Array_PG			Rtl8192PciEMACPHY_Array_PG
 #define Rtl819XMACPHY_Array			Rtl8192PciEMACPHY_Array
 #define Rtl819XRadioA_Array			Rtl8192PciERadioA_Array
 #define Rtl819XRadioB_Array			Rtl8192PciERadioB_Array
-#define Rtl819XRadioD_Array			Rtl8192PciERadioD_Array
 #define Rtl819XAGCTAB_Array			Rtl8192PciEAGCTAB_Array
 #define Rtl819XPHY_REG_1T2RArray		Rtl8192PciEPHY_REG_1T2RArray
 
diff --git a/drivers/staging/rtl8192e/rtl8192e/table.c b/drivers/staging/rtl8192e/rtl8192e/table.c
index 4e97ad4b8fd7..7101061e3519 100644
--- a/drivers/staging/rtl8192e/rtl8192e/table.c
+++ b/drivers/staging/rtl8192e/rtl8192e/table.c
@@ -325,9 +325,6 @@ u32 Rtl8192PciERadioB_Array[RadioB_ArrayLengthPciE] = {
 	0x007, 0x00000700,
 };
 
-u32 Rtl8192PciERadioD_Array[RadioD_ArrayLengthPciE] = {
-	0x0, };
-
 u32 Rtl8192PciEMACPHY_Array[] = {
 	0x03c, 0xffff0000, 0x00000f0f,
 	0x340, 0xffffffff, 0x161a1a1a,
diff --git a/drivers/staging/rtl8192e/rtl8192e/table.h b/drivers/staging/rtl8192e/rtl8192e/table.h
index 981e8b57d3de..b6d4e9696452 100644
--- a/drivers/staging/rtl8192e/rtl8192e/table.h
+++ b/drivers/staging/rtl8192e/rtl8192e/table.h
@@ -17,8 +17,6 @@ extern u32 Rtl8192PciEPHY_REG_1T2RArray[PHY_REG_1T2RArrayLengthPciE];
 extern u32 Rtl8192PciERadioA_Array[RadioA_ArrayLengthPciE];
 #define RadioB_ArrayLengthPciE 78
 extern u32 Rtl8192PciERadioB_Array[RadioB_ArrayLengthPciE];
-#define RadioD_ArrayLengthPciE 2
-extern u32 Rtl8192PciERadioD_Array[RadioD_ArrayLengthPciE];
 #define MACPHY_ArrayLengthPciE 18
 extern u32 Rtl8192PciEMACPHY_Array[MACPHY_ArrayLengthPciE];
 #define MACPHY_Array_PGLengthPciE 30
-- 
2.39.2


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

* Re: [PATCH v2 1/2] staging: rtl8192e: Remove unused Array Rtl8192PciERadioC_Array
  2023-03-07 21:01 ` [PATCH v2 1/2] staging: rtl8192e: Remove unused Array Rtl8192PciERadioC_Array Philipp Hortmann
@ 2023-03-08  7:58   ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2023-03-08  7:58 UTC (permalink / raw)
  To: Philipp Hortmann; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel

On Tue, Mar 07, 2023 at 10:01:06PM +0100, Philipp Hortmann wrote:
> The array Rtl8192PciERadioC_Array is only used in function
> rtl92e_config_rf_path which is only called in function rtl92e_config_rf.
> In function rtl92e_config_rf a termination condition for the loop is set
> to priv->num_total_rf_path = RTL819X_TOTAL_RF_PATH = 2. The loop is only
> executed with numbers 0 and 1 for eRFPath. So the function
> rtl92e_config_rf_path is only called with eRFPath for 0 and 1 and never
> with 2 that would make the "case RF90_PATH_C:" be called. Remove
> resulting dead code.
> 
> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
> ---
> V1->V2: Changed argumentation in the description and subject

Thanks.  This explanation is very good.  I was expecting that the issue
was in a completely different place so this explanation really helps a
lot.

Reviewed-by: Dan Carpenter <error27@gmail.com>

regards,
dan carpenter


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

* Re: [PATCH v2 2/2] staging: rtl8192e: Remove unused Array Rtl8192PciERadioD_Array
  2023-03-07 21:01 ` [PATCH v2 2/2] staging: rtl8192e: Remove unused Array Rtl8192PciERadioD_Array Philipp Hortmann
@ 2023-03-08  7:59   ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2023-03-08  7:59 UTC (permalink / raw)
  To: Philipp Hortmann; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel

On Tue, Mar 07, 2023 at 10:01:25PM +0100, Philipp Hortmann wrote:
> The array Rtl8192PciERadioD_Array is only used in function
> rtl92e_config_rf_path which is only called in function rtl92e_config_rf.
> In function rtl92e_config_rf a termination condition for the loop is set
> to priv->num_total_rf_path = RTL819X_TOTAL_RF_PATH = 2. The loop is only
> executed with numbers 0 and 1 for eRFPath. So the function
> rtl92e_config_rf_path is only called with eRFPath for 0 and 1 and never
> with 3 that would make the "case RF90_PATH_D:" be called. Remove
> resulting dead code.
> 
> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
> ---
> V1->V2: Changed argumentation in the description and subject

Thanks!

Reviewed-by: Dan Carpenter <error27@gmail.com>

regards,
dan carpenter


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

end of thread, other threads:[~2023-03-08  7:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-07 21:00 [PATCH v2 0/2] staging: rtl8192e: Removing unused arrays ..RadioC_A.. and ..ERadioD_A Philipp Hortmann
2023-03-07 21:01 ` [PATCH v2 1/2] staging: rtl8192e: Remove unused Array Rtl8192PciERadioC_Array Philipp Hortmann
2023-03-08  7:58   ` Dan Carpenter
2023-03-07 21:01 ` [PATCH v2 2/2] staging: rtl8192e: Remove unused Array Rtl8192PciERadioD_Array Philipp Hortmann
2023-03-08  7:59   ` Dan Carpenter

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).