staging: rtl8723bs: hal: remove unnecessary braces
PATCH 1/1 staging: rtl8723bs: hal: remove unnecessary braces
Checkpatch reports the following warning in odm_DIG.c
WARNING: braces {} are not necessary for single statement blocks
Remove unnecessary braces from single line conditional statements in odm_DIG.c to fix checkpatch warning.
---
Changes have been compile tested. No functionality change intended
drivers/staging/rtl8723bs/hal/odm_DIG.c | 28 +++++++++---------------- 1 file changed, 10 insertions(+), 18 deletions(-)
drivers/staging/rtl8723bs/hal/odm_DIG.c +10 -18
@@ -220,9 +220,8 @@ void odm_Adaptivity(void *pDM_VOID, u8 IGI)s8 Diff, IGI_target;bool EDCCA_State = false; -if (!(pDM_Odm->SupportAbility &ODM_BB_ADAPTIVITY )) { +if (!(pDM_Odm->SupportAbility &ODM_BB_ADAPTIVITY ))return ; - }if (*pDM_Odm->pBandWidth ==ODM_BW20M )/* CHANNEL_WIDTH_20 */ IGI_target = pDM_Odm->IGI_Base;
@@ -286,16 +285,14 @@ void ODM_Write_DIG(void *pDM_VOID, u8 CurrentIGI)struct dm_odm_t *pDM_Odm = (struct dm_odm_t *)pDM_VOID;struct dig_t *pDM_DigTable = &pDM_Odm->DM_DigTable; -if (pDM_DigTable->bStopDIG) { +if (pDM_DigTable->bStopDIG)return ; - }if (pDM_DigTable->CurIGValue != CurrentIGI) {/* 1 Check initial gain by upper bound */ if (!pDM_DigTable->bPSDInProgress) { -if (CurrentIGI > pDM_DigTable->rx_gain_range_max) { +if (CurrentIGI > pDM_DigTable->rx_gain_range_max) CurrentIGI = pDM_DigTable->rx_gain_range_max; - } }
@@ -314,24 +311,20 @@ bool odm_DigAbort(void *pDM_VOID)struct dm_odm_t *pDM_Odm = (struct dm_odm_t *)pDM_VOID;/* SupportAbility */ -if (!(pDM_Odm->SupportAbility &ODM_BB_FA_CNT )) { +if (!(pDM_Odm->SupportAbility &ODM_BB_FA_CNT ))return true; - }/* SupportAbility */ -if (!(pDM_Odm->SupportAbility &ODM_BB_DIG )) { +if (!(pDM_Odm->SupportAbility &ODM_BB_DIG ))return true; - }/* ScanInProcess */ -if (*(pDM_Odm->pbScanInProcess)) { +if (*(pDM_Odm->pbScanInProcess))return true; - }/* add by Neil Chen to avoid PSD is processing */ -if (pDM_Odm->bDMInitialGainEnable == false) { +if (pDM_Odm->bDMInitialGainEnable == false)return true; - }return false; }
@@ -413,9 +406,9 @@ void odm_DIG(void *pDM_VOID)if (pDM_Odm->bLinked && bPerformance) {/* 2 Modify DIG upper bound */ /* 4 Modify DIG upper bound for 92E, 8723A\B, 8821 & 8812 BT */ -if (pDM_Odm->bBtLimitedDig ==1 ) { +if (pDM_Odm->bBtLimitedDig ==1 ) offset =10 ; - }else +else offset =15 ;if ((pDM_Odm->RSSI_Min + offset) > dm_dig_max)
@@ -475,9 +468,8 @@ void odm_DIG(void *pDM_VOID) }/* 2 Abnormal lower bound case */ -if (pDM_DigTable->rx_gain_range_min > pDM_DigTable->rx_gain_range_max) { +if (pDM_DigTable->rx_gain_range_min > pDM_DigTable->rx_gain_range_max) pDM_DigTable->rx_gain_range_min = pDM_DigTable->rx_gain_range_max; - }/* 1 False alarm threshold decision */
Signature · 1 line
2.52.0
Don't write hal in your subject. It must be:
[PATCH] staging: rtl8723bs: remove unnecessary braces
Otherwise your patch looks good.
Thanks,
Bera
PATCH v2 1/1 staging: rtl8723bs: remove unnecessary braces
Checkpatch reports the following warning in odm_DIG.c
WARNING: braces {} are not necessary for single statement blocks
Remove unnecessary braces from single line conditional statements in odm_DIG.c to fix checkpatch warning.
---
Changelog:
- Remove hal from subject line as suggested by Bera Yüzlü
drivers/staging/rtl8723bs/hal/odm_DIG.c | 28 +++++++++---------------- 1 file changed, 10 insertions(+), 18 deletions(-)
drivers/staging/rtl8723bs/hal/odm_DIG.c +10 -18
@@ -220,9 +220,8 @@ void odm_Adaptivity(void *pDM_VOID, u8 IGI)s8 Diff, IGI_target;bool EDCCA_State = false; -if (!(pDM_Odm->SupportAbility &ODM_BB_ADAPTIVITY )) { +if (!(pDM_Odm->SupportAbility &ODM_BB_ADAPTIVITY ))return ; - }if (*pDM_Odm->pBandWidth ==ODM_BW20M )/* CHANNEL_WIDTH_20 */ IGI_target = pDM_Odm->IGI_Base;
@@ -286,16 +285,14 @@ void ODM_Write_DIG(void *pDM_VOID, u8 CurrentIGI)struct dm_odm_t *pDM_Odm = (struct dm_odm_t *)pDM_VOID;struct dig_t *pDM_DigTable = &pDM_Odm->DM_DigTable; -if (pDM_DigTable->bStopDIG) { +if (pDM_DigTable->bStopDIG)return ; - }if (pDM_DigTable->CurIGValue != CurrentIGI) {/* 1 Check initial gain by upper bound */ if (!pDM_DigTable->bPSDInProgress) { -if (CurrentIGI > pDM_DigTable->rx_gain_range_max) { +if (CurrentIGI > pDM_DigTable->rx_gain_range_max) CurrentIGI = pDM_DigTable->rx_gain_range_max; - } }
@@ -314,24 +311,20 @@ bool odm_DigAbort(void *pDM_VOID)struct dm_odm_t *pDM_Odm = (struct dm_odm_t *)pDM_VOID;/* SupportAbility */ -if (!(pDM_Odm->SupportAbility &ODM_BB_FA_CNT )) { +if (!(pDM_Odm->SupportAbility &ODM_BB_FA_CNT ))return true; - }/* SupportAbility */ -if (!(pDM_Odm->SupportAbility &ODM_BB_DIG )) { +if (!(pDM_Odm->SupportAbility &ODM_BB_DIG ))return true; - }/* ScanInProcess */ -if (*(pDM_Odm->pbScanInProcess)) { +if (*(pDM_Odm->pbScanInProcess))return true; - }/* add by Neil Chen to avoid PSD is processing */ -if (pDM_Odm->bDMInitialGainEnable == false) { +if (pDM_Odm->bDMInitialGainEnable == false)return true; - }return false; }
@@ -413,9 +406,9 @@ void odm_DIG(void *pDM_VOID)if (pDM_Odm->bLinked && bPerformance) {/* 2 Modify DIG upper bound */ /* 4 Modify DIG upper bound for 92E, 8723A\B, 8821 & 8812 BT */ -if (pDM_Odm->bBtLimitedDig ==1 ) { +if (pDM_Odm->bBtLimitedDig ==1 ) offset =10 ; - }else +else offset =15 ;if ((pDM_Odm->RSSI_Min + offset) > dm_dig_max)
@@ -475,9 +468,8 @@ void odm_DIG(void *pDM_VOID) }/* 2 Abnormal lower bound case */ -if (pDM_DigTable->rx_gain_range_min > pDM_DigTable->rx_gain_range_max) { +if (pDM_DigTable->rx_gain_range_min > pDM_DigTable->rx_gain_range_max) pDM_DigTable->rx_gain_range_min = pDM_DigTable->rx_gain_range_max; - }/* 1 False alarm threshold decision */
Signature · 1 line
2.52.0
Re: [PATCH v2] staging: rtl8723bs: remove unnecessary braces
Next time send your V2 as a new thread and after --- use version tags. Look at this resource on how to make a v2:
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/
Thanks,
Bera
Re: [PATCH v2] staging: rtl8723bs: remove unnecessary braces
Hi Bera,
Thanks a lot for sharing the post on making a v2. Will make sure to follow the guidelines as specified by Dan in the in future patches.
Thanks,
Gopi Krishna Menon
Quoted 7 lines · Bera Yüzlü
Next time send your V2 as a new thread and after --- use version tags. Look at this resource on how to make a v2:
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/
Thanks,
Bera