linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] staging: rtl8723bs: struct iqk_matrix_regs_setting cleanup
@ 2022-11-04 18:34 Deepak R Varma
  2022-11-04 18:34 ` [PATCH 1/2] staging: rtl8723bs: Simplify underutilized 2D array to 1D array Deepak R Varma
  2022-11-04 18:35 ` [PATCH 2/2] staging: rtl8723bs: Remove unused member variable Deepak R Varma
  0 siblings, 2 replies; 8+ messages in thread
From: Deepak R Varma @ 2022-11-04 18:34 UTC (permalink / raw)
  To: outreachy, Greg Kroah-Hartman, linux-staging, linux-kernel

The patch set proposes code cleanup and simplification changes for struct
iqk_matrix_regs_setting member variables. Resultant code is simpler and easier
to maintain.


Deepak R Varma (2):
  staging: rtl8723bs: Simplify underutilized 2D array to 1D array
  staging: rtl8723bs: Remove unused member variable

 drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 18 +++++++++---------
 drivers/staging/rtl8723bs/hal/odm.h            |  3 +--
 2 files changed, 10 insertions(+), 11 deletions(-)

--
2.34.1




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

* [PATCH 1/2] staging: rtl8723bs: Simplify underutilized 2D array to 1D array
  2022-11-04 18:34 [PATCH 0/2] staging: rtl8723bs: struct iqk_matrix_regs_setting cleanup Deepak R Varma
@ 2022-11-04 18:34 ` Deepak R Varma
  2022-11-05  8:36   ` Greg Kroah-Hartman
  2022-11-04 18:35 ` [PATCH 2/2] staging: rtl8723bs: Remove unused member variable Deepak R Varma
  1 sibling, 1 reply; 8+ messages in thread
From: Deepak R Varma @ 2022-11-04 18:34 UTC (permalink / raw)
  To: outreachy, Greg Kroah-Hartman, linux-staging, linux-kernel

Member variable "Value" of structure iqk_matrix_regs_setting is
declared to be a 2D array of [3][IQK_Matrix_REG_NUM] grid. However
the primary index of this array is only used for index 0, the other
two elements are never used. Simplify this array to a one dimension
degree. The resultant code is simpler and is easy to maintain.

Suggested-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Deepak R Varma <drv@mailo.com>
---
 drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 18 +++++++++---------
 drivers/staging/rtl8723bs/hal/odm.h            |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
index a52748f7b56e..9317a4462c02 100644
--- a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
+++ b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
@@ -244,8 +244,8 @@ void ODM_TxPwrTrackSetPwr_8723B(
 			Final_CCK_Swing_Index = 0;

 		setIqkMatrix_8723B(pDM_Odm, Final_OFDM_Swing_Index, RFPath,
-			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0],
-			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]);
+			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0],
+			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[1]);

 		setCCKFilterCoefficient(pDM_Odm, Final_CCK_Swing_Index);

@@ -257,8 +257,8 @@ void ODM_TxPwrTrackSetPwr_8723B(
 			pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index - PwrTrackingLimit_OFDM;

 			setIqkMatrix_8723B(pDM_Odm, PwrTrackingLimit_OFDM, RFPath,
-				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0],
-				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]);
+				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0],
+				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[1]);

 			pDM_Odm->Modify_TxAGC_Flag_PathA = true;
 			PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM);
@@ -267,16 +267,16 @@ void ODM_TxPwrTrackSetPwr_8723B(
 			pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index;

 			setIqkMatrix_8723B(pDM_Odm, 0, RFPath,
-				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0],
-				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]);
+				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0],
+				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[1]);

 			pDM_Odm->Modify_TxAGC_Flag_PathA = true;
 			PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM);
 			PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, HT_MCS0_MCS7);
 		} else {
 			setIqkMatrix_8723B(pDM_Odm, Final_OFDM_Swing_Index, RFPath,
-				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0],
-				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]);
+				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0],
+				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[1]);

 			if (pDM_Odm->Modify_TxAGC_Flag_PathA) { /* If TxAGC has changed, reset TxAGC again */
 				pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = 0;
@@ -1760,7 +1760,7 @@ void PHY_IQCalibrate_8723B(
 /* by sherry 20120321 */
 	if (final_candidate < 4) {
 		for (i = 0; i < IQK_Matrix_REG_NUM; i++)
-			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].Value[0][i] = result[final_candidate][i];
+			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].Value[i] = result[final_candidate][i];
 		pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].bIQKDone = true;
 	}

diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h
index fe9782d2d4fd..e16a769850c5 100644
--- a/drivers/staging/rtl8723bs/hal/odm.h
+++ b/drivers/staging/rtl8723bs/hal/odm.h
@@ -481,7 +481,7 @@ enum odm_type_alna_e { /* tag_ODM_TYPE_ALNA_Definition */

 struct iqk_matrix_regs_setting { /* _IQK_MATRIX_REGS_SETTING */
 	bool bIQKDone;
-	s32 Value[3][IQK_Matrix_REG_NUM];
+	s32 Value[IQK_Matrix_REG_NUM];
 	bool bBWIqkResultSaved[3];
 };

--
2.34.1




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

* [PATCH 2/2] staging: rtl8723bs: Remove unused member variable
  2022-11-04 18:34 [PATCH 0/2] staging: rtl8723bs: struct iqk_matrix_regs_setting cleanup Deepak R Varma
  2022-11-04 18:34 ` [PATCH 1/2] staging: rtl8723bs: Simplify underutilized 2D array to 1D array Deepak R Varma
@ 2022-11-04 18:35 ` Deepak R Varma
  1 sibling, 0 replies; 8+ messages in thread
From: Deepak R Varma @ 2022-11-04 18:35 UTC (permalink / raw)
  To: outreachy, Greg Kroah-Hartman, linux-staging, linux-kernel

Member variable bBWIqkResultSaved of struct iqk_matrix_regs_setting is
declared but never used. Remove it.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---
 drivers/staging/rtl8723bs/hal/odm.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h
index e16a769850c5..6891fa30c7f4 100644
--- a/drivers/staging/rtl8723bs/hal/odm.h
+++ b/drivers/staging/rtl8723bs/hal/odm.h
@@ -482,7 +482,6 @@ enum odm_type_alna_e { /* tag_ODM_TYPE_ALNA_Definition */
 struct iqk_matrix_regs_setting { /* _IQK_MATRIX_REGS_SETTING */
 	bool bIQKDone;
 	s32 Value[IQK_Matrix_REG_NUM];
-	bool bBWIqkResultSaved[3];
 };

 /* Remove PATHDIV_PARA struct to odm_PathDiv.h */
--
2.34.1




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

* Re: [PATCH 1/2] staging: rtl8723bs: Simplify underutilized 2D array to 1D array
  2022-11-04 18:34 ` [PATCH 1/2] staging: rtl8723bs: Simplify underutilized 2D array to 1D array Deepak R Varma
@ 2022-11-05  8:36   ` Greg Kroah-Hartman
  2022-11-05  8:44     ` Deepak R Varma
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-05  8:36 UTC (permalink / raw)
  To: Deepak R Varma; +Cc: outreachy, linux-staging, linux-kernel

On Sat, Nov 05, 2022 at 12:04:56AM +0530, Deepak R Varma wrote:
> Member variable "Value" of structure iqk_matrix_regs_setting is
> declared to be a 2D array of [3][IQK_Matrix_REG_NUM] grid. However
> the primary index of this array is only used for index 0, the other
> two elements are never used. Simplify this array to a one dimension
> degree. The resultant code is simpler and is easy to maintain.
> 
> Suggested-by: Dan Carpenter <error27@gmail.com>
> Signed-off-by: Deepak R Varma <drv@mailo.com>
> ---
>  drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 18 +++++++++---------
>  drivers/staging/rtl8723bs/hal/odm.h            |  2 +-
>  2 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
> index a52748f7b56e..9317a4462c02 100644
> --- a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
> +++ b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
> @@ -244,8 +244,8 @@ void ODM_TxPwrTrackSetPwr_8723B(
>  			Final_CCK_Swing_Index = 0;
> 
>  		setIqkMatrix_8723B(pDM_Odm, Final_OFDM_Swing_Index, RFPath,
> -			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0],
> -			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]);
> +			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0],
> +			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[1]);
> 
>  		setCCKFilterCoefficient(pDM_Odm, Final_CCK_Swing_Index);
> 
> @@ -257,8 +257,8 @@ void ODM_TxPwrTrackSetPwr_8723B(
>  			pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index - PwrTrackingLimit_OFDM;
> 
>  			setIqkMatrix_8723B(pDM_Odm, PwrTrackingLimit_OFDM, RFPath,
> -				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0],
> -				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]);
> +				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0],
> +				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[1]);
> 
>  			pDM_Odm->Modify_TxAGC_Flag_PathA = true;
>  			PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM);
> @@ -267,16 +267,16 @@ void ODM_TxPwrTrackSetPwr_8723B(
>  			pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index;
> 
>  			setIqkMatrix_8723B(pDM_Odm, 0, RFPath,
> -				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0],
> -				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]);
> +				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0],
> +				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[1]);
> 
>  			pDM_Odm->Modify_TxAGC_Flag_PathA = true;
>  			PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM);
>  			PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, HT_MCS0_MCS7);
>  		} else {
>  			setIqkMatrix_8723B(pDM_Odm, Final_OFDM_Swing_Index, RFPath,
> -				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0],
> -				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]);
> +				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0],
> +				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[1]);
> 
>  			if (pDM_Odm->Modify_TxAGC_Flag_PathA) { /* If TxAGC has changed, reset TxAGC again */
>  				pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = 0;
> @@ -1760,7 +1760,7 @@ void PHY_IQCalibrate_8723B(
>  /* by sherry 20120321 */
>  	if (final_candidate < 4) {
>  		for (i = 0; i < IQK_Matrix_REG_NUM; i++)
> -			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].Value[0][i] = result[final_candidate][i];
> +			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].Value[i] = result[final_candidate][i];
>  		pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].bIQKDone = true;
>  	}
> 
> diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h
> index fe9782d2d4fd..e16a769850c5 100644
> --- a/drivers/staging/rtl8723bs/hal/odm.h
> +++ b/drivers/staging/rtl8723bs/hal/odm.h
> @@ -481,7 +481,7 @@ enum odm_type_alna_e { /* tag_ODM_TYPE_ALNA_Definition */
> 
>  struct iqk_matrix_regs_setting { /* _IQK_MATRIX_REGS_SETTING */
>  	bool bIQKDone;
> -	s32 Value[3][IQK_Matrix_REG_NUM];
> +	s32 Value[IQK_Matrix_REG_NUM];

This field is used to store values (as your above patch shows), but
where is it actually used?  Are you sure it is needed at all?

thanks,

greg k-h

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

* Re: [PATCH 1/2] staging: rtl8723bs: Simplify underutilized 2D array to 1D array
  2022-11-05  8:36   ` Greg Kroah-Hartman
@ 2022-11-05  8:44     ` Deepak R Varma
  2022-11-05  9:17       ` Deepak R Varma
  0 siblings, 1 reply; 8+ messages in thread
From: Deepak R Varma @ 2022-11-05  8:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: outreachy, linux-staging, linux-kernel

On Sat, Nov 05, 2022 at 09:36:21AM +0100, Greg Kroah-Hartman wrote:
> On Sat, Nov 05, 2022 at 12:04:56AM +0530, Deepak R Varma wrote:
> > Member variable "Value" of structure iqk_matrix_regs_setting is
> > declared to be a 2D array of [3][IQK_Matrix_REG_NUM] grid. However
> > the primary index of this array is only used for index 0, the other
> > two elements are never used. Simplify this array to a one dimension
> > degree. The resultant code is simpler and is easy to maintain.
> >
> > Suggested-by: Dan Carpenter <error27@gmail.com>
> > Signed-off-by: Deepak R Varma <drv@mailo.com>
> > ---
> >  drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 18 +++++++++---------
> >  drivers/staging/rtl8723bs/hal/odm.h            |  2 +-
> >  2 files changed, 10 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
> > index a52748f7b56e..9317a4462c02 100644
> > --- a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
> > +++ b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
> > @@ -244,8 +244,8 @@ void ODM_TxPwrTrackSetPwr_8723B(
> >  			Final_CCK_Swing_Index = 0;
> >
> >  		setIqkMatrix_8723B(pDM_Odm, Final_OFDM_Swing_Index, RFPath,
> > -			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0],
> > -			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]);
> > +			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0],
> > +			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[1]);
> >
> >  		setCCKFilterCoefficient(pDM_Odm, Final_CCK_Swing_Index);
> >
> > @@ -257,8 +257,8 @@ void ODM_TxPwrTrackSetPwr_8723B(
> >  			pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index - PwrTrackingLimit_OFDM;
> >
> >  			setIqkMatrix_8723B(pDM_Odm, PwrTrackingLimit_OFDM, RFPath,
> > -				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0],
> > -				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]);
> > +				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0],
> > +				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[1]);
> >
> >  			pDM_Odm->Modify_TxAGC_Flag_PathA = true;
> >  			PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM);
> > @@ -267,16 +267,16 @@ void ODM_TxPwrTrackSetPwr_8723B(
> >  			pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index;
> >
> >  			setIqkMatrix_8723B(pDM_Odm, 0, RFPath,
> > -				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0],
> > -				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]);
> > +				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0],
> > +				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[1]);
> >
> >  			pDM_Odm->Modify_TxAGC_Flag_PathA = true;
> >  			PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM);
> >  			PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, HT_MCS0_MCS7);
> >  		} else {
> >  			setIqkMatrix_8723B(pDM_Odm, Final_OFDM_Swing_Index, RFPath,
> > -				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0],
> > -				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]);
> > +				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0],
> > +				pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[1]);
> >
> >  			if (pDM_Odm->Modify_TxAGC_Flag_PathA) { /* If TxAGC has changed, reset TxAGC again */
> >  				pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = 0;
> > @@ -1760,7 +1760,7 @@ void PHY_IQCalibrate_8723B(
> >  /* by sherry 20120321 */
> >  	if (final_candidate < 4) {
> >  		for (i = 0; i < IQK_Matrix_REG_NUM; i++)
> > -			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].Value[0][i] = result[final_candidate][i];
> > +			pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].Value[i] = result[final_candidate][i];
> >  		pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].bIQKDone = true;
> >  	}
> >
> > diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h
> > index fe9782d2d4fd..e16a769850c5 100644
> > --- a/drivers/staging/rtl8723bs/hal/odm.h
> > +++ b/drivers/staging/rtl8723bs/hal/odm.h
> > @@ -481,7 +481,7 @@ enum odm_type_alna_e { /* tag_ODM_TYPE_ALNA_Definition */
> >
> >  struct iqk_matrix_regs_setting { /* _IQK_MATRIX_REGS_SETTING */
> >  	bool bIQKDone;
> > -	s32 Value[3][IQK_Matrix_REG_NUM];
> > +	s32 Value[IQK_Matrix_REG_NUM];
>
> This field is used to store values (as your above patch shows), but
> where is it actually used?  Are you sure it is needed at all?

Hi Greg,
For this driver, the values are passed onto setIqkMatrix_8723B() as arguments
and used inside this function. They are needed to be retained in the structure.

Thank you,
./drv


>
> thanks,
>
> greg k-h
>



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

* Re: [PATCH 1/2] staging: rtl8723bs: Simplify underutilized 2D array to 1D array
  2022-11-05  8:44     ` Deepak R Varma
@ 2022-11-05  9:17       ` Deepak R Varma
  2022-11-08 15:19         ` Greg Kroah-Hartman
  0 siblings, 1 reply; 8+ messages in thread
From: Deepak R Varma @ 2022-11-05  9:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: outreachy, linux-staging, linux-kernel

On Sat, Nov 05, 2022 at 02:14:12PM +0530, Deepak R Varma wrote:
> On Sat, Nov 05, 2022 at 09:36:21AM +0100, Greg Kroah-Hartman wrote:
> > >
> > > diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h
> > > index fe9782d2d4fd..e16a769850c5 100644
> > > --- a/drivers/staging/rtl8723bs/hal/odm.h
> > > +++ b/drivers/staging/rtl8723bs/hal/odm.h
> > > @@ -481,7 +481,7 @@ enum odm_type_alna_e { /* tag_ODM_TYPE_ALNA_Definition */
> > >
> > >  struct iqk_matrix_regs_setting { /* _IQK_MATRIX_REGS_SETTING */
> > >  	bool bIQKDone;
> > > -	s32 Value[3][IQK_Matrix_REG_NUM];
> > > +	s32 Value[IQK_Matrix_REG_NUM];
> >
> > This field is used to store values (as your above patch shows), but
> > where is it actually used?  Are you sure it is needed at all?
>
> Hi Greg,
> For this driver, the values are passed onto setIqkMatrix_8723B() as arguments
> and used inside this function. They are needed to be retained in the structure.

Hello Greg,
Upon further review of the structure, I observed that the member "bIQKDone" is
also not used anywhere in the code and it can be removed as well. That cleanup
will lead to replacing this entire structure by a simple one dimensional 'Value"
array.

Please suggest if I should make that change and send in a revision?

Thank you,
./drv

>
> Thank you,
> ./drv
>
>
> >
> > thanks,
> >
> > greg k-h
> >
>
>
>



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

* Re: [PATCH 1/2] staging: rtl8723bs: Simplify underutilized 2D array to 1D array
  2022-11-05  9:17       ` Deepak R Varma
@ 2022-11-08 15:19         ` Greg Kroah-Hartman
  2022-11-08 17:49           ` Deepak R Varma
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-08 15:19 UTC (permalink / raw)
  To: Deepak R Varma; +Cc: outreachy, linux-staging, linux-kernel

On Sat, Nov 05, 2022 at 02:47:49PM +0530, Deepak R Varma wrote:
> On Sat, Nov 05, 2022 at 02:14:12PM +0530, Deepak R Varma wrote:
> > On Sat, Nov 05, 2022 at 09:36:21AM +0100, Greg Kroah-Hartman wrote:
> > > >
> > > > diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h
> > > > index fe9782d2d4fd..e16a769850c5 100644
> > > > --- a/drivers/staging/rtl8723bs/hal/odm.h
> > > > +++ b/drivers/staging/rtl8723bs/hal/odm.h
> > > > @@ -481,7 +481,7 @@ enum odm_type_alna_e { /* tag_ODM_TYPE_ALNA_Definition */
> > > >
> > > >  struct iqk_matrix_regs_setting { /* _IQK_MATRIX_REGS_SETTING */
> > > >  	bool bIQKDone;
> > > > -	s32 Value[3][IQK_Matrix_REG_NUM];
> > > > +	s32 Value[IQK_Matrix_REG_NUM];
> > >
> > > This field is used to store values (as your above patch shows), but
> > > where is it actually used?  Are you sure it is needed at all?
> >
> > Hi Greg,
> > For this driver, the values are passed onto setIqkMatrix_8723B() as arguments
> > and used inside this function. They are needed to be retained in the structure.
> 
> Hello Greg,
> Upon further review of the structure, I observed that the member "bIQKDone" is
> also not used anywhere in the code and it can be removed as well. That cleanup
> will lead to replacing this entire structure by a simple one dimensional 'Value"
> array.
> 
> Please suggest if I should make that change and send in a revision?

Yes, that would be a better overall change.

thanks,

greg k-h

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

* Re: [PATCH 1/2] staging: rtl8723bs: Simplify underutilized 2D array to 1D array
  2022-11-08 15:19         ` Greg Kroah-Hartman
@ 2022-11-08 17:49           ` Deepak R Varma
  0 siblings, 0 replies; 8+ messages in thread
From: Deepak R Varma @ 2022-11-08 17:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: outreachy, linux-staging, linux-kernel

On Tue, Nov 08, 2022 at 04:19:41PM +0100, Greg Kroah-Hartman wrote:
> On Sat, Nov 05, 2022 at 02:47:49PM +0530, Deepak R Varma wrote:
> > On Sat, Nov 05, 2022 at 02:14:12PM +0530, Deepak R Varma wrote:
> > Hello Greg,
> > Upon further review of the structure, I observed that the member "bIQKDone" is
> > also not used anywhere in the code and it can be removed as well. That cleanup
> > will lead to replacing this entire structure by a simple one dimensional 'Value"
> > array.
> >
> > Please suggest if I should make that change and send in a revision?
>
> Yes, that would be a better overall change.

Hello Greg,
The patch is resubmitted earlier with following subject:
	[PATCH v2] staging: rtl8723bs: replace underutilized struct by array variable

Thank you,
./drv

>
> thanks,
>
> greg k-h
>



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

end of thread, other threads:[~2022-11-08 17:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-04 18:34 [PATCH 0/2] staging: rtl8723bs: struct iqk_matrix_regs_setting cleanup Deepak R Varma
2022-11-04 18:34 ` [PATCH 1/2] staging: rtl8723bs: Simplify underutilized 2D array to 1D array Deepak R Varma
2022-11-05  8:36   ` Greg Kroah-Hartman
2022-11-05  8:44     ` Deepak R Varma
2022-11-05  9:17       ` Deepak R Varma
2022-11-08 15:19         ` Greg Kroah-Hartman
2022-11-08 17:49           ` Deepak R Varma
2022-11-04 18:35 ` [PATCH 2/2] staging: rtl8723bs: Remove unused member variable Deepak R Varma

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