On Sun, 29 Aug 2021 at 18:56, Michael Straube <straube.linux@xxxxxxxxx> wrote: > > Refactor the field IQKMatrixRegSetting of struct odm_rf_cal to be not > an array. The driver is for chips that operate in the 2.4 GHz band only. > So only the first element of the array is used and there is no need for > an array. > > Signed-off-by: Michael Straube <straube.linux@xxxxxxxxx> > --- > drivers/staging/r8188eu/hal/HalPhyRf_8188e.c | 12 ++++++------ > drivers/staging/r8188eu/include/odm.h | 3 +-- > 2 files changed, 7 insertions(+), 8 deletions(-) > > diff --git a/drivers/staging/r8188eu/hal/HalPhyRf_8188e.c b/drivers/staging/r8188eu/hal/HalPhyRf_8188e.c > index 1b0e1e7307cd..6e0abaf58791 100644 > --- a/drivers/staging/r8188eu/hal/HalPhyRf_8188e.c > +++ b/drivers/staging/r8188eu/hal/HalPhyRf_8188e.c > @@ -279,8 +279,8 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E( > > /* Adujst OFDM Ant_A according to IQK result */ > ele_D = (OFDMSwingTable[(u8)OFDM_index[0]] & 0xFFC00000) >> 22; > - X = dm_odm->RFCalibrateInfo.IQKMatrixRegSetting[0].Value[0][0]; > - Y = dm_odm->RFCalibrateInfo.IQKMatrixRegSetting[0].Value[0][1]; > + X = dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[0][0]; > + Y = dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[0][1]; > > /* Revse TX power table. */ > dm_odm->BbSwingIdxOfdm = (u8)OFDM_index[0]; > @@ -314,8 +314,8 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E( > ele_D = (OFDMSwingTable[(u8)OFDM_index[1]] & 0xFFC00000) >> 22; > > /* new element A = element D x X */ > - X = dm_odm->RFCalibrateInfo.IQKMatrixRegSetting[0].Value[0][4]; > - Y = dm_odm->RFCalibrateInfo.IQKMatrixRegSetting[0].Value[0][5]; > + X = dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[0][4]; > + Y = dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[0][5]; > > if ((X != 0) && (*dm_odm->pBandType == ODM_BAND_2_4G)) { > if ((X & 0x00000200) != 0) /* consider minus */ > @@ -1182,8 +1182,8 @@ 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[0].Value[0][i] = result[final_candidate][i]; > - dm_odm->RFCalibrateInfo.IQKMatrixRegSetting[0].bIQKDone = true; > + dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[0][i] = result[final_candidate][i]; > + dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.bIQKDone = true; > } > > _PHY_SaveADDARegisters(adapt, IQK_BB_REG_92C, dm_odm->RFCalibrateInfo.IQK_BB_backup_recover, 9); > diff --git a/drivers/staging/r8188eu/include/odm.h b/drivers/staging/r8188eu/include/odm.h > index d9041ee576bb..7c8f082930dd 100644 > --- a/drivers/staging/r8188eu/include/odm.h > +++ b/drivers/staging/r8188eu/include/odm.h > @@ -260,7 +260,6 @@ struct odm_rate_adapt { > > #define AVG_THERMAL_NUM 8 > #define IQK_Matrix_REG_NUM 8 > -#define IQK_Matrix_Settings_NUM 1+24+21 > > #define DM_Type_ByFWi 0 > #define DM_Type_ByDriver 1 > @@ -664,7 +663,7 @@ struct odm_rf_cal { > > u8 ThermalValue_HP[HP_THERMAL_NUM]; > u8 ThermalValue_HP_index; > - struct ijk_matrix_regs_set IQKMatrixRegSetting[IQK_Matrix_Settings_NUM]; > + struct ijk_matrix_regs_set IQKMatrixRegSetting; > > u8 Delta_IQK; > u8 Delta_LCK; > -- > 2.33.0 > Acked-by: Phillip Potter <phil@xxxxxxxxxxxxxxxx> Regards, Phil