Re: [PATCH] staging: r8188eu: replace one element 2D array by 1D array

From: Greg Kroah-Hartman
Date: Thu Nov 03 2022 - 09:26:41 EST


On Thu, Nov 03, 2022 at 05:26:01PM +0530, Deepak R Varma wrote:
> A single element two dimensional array is constrained to index 0 for
> that element. This constraint makes it similar to a one dimensional
> array. Hence convert such array to a simplified one dimensional
> equivalent. Resultant code is simpler and easy to maintain.
>
> Suggested-by: Dan Carpenter <error27@xxxxxxxxx>
> Signed-off-by: Deepak R Varma <drv@xxxxxxxxx>
> ---
> drivers/staging/r8188eu/hal/HalPhyRf_8188e.c | 2 +-
> drivers/staging/r8188eu/include/odm.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/r8188eu/hal/HalPhyRf_8188e.c
> index 622f95d3f2ed..c0706c5b3fd8 100644
> --- a/drivers/staging/r8188eu/hal/HalPhyRf_8188e.c
> +++ b/drivers/staging/r8188eu/hal/HalPhyRf_8188e.c
> @@ -886,7 +886,7 @@ void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery)
> /* by sherry 20120321 */
> if (final_candidate < 4) {
> for (i = 0; i < IQK_Matrix_REG_NUM; i++)
> - dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[0][i] = result[final_candidate][i];
> + dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[i] = result[final_candidate][i];

Why is this field only being set and never used?

Is it even needed at all? If not, why not just remove it entirely?

thanks,

greg k-h