[PATCH 8/9] staging: rtl8723bs: reformat switch-case blocks with braced bodies

Marc Finkelbaum
2026-04-14T09:59:02Z

Move the opening brace from a separate line to the end of the case
label (case X: {) and combine the closing brace with break (} break;)
for HW_VAR_SEC_CFG, HW_VAR_SEC_DK_CFG, HAL_DEF_UNDERCORATEDSMOOTHEDPWDB,
and HAL_ODM_STA_INFO. Also add braces to the unguarded else clause in
HW_VAR_SEC_DK_CFG, reindent the moved declarations by one level, and
fix over-indented bodies in HAL_ODM_P2P_STATE and HAL_ODM_WIFI_DISPLAY_STATE.

No functional change.

Signed-off-by: Marc Finkelbaum <regpacy@gmail.com>
---
drivers/staging/rtl8723bs/hal/hal_com.c | 62 +++++++++++--------------
1 file changed, 28 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 44bef1400947..2688355f9265 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -561,16 +561,13 @@ void SetHwReg(struct adapter *adapter, u8 variable, u8 *val)
case HW_VAR_INIT_RTS_RATE:
rtw_warn_on(1);
break;
- case HW_VAR_SEC_CFG:
- {
+ case HW_VAR_SEC_CFG: {
u16 reg_scr;

reg_scr = rtw_read16(adapter, REG_SECCFG);
rtw_write16(adapter, REG_SECCFG, reg_scr | SCR_CHK_KEYID | SCR_RxDecEnable | SCR_TxEncEnable);
- }
- break;
- case HW_VAR_SEC_DK_CFG:
- {
+ } break;
+ case HW_VAR_SEC_DK_CFG: {
struct security_priv *sec = &adapter->securitypriv;
u8 reg_scr = rtw_read8(adapter, REG_SECCFG);

@@ -578,12 +575,12 @@ void SetHwReg(struct adapter *adapter, u8 variable, u8 *val)
reg_scr |= SCR_TXBCUSEDK;
if (sec->dot11AuthAlgrthm != dot11AuthAlgrthm_8021X)
reg_scr |= (SCR_RxUseDK | SCR_TxUseDK);
- } else /* Disable default key related setting */
+ } else { /* Disable default key related setting */
reg_scr &= ~(SCR_RXBCUSEDK | SCR_TXBCUSEDK | SCR_RxUseDK | SCR_TxUseDK);
+ }

rtw_write8(adapter, REG_SECCFG, reg_scr);
- }
- break;
+ } break;
case HW_VAR_DM_FLAG:
odm->SupportAbility = *((u32 *)val);
break;
@@ -653,19 +650,17 @@ u8 GetHalDefVar(struct adapter *adapter, enum hal_def_variable variable,
u8 bResult = _SUCCESS;

switch (variable) {
- case HAL_DEF_UNDERCORATEDSMOOTHEDPWDB:
- {
- struct mlme_priv *pmlmepriv;
- struct sta_priv *pstapriv;
- struct sta_info *psta;
+ case HAL_DEF_UNDERCORATEDSMOOTHEDPWDB: {
+ struct mlme_priv *pmlmepriv;
+ struct sta_priv *pstapriv;
+ struct sta_info *psta;

- pmlmepriv = &adapter->mlmepriv;
- pstapriv = &adapter->stapriv;
- psta = rtw_get_stainfo(pstapriv, pmlmepriv->cur_network.network.mac_address);
- if (psta)
- *((int *)value) = psta->rssi_stat.UndecoratedSmoothedPWDB;
- }
- break;
+ pmlmepriv = &adapter->mlmepriv;
+ pstapriv = &adapter->stapriv;
+ psta = rtw_get_stainfo(pstapriv, pmlmepriv->cur_network.network.mac_address);
+ if (psta)
+ *((int *)value) = psta->rssi_stat.UndecoratedSmoothedPWDB;
+ } break;
case HAL_DEF_DBG_DM_FUNC:
*((u32 *)value) = hal_data->odmpriv.SupportAbility;
break;
@@ -702,24 +697,23 @@ void SetHalODMVar(struct adapter *Adapter, enum hal_odm_variable eVariable,
struct dm_odm_t *podmpriv = &pHalData->odmpriv;
/* _irqL irqL; */
switch (eVariable) {
- case HAL_ODM_STA_INFO:
- {
- struct sta_info *psta = pValue1;
- if (bSet) {
- ODM_CmnInfoPtrArrayHook(podmpriv, ODM_CMNINFO_STA_STATUS, psta->mac_id, psta);
- } else {
- /* spin_lock_bh(&pHalData->odm_stainfo_lock); */
- ODM_CmnInfoPtrArrayHook(podmpriv, ODM_CMNINFO_STA_STATUS, psta->mac_id, NULL);
+ case HAL_ODM_STA_INFO: {
+ struct sta_info *psta = pValue1;

- /* spin_unlock_bh(&pHalData->odm_stainfo_lock); */
- }
+ if (bSet) {
+ ODM_CmnInfoPtrArrayHook(podmpriv, ODM_CMNINFO_STA_STATUS, psta->mac_id, psta);
+ } else {
+ /* spin_lock_bh(&pHalData->odm_stainfo_lock); */
+ ODM_CmnInfoPtrArrayHook(podmpriv, ODM_CMNINFO_STA_STATUS, psta->mac_id, NULL);
+
+ /* spin_unlock_bh(&pHalData->odm_stainfo_lock); */
}
- break;
+ } break;
case HAL_ODM_P2P_STATE:
- ODM_CmnInfoUpdate(podmpriv, ODM_CMNINFO_WIFI_DIRECT, bSet);
+ ODM_CmnInfoUpdate(podmpriv, ODM_CMNINFO_WIFI_DIRECT, bSet);
break;
case HAL_ODM_WIFI_DISPLAY_STATE:
- ODM_CmnInfoUpdate(podmpriv, ODM_CMNINFO_WIFI_DISPLAY, bSet);
+ ODM_CmnInfoUpdate(podmpriv, ODM_CMNINFO_WIFI_DISPLAY, bSet);
break;

default:
--
2.53.0