All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] staging: rtl8192e: Trivial code cleanup patches
@ 2023-05-10 15:08 Yogesh Hegde
  2023-05-10 15:09 ` [PATCH 1/4] staging: rtl8192e: Rename tmpRegA and TempCCk Yogesh Hegde
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Yogesh Hegde @ 2023-05-10 15:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

Rename variables in function _rtl92e_dm_tx_power_tracking_cb_thermal
and Refactor variable assignment to avoid checkpatch complains.
The patches are required to be applied in sequence.

Yogesh Hegde (4):
  staging: rtl8192e: Rename tmpRegA and TempCCk
  staging: rtl8192e: Rename tmpOFDMindex and tmpCCKindex
  staging: rtl8192e: Rename tmpCCK20Mindex and tmpCCK40Mindex
  staging: rtl8192e: Refactor tmp_ofdm_index variable assignment

 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 68 +++++++++++-----------
 1 file changed, 34 insertions(+), 34 deletions(-)

-- 
2.34.1


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

* [PATCH 1/4] staging: rtl8192e: Rename tmpRegA and TempCCk
  2023-05-10 15:08 [PATCH 0/4] staging: rtl8192e: Trivial code cleanup patches Yogesh Hegde
@ 2023-05-10 15:09 ` Yogesh Hegde
  2023-05-10 16:56   ` Dan Carpenter
  2023-05-10 15:09 ` [PATCH 2/4] staging: rtl8192e: Rename tmpOFDMindex and tmpCCKindex Yogesh Hegde
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Yogesh Hegde @ 2023-05-10 15:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

Rename variable tmpRegA to tmp_reg, TempCCk to tmp_cck
to avoid CamelCase which is not accepted by checkpatch.

Signed-off-by: Yogesh Hegde <yogi.kernel@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index 56a8ec517c06..af136abc595c 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -657,21 +657,21 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
 {
 #define ThermalMeterVal	9
 	struct r8192_priv *priv = rtllib_priv(dev);
-	u32 tmpRegA, TempCCk;
+	u32 tmp_reg, tmp_cck;
 	u8 tmpOFDMindex, tmpCCKindex, tmpCCK20Mindex, tmpCCK40Mindex, tmpval;
 	int i = 0, CCKSwingNeedUpdate = 0;
 
 	if (!priv->tx_pwr_tracking_init) {
-		tmpRegA = rtl92e_get_bb_reg(dev, rOFDM0_XATxIQImbalance,
+		tmp_reg = rtl92e_get_bb_reg(dev, rOFDM0_XATxIQImbalance,
 					    bMaskDWord);
 		for (i = 0; i < OFDM_TABLE_LEN; i++) {
-			if (tmpRegA == OFDMSwingTable[i])
+			if (tmp_reg == OFDMSwingTable[i])
 				priv->ofdm_index[0] = i;
 		}
 
-		TempCCk = rtl92e_get_bb_reg(dev, rCCK0_TxFilter1, bMaskByte2);
+		tmp_cck = rtl92e_get_bb_reg(dev, rCCK0_TxFilter1, bMaskByte2);
 		for (i = 0; i < CCK_TABLE_LEN; i++) {
-			if (TempCCk == (u32)CCKSwingTable_Ch1_Ch13[i][0]) {
+			if (tmp_cck == (u32)CCKSwingTable_Ch1_Ch13[i][0]) {
 				priv->cck_index = i;
 				break;
 			}
@@ -680,17 +680,17 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
 		return;
 	}
 
-	tmpRegA = rtl92e_get_rf_reg(dev, RF90_PATH_A, 0x12, 0x078);
-	if (tmpRegA < 3 || tmpRegA > 13)
+	tmp_reg = rtl92e_get_rf_reg(dev, RF90_PATH_A, 0x12, 0x078);
+	if (tmp_reg < 3 || tmp_reg > 13)
 		return;
-	if (tmpRegA >= 12)
-		tmpRegA = 12;
+	if (tmp_reg >= 12)
+		tmp_reg = 12;
 	priv->thermal_meter[0] = ThermalMeterVal;
 	priv->thermal_meter[1] = ThermalMeterVal;
 
-	if (priv->thermal_meter[0] >= (u8)tmpRegA) {
+	if (priv->thermal_meter[0] >= (u8)tmp_reg) {
 		tmpOFDMindex = tmpCCK20Mindex = 6+(priv->thermal_meter[0] -
-			      (u8)tmpRegA);
+			      (u8)tmp_reg);
 		tmpCCK40Mindex = tmpCCK20Mindex - 6;
 		if (tmpOFDMindex >= OFDM_TABLE_LEN)
 			tmpOFDMindex = OFDM_TABLE_LEN - 1;
@@ -699,7 +699,7 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
 		if (tmpCCK40Mindex >= CCK_TABLE_LEN)
 			tmpCCK40Mindex = CCK_TABLE_LEN - 1;
 	} else {
-		tmpval = (u8)tmpRegA - priv->thermal_meter[0];
+		tmpval = (u8)tmp_reg - priv->thermal_meter[0];
 		if (tmpval >= 6) {
 			tmpOFDMindex = 0;
 			tmpCCK20Mindex = 0;
-- 
2.34.1


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

* [PATCH 2/4] staging: rtl8192e: Rename tmpOFDMindex and tmpCCKindex
  2023-05-10 15:08 [PATCH 0/4] staging: rtl8192e: Trivial code cleanup patches Yogesh Hegde
  2023-05-10 15:09 ` [PATCH 1/4] staging: rtl8192e: Rename tmpRegA and TempCCk Yogesh Hegde
@ 2023-05-10 15:09 ` Yogesh Hegde
  2023-05-10 15:09 ` [PATCH 3/4] staging: rtl8192e: Rename tmpCCK20Mindex and tmpCCK40Mindex Yogesh Hegde
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Yogesh Hegde @ 2023-05-10 15:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

Rename variable tmpOFDMindex to tmp_ofdm_index and
tmpCCKindex to tmp_cck_index to avoid CamelCase which
is not accepted by checkpatch.

Signed-off-by: Yogesh Hegde <yogi.kernel@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index af136abc595c..117c0538cf5f 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -658,7 +658,7 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
 #define ThermalMeterVal	9
 	struct r8192_priv *priv = rtllib_priv(dev);
 	u32 tmp_reg, tmp_cck;
-	u8 tmpOFDMindex, tmpCCKindex, tmpCCK20Mindex, tmpCCK40Mindex, tmpval;
+	u8 tmp_ofdm_index, tmp_cck_index, tmpCCK20Mindex, tmpCCK40Mindex, tmpval;
 	int i = 0, CCKSwingNeedUpdate = 0;
 
 	if (!priv->tx_pwr_tracking_init) {
@@ -689,11 +689,11 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
 	priv->thermal_meter[1] = ThermalMeterVal;
 
 	if (priv->thermal_meter[0] >= (u8)tmp_reg) {
-		tmpOFDMindex = tmpCCK20Mindex = 6+(priv->thermal_meter[0] -
+		tmp_ofdm_index = tmpCCK20Mindex = 6+(priv->thermal_meter[0] -
 			      (u8)tmp_reg);
 		tmpCCK40Mindex = tmpCCK20Mindex - 6;
-		if (tmpOFDMindex >= OFDM_TABLE_LEN)
-			tmpOFDMindex = OFDM_TABLE_LEN - 1;
+		if (tmp_ofdm_index >= OFDM_TABLE_LEN)
+			tmp_ofdm_index = OFDM_TABLE_LEN - 1;
 		if (tmpCCK20Mindex >= CCK_TABLE_LEN)
 			tmpCCK20Mindex = CCK_TABLE_LEN - 1;
 		if (tmpCCK40Mindex >= CCK_TABLE_LEN)
@@ -701,18 +701,18 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
 	} else {
 		tmpval = (u8)tmp_reg - priv->thermal_meter[0];
 		if (tmpval >= 6) {
-			tmpOFDMindex = 0;
+			tmp_ofdm_index = 0;
 			tmpCCK20Mindex = 0;
 		} else {
-			tmpOFDMindex = 6 - tmpval;
+			tmp_ofdm_index = 6 - tmpval;
 			tmpCCK20Mindex = 6 - tmpval;
 		}
 		tmpCCK40Mindex = 0;
 	}
 	if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20)
-		tmpCCKindex = tmpCCK40Mindex;
+		tmp_cck_index = tmpCCK40Mindex;
 	else
-		tmpCCKindex = tmpCCK20Mindex;
+		tmp_cck_index = tmpCCK20Mindex;
 
 	priv->rec_cck_20m_idx = tmpCCK20Mindex;
 	priv->rec_cck_40m_idx = tmpCCK40Mindex;
@@ -727,15 +727,15 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
 		CCKSwingNeedUpdate = 1;
 	}
 
-	if (priv->cck_index != tmpCCKindex) {
-		priv->cck_index = tmpCCKindex;
+	if (priv->cck_index != tmp_cck_index) {
+		priv->cck_index = tmp_cck_index;
 		CCKSwingNeedUpdate = 1;
 	}
 
 	if (CCKSwingNeedUpdate)
 		rtl92e_dm_cck_txpower_adjust(dev, priv->bcck_in_ch14);
-	if (priv->ofdm_index[0] != tmpOFDMindex) {
-		priv->ofdm_index[0] = tmpOFDMindex;
+	if (priv->ofdm_index[0] != tmp_ofdm_index) {
+		priv->ofdm_index[0] = tmp_ofdm_index;
 		rtl92e_set_bb_reg(dev, rOFDM0_XATxIQImbalance, bMaskDWord,
 				  OFDMSwingTable[priv->ofdm_index[0]]);
 	}
-- 
2.34.1


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

* [PATCH 3/4] staging: rtl8192e: Rename tmpCCK20Mindex and tmpCCK40Mindex
  2023-05-10 15:08 [PATCH 0/4] staging: rtl8192e: Trivial code cleanup patches Yogesh Hegde
  2023-05-10 15:09 ` [PATCH 1/4] staging: rtl8192e: Rename tmpRegA and TempCCk Yogesh Hegde
  2023-05-10 15:09 ` [PATCH 2/4] staging: rtl8192e: Rename tmpOFDMindex and tmpCCKindex Yogesh Hegde
@ 2023-05-10 15:09 ` Yogesh Hegde
  2023-05-10 15:10 ` [PATCH 4/4] staging: rtl8192e: Refactor tmp_ofdm_index variable assignment Yogesh Hegde
  2023-05-11 20:55 ` [PATCH 0/4] staging: rtl8192e: Trivial code cleanup patches Philipp Hortmann
  4 siblings, 0 replies; 10+ messages in thread
From: Yogesh Hegde @ 2023-05-10 15:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

Rename variable tmpCCK20Mindex to tmp_cck_20m_index and
tmpCCK40Mindex to tmp_cck_40m_index to avoid CamelCase which
is not accepted by checkpatch.

Signed-off-by: Yogesh Hegde <yogi.kernel@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 28 +++++++++++-----------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index 117c0538cf5f..a44be3f810ab 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -658,7 +658,7 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
 #define ThermalMeterVal	9
 	struct r8192_priv *priv = rtllib_priv(dev);
 	u32 tmp_reg, tmp_cck;
-	u8 tmp_ofdm_index, tmp_cck_index, tmpCCK20Mindex, tmpCCK40Mindex, tmpval;
+	u8 tmp_ofdm_index, tmp_cck_index, tmp_cck_20m_index, tmp_cck_40m_index, tmpval;
 	int i = 0, CCKSwingNeedUpdate = 0;
 
 	if (!priv->tx_pwr_tracking_init) {
@@ -689,33 +689,33 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
 	priv->thermal_meter[1] = ThermalMeterVal;
 
 	if (priv->thermal_meter[0] >= (u8)tmp_reg) {
-		tmp_ofdm_index = tmpCCK20Mindex = 6+(priv->thermal_meter[0] -
+		tmp_ofdm_index = tmp_cck_20m_index = 6+(priv->thermal_meter[0] -
 			      (u8)tmp_reg);
-		tmpCCK40Mindex = tmpCCK20Mindex - 6;
+		tmp_cck_40m_index = tmp_cck_20m_index - 6;
 		if (tmp_ofdm_index >= OFDM_TABLE_LEN)
 			tmp_ofdm_index = OFDM_TABLE_LEN - 1;
-		if (tmpCCK20Mindex >= CCK_TABLE_LEN)
-			tmpCCK20Mindex = CCK_TABLE_LEN - 1;
-		if (tmpCCK40Mindex >= CCK_TABLE_LEN)
-			tmpCCK40Mindex = CCK_TABLE_LEN - 1;
+		if (tmp_cck_20m_index >= CCK_TABLE_LEN)
+			tmp_cck_20m_index = CCK_TABLE_LEN - 1;
+		if (tmp_cck_40m_index >= CCK_TABLE_LEN)
+			tmp_cck_40m_index = CCK_TABLE_LEN - 1;
 	} else {
 		tmpval = (u8)tmp_reg - priv->thermal_meter[0];
 		if (tmpval >= 6) {
 			tmp_ofdm_index = 0;
-			tmpCCK20Mindex = 0;
+			tmp_cck_20m_index = 0;
 		} else {
 			tmp_ofdm_index = 6 - tmpval;
-			tmpCCK20Mindex = 6 - tmpval;
+			tmp_cck_20m_index = 6 - tmpval;
 		}
-		tmpCCK40Mindex = 0;
+		tmp_cck_40m_index = 0;
 	}
 	if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20)
-		tmp_cck_index = tmpCCK40Mindex;
+		tmp_cck_index = tmp_cck_40m_index;
 	else
-		tmp_cck_index = tmpCCK20Mindex;
+		tmp_cck_index = tmp_cck_20m_index;
 
-	priv->rec_cck_20m_idx = tmpCCK20Mindex;
-	priv->rec_cck_40m_idx = tmpCCK40Mindex;
+	priv->rec_cck_20m_idx = tmp_cck_20m_index;
+	priv->rec_cck_40m_idx = tmp_cck_40m_index;
 
 	if (priv->rtllib->current_network.channel == 14 &&
 	    !priv->bcck_in_ch14) {
-- 
2.34.1


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

* [PATCH 4/4] staging: rtl8192e: Refactor tmp_ofdm_index variable assignment
  2023-05-10 15:08 [PATCH 0/4] staging: rtl8192e: Trivial code cleanup patches Yogesh Hegde
                   ` (2 preceding siblings ...)
  2023-05-10 15:09 ` [PATCH 3/4] staging: rtl8192e: Rename tmpCCK20Mindex and tmpCCK40Mindex Yogesh Hegde
@ 2023-05-10 15:10 ` Yogesh Hegde
  2023-05-11 20:55 ` [PATCH 0/4] staging: rtl8192e: Trivial code cleanup patches Philipp Hortmann
  4 siblings, 0 replies; 10+ messages in thread
From: Yogesh Hegde @ 2023-05-10 15:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

Refactor tmp_ofdm_index variable assignment to avoid multiple
assignments which is not accepted by checkpatch.

Signed-off-by: Yogesh Hegde <yogi.kernel@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index a44be3f810ab..feac50cd8fa0 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -689,8 +689,8 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
 	priv->thermal_meter[1] = ThermalMeterVal;
 
 	if (priv->thermal_meter[0] >= (u8)tmp_reg) {
-		tmp_ofdm_index = tmp_cck_20m_index = 6+(priv->thermal_meter[0] -
-			      (u8)tmp_reg);
+		tmp_ofdm_index = 6 + (priv->thermal_meter[0] - (u8)tmp_reg);
+		tmp_cck_20m_index = tmp_ofdm_index;
 		tmp_cck_40m_index = tmp_cck_20m_index - 6;
 		if (tmp_ofdm_index >= OFDM_TABLE_LEN)
 			tmp_ofdm_index = OFDM_TABLE_LEN - 1;
-- 
2.34.1


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

* Re: [PATCH 1/4] staging: rtl8192e: Rename tmpRegA and TempCCk
  2023-05-10 15:09 ` [PATCH 1/4] staging: rtl8192e: Rename tmpRegA and TempCCk Yogesh Hegde
@ 2023-05-10 16:56   ` Dan Carpenter
  2023-05-11 14:18     ` Yogesh Hegde
  0 siblings, 1 reply; 10+ messages in thread
From: Dan Carpenter @ 2023-05-10 16:56 UTC (permalink / raw)
  To: Yogesh Hegde; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel

On Wed, May 10, 2023 at 08:39:07PM +0530, Yogesh Hegde wrote:
> @@ -680,17 +680,17 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
>  		return;
>  	}
>  
> -	tmpRegA = rtl92e_get_rf_reg(dev, RF90_PATH_A, 0x12, 0x078);
> -	if (tmpRegA < 3 || tmpRegA > 13)
> +	tmp_reg = rtl92e_get_rf_reg(dev, RF90_PATH_A, 0x12, 0x078);
> +	if (tmp_reg < 3 || tmp_reg > 13)
>  		return;
> -	if (tmpRegA >= 12)
> -		tmpRegA = 12;
> +	if (tmp_reg >= 12)
> +		tmp_reg = 12;

Not related to your patch (which is fine) but this if statement can be
deleted.

>  	priv->thermal_meter[0] = ThermalMeterVal;
>  	priv->thermal_meter[1] = ThermalMeterVal;
>  
> -	if (priv->thermal_meter[0] >= (u8)tmpRegA) {
> +	if (priv->thermal_meter[0] >= (u8)tmp_reg) {

And casting tmp_reg to u8 is nonsense so that casting can be deleted too.
2 separate patches:
patch 1: delete unecessary if statement
patch 2: delete unecessary casting

regards,
dan carpenter


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

* Re: [PATCH 1/4] staging: rtl8192e: Rename tmpRegA and TempCCk
  2023-05-10 16:56   ` Dan Carpenter
@ 2023-05-11 14:18     ` Yogesh Hegde
  2023-05-11 14:21       ` Dan Carpenter
  0 siblings, 1 reply; 10+ messages in thread
From: Yogesh Hegde @ 2023-05-11 14:18 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel

On Wed, May 10, 2023 at 07:56:29PM +0300, Dan Carpenter wrote:
> On Wed, May 10, 2023 at 08:39:07PM +0530, Yogesh Hegde wrote:
> > @@ -680,17 +680,17 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
> >  		return;
> >  	}
> >  
> > -	tmpRegA = rtl92e_get_rf_reg(dev, RF90_PATH_A, 0x12, 0x078);
> > -	if (tmpRegA < 3 || tmpRegA > 13)
> > +	tmp_reg = rtl92e_get_rf_reg(dev, RF90_PATH_A, 0x12, 0x078);
> > +	if (tmp_reg < 3 || tmp_reg > 13)
> >  		return;
> > -	if (tmpRegA >= 12)
> > -		tmpRegA = 12;
> > +	if (tmp_reg >= 12)
> > +		tmp_reg = 12;
> 
> Not related to your patch (which is fine) but this if statement can be
> deleted.
> 
> >  	priv->thermal_meter[0] = ThermalMeterVal;
> >  	priv->thermal_meter[1] = ThermalMeterVal;
> >  
> > -	if (priv->thermal_meter[0] >= (u8)tmpRegA) {
> > +	if (priv->thermal_meter[0] >= (u8)tmp_reg) {
> 
> And casting tmp_reg to u8 is nonsense so that casting can be deleted too.
> 2 separate patches:
> patch 1: delete unecessary if statement
> patch 2: delete unecessary casting

Thank you for taking the time to review my patch and provide your
feedback. Your suggestions are duly noted, and I appreciate your 
guidance.

I will make them into separate patches and submit it. 

Thank you for your time and valuable input.

Regards 
Yogesh

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

* Re: [PATCH 1/4] staging: rtl8192e: Rename tmpRegA and TempCCk
  2023-05-11 14:18     ` Yogesh Hegde
@ 2023-05-11 14:21       ` Dan Carpenter
  2023-05-11 16:44         ` Yogesh Hegde
  0 siblings, 1 reply; 10+ messages in thread
From: Dan Carpenter @ 2023-05-11 14:21 UTC (permalink / raw)
  To: Yogesh Hegde; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel

On Thu, May 11, 2023 at 07:48:23PM +0530, Yogesh Hegde wrote:
> On Wed, May 10, 2023 at 07:56:29PM +0300, Dan Carpenter wrote:
> > On Wed, May 10, 2023 at 08:39:07PM +0530, Yogesh Hegde wrote:
> > > @@ -680,17 +680,17 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
> > >  		return;
> > >  	}
> > >  
> > > -	tmpRegA = rtl92e_get_rf_reg(dev, RF90_PATH_A, 0x12, 0x078);
> > > -	if (tmpRegA < 3 || tmpRegA > 13)
> > > +	tmp_reg = rtl92e_get_rf_reg(dev, RF90_PATH_A, 0x12, 0x078);
> > > +	if (tmp_reg < 3 || tmp_reg > 13)
> > >  		return;
> > > -	if (tmpRegA >= 12)
> > > -		tmpRegA = 12;
> > > +	if (tmp_reg >= 12)
> > > +		tmp_reg = 12;
> > 
> > Not related to your patch (which is fine) but this if statement can be
> > deleted.
> > 
> > >  	priv->thermal_meter[0] = ThermalMeterVal;
> > >  	priv->thermal_meter[1] = ThermalMeterVal;
> > >  
> > > -	if (priv->thermal_meter[0] >= (u8)tmpRegA) {
> > > +	if (priv->thermal_meter[0] >= (u8)tmp_reg) {
> > 
> > And casting tmp_reg to u8 is nonsense so that casting can be deleted too.
> > 2 separate patches:
> > patch 1: delete unecessary if statement
> > patch 2: delete unecessary casting
> 
> Thank you for taking the time to review my patch and provide your
> feedback. Your suggestions are duly noted, and I appreciate your 
> guidance.
> 
> I will make them into separate patches and submit it. 

You don't have to if you don't want to.  We can apply the patches you
sent as-is.  (No need to resend).  This was just in case anyone felt
motivated to do some more clean up work.

regards,
dan carpenter


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

* Re: [PATCH 1/4] staging: rtl8192e: Rename tmpRegA and TempCCk
  2023-05-11 14:21       ` Dan Carpenter
@ 2023-05-11 16:44         ` Yogesh Hegde
  0 siblings, 0 replies; 10+ messages in thread
From: Yogesh Hegde @ 2023-05-11 16:44 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel

On Thu, May 11, 2023 at 05:21:07PM +0300, Dan Carpenter wrote:
> On Thu, May 11, 2023 at 07:48:23PM +0530, Yogesh Hegde wrote:
> > 
> > Thank you for taking the time to review my patch and provide your
> > feedback. Your suggestions are duly noted, and I appreciate your 
> > guidance.
> > 
> > I will make them into separate patches and submit it. 
> 
> You don't have to if you don't want to.  We can apply the patches you
> sent as-is.  (No need to resend).  This was just in case anyone felt
> motivated to do some more clean up work.
Ok noted. Since the patches can be applied without further changes,
I won't resend the current patchset. But I am eager to do more
clean up work, so I will definitely take your suggestions into
account and incorporate them in my future patches.

Thank you for your feedback and support.

Regards
Yogesh

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

* Re: [PATCH 0/4] staging: rtl8192e: Trivial code cleanup patches
  2023-05-10 15:08 [PATCH 0/4] staging: rtl8192e: Trivial code cleanup patches Yogesh Hegde
                   ` (3 preceding siblings ...)
  2023-05-10 15:10 ` [PATCH 4/4] staging: rtl8192e: Refactor tmp_ofdm_index variable assignment Yogesh Hegde
@ 2023-05-11 20:55 ` Philipp Hortmann
  4 siblings, 0 replies; 10+ messages in thread
From: Philipp Hortmann @ 2023-05-11 20:55 UTC (permalink / raw)
  To: Yogesh Hegde, Greg Kroah-Hartman, linux-staging, linux-kernel

On 5/10/23 17:08, Yogesh Hegde wrote:
> Rename variables in function _rtl92e_dm_tx_power_tracking_cb_thermal
> and Refactor variable assignment to avoid checkpatch complains.
> The patches are required to be applied in sequence.
> 
> Yogesh Hegde (4):
>    staging: rtl8192e: Rename tmpRegA and TempCCk
>    staging: rtl8192e: Rename tmpOFDMindex and tmpCCKindex
>    staging: rtl8192e: Rename tmpCCK20Mindex and tmpCCK40Mindex
>    staging: rtl8192e: Refactor tmp_ofdm_index variable assignment
> 
>   drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 68 +++++++++++-----------
>   1 file changed, 34 insertions(+), 34 deletions(-)
>


Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>

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

end of thread, other threads:[~2023-05-11 20:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-10 15:08 [PATCH 0/4] staging: rtl8192e: Trivial code cleanup patches Yogesh Hegde
2023-05-10 15:09 ` [PATCH 1/4] staging: rtl8192e: Rename tmpRegA and TempCCk Yogesh Hegde
2023-05-10 16:56   ` Dan Carpenter
2023-05-11 14:18     ` Yogesh Hegde
2023-05-11 14:21       ` Dan Carpenter
2023-05-11 16:44         ` Yogesh Hegde
2023-05-10 15:09 ` [PATCH 2/4] staging: rtl8192e: Rename tmpOFDMindex and tmpCCKindex Yogesh Hegde
2023-05-10 15:09 ` [PATCH 3/4] staging: rtl8192e: Rename tmpCCK20Mindex and tmpCCK40Mindex Yogesh Hegde
2023-05-10 15:10 ` [PATCH 4/4] staging: rtl8192e: Refactor tmp_ofdm_index variable assignment Yogesh Hegde
2023-05-11 20:55 ` [PATCH 0/4] staging: rtl8192e: Trivial code cleanup patches Philipp Hortmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.