* [PATCH 0/9] staging: rtl8723bs: coding style cleanup in hal_com.c
@ 2026-04-14 9:58 Marc Finkelbaum
2026-04-14 9:58 ` [PATCH 1/9] staging: rtl8723bs: remove extra blank lines Marc Finkelbaum
` (9 more replies)
0 siblings, 10 replies; 19+ messages in thread
From: Marc Finkelbaum @ 2026-04-14 9:58 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Michael Straube, Dan Carpenter, Ethan Tidmore, Andy Shevchenko,
linux-staging, linux-kernel, Marc Finkelbaum
This series cleans up checkpatch --strict warnings in
drivers/staging/rtl8723bs/hal/hal_com.c. All changes are purely
cosmetic; the compiled .text section is byte-identical before
and after the series (verified with objdump -d).
Marc Finkelbaum (9):
staging: rtl8723bs: remove extra blank lines
staging: rtl8723bs: fix space-before-tab whitespace
staging: rtl8723bs: fix block comment alignment
staging: rtl8723bs: add spaces around binary operators
staging: rtl8723bs: add space before inline block comments
staging: rtl8723bs: fix Yoda conditions and == false comparisons
staging: rtl8723bs: reformat multi-line function signatures
staging: rtl8723bs: reformat switch-case blocks with braced bodies
staging: rtl8723bs: wrap long lines and fix argument alignment
drivers/staging/rtl8723bs/hal/hal_com.c | 296 ++++++++++++------------
1 file changed, 146 insertions(+), 150 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 1/9] staging: rtl8723bs: remove extra blank lines
2026-04-14 9:58 [PATCH 0/9] staging: rtl8723bs: coding style cleanup in hal_com.c Marc Finkelbaum
@ 2026-04-14 9:58 ` Marc Finkelbaum
2026-04-14 11:45 ` Andy Shevchenko
2026-04-14 9:58 ` [PATCH 2/9] staging: rtl8723bs: fix space-before-tab whitespace Marc Finkelbaum
` (8 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Marc Finkelbaum @ 2026-04-14 9:58 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Michael Straube, Dan Carpenter, Ethan Tidmore, Andy Shevchenko,
linux-staging, linux-kernel, Marc Finkelbaum
Remove double blank lines between function definitions and between a
function end and the following macro definition. Also remove spurious
blank lines at the start of an if/else body and trailing blank lines
before a closing brace in _TwoOutPipeMapping, _ThreeOutPipeMapping,
Hal_MappingOutPipe, and the HalSetBrateCfg rate loop.
No functional change.
Signed-off-by: Marc Finkelbaum <regpacy@gmail.com>
---
drivers/staging/rtl8723bs/hal/hal_com.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 31b3e880ae6a..0c3e983a1b2c 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -30,7 +30,6 @@ void rtw_hal_data_deinit(struct adapter *padapter)
}
}
-
void dump_chip_info(struct hal_version ChipVersion)
{
char buf[128];
@@ -71,7 +70,6 @@ void dump_chip_info(struct hal_version ChipVersion)
cnt += scnprintf(buf + cnt, sizeof(buf) - cnt, "RomVer(%d)\n", ChipVersion.ROMVer);
}
-
#define EEPROM_CHANNEL_PLAN_BY_HW_MASK 0x80
/*
@@ -294,7 +292,6 @@ void HalSetBrateCfg(struct adapter *Adapter, u8 *mBratesOS, u16 *pBrateCfg)
u8 i, is_brate, brate;
for (i = 0; i < NDIS_802_11_LENGTH_RATES_EX; i++) {
-
is_brate = mBratesOS[i] & IEEE80211_BASIC_RATE_MASK;
brate = mBratesOS[i] & 0x7f;
@@ -361,7 +358,6 @@ static void _TwoOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
if (bWIFICfg) { /* WMM */
-
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
/* 0, 1, 0, 1, 0, 0, 0, 0, 0 }; */
/* 0:ep_0 num, 1:ep_1 num */
@@ -377,8 +373,6 @@ static void _TwoOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
} else { /* typical setting */
-
-
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
/* 1, 1, 0, 0, 0, 0, 0, 0, 0 }; */
/* 0:ep_0 num, 1:ep_1 num */
@@ -394,7 +388,6 @@ static void _TwoOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
}
-
}
static void _ThreeOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
@@ -402,7 +395,6 @@ static void _ThreeOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
if (bWIFICfg) { /* for WMM */
-
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
/* 1, 2, 1, 0, 0, 0, 0, 0, 0 }; */
/* 0:H, 1:N, 2:L */
@@ -418,8 +410,6 @@ static void _ThreeOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
} else { /* typical setting */
-
-
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
/* 2, 2, 1, 0, 0, 0, 0, 0, 0 }; */
/* 0:H, 1:N, 2:L */
@@ -434,7 +424,6 @@ static void _ThreeOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];/* HIGH */
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
}
-
}
bool Hal_MappingOutPipe(struct adapter *padapter, u8 NumOutPipe)
@@ -462,7 +451,6 @@ bool Hal_MappingOutPipe(struct adapter *padapter, u8 NumOutPipe)
}
return result;
-
}
void hal_init_macaddr(struct adapter *adapter)
@@ -749,7 +737,6 @@ void SetHalODMVar(
}
}
-
bool eqNByte(u8 *str1, u8 *str2, u32 num)
{
if (num == 0)
--
2.53.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 2/9] staging: rtl8723bs: fix space-before-tab whitespace
2026-04-14 9:58 [PATCH 0/9] staging: rtl8723bs: coding style cleanup in hal_com.c Marc Finkelbaum
2026-04-14 9:58 ` [PATCH 1/9] staging: rtl8723bs: remove extra blank lines Marc Finkelbaum
@ 2026-04-14 9:58 ` Marc Finkelbaum
2026-04-14 11:48 ` Andy Shevchenko
2026-04-14 9:58 ` [PATCH 3/9] staging: rtl8723bs: fix block comment alignment Marc Finkelbaum
` (7 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Marc Finkelbaum @ 2026-04-14 9:58 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Michael Straube, Dan Carpenter, Ethan Tidmore, Andy Shevchenko,
linux-staging, linux-kernel, Marc Finkelbaum
Replace tab characters with a single space in macro definitions
(EEPROM_CHANNEL_PLAN_BY_HW_MASK, REG_RF_BB_GAIN_OFFSET), the
dump_chip_info parameter list, the pHalData pointer declaration in
SetHalODMVar, and the BK/BE/VI/VO tabular comments inside
_TwoOutPipeMapping and _ThreeOutPipeMapping.
No functional change.
Signed-off-by: Marc Finkelbaum <regpacy@gmail.com>
---
drivers/staging/rtl8723bs/hal/hal_com.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 0c3e983a1b2c..07e4da49d757 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -30,7 +30,7 @@ void rtw_hal_data_deinit(struct adapter *padapter)
}
}
-void dump_chip_info(struct hal_version ChipVersion)
+void dump_chip_info(struct hal_version ChipVersion)
{
char buf[128];
size_t cnt = 0;
@@ -70,7 +70,7 @@ void dump_chip_info(struct hal_version ChipVersion)
cnt += scnprintf(buf + cnt, sizeof(buf) - cnt, "RomVer(%d)\n", ChipVersion.ROMVer);
}
-#define EEPROM_CHANNEL_PLAN_BY_HW_MASK 0x80
+#define EEPROM_CHANNEL_PLAN_BY_HW_MASK 0x80
/*
* Description:
@@ -358,7 +358,7 @@ static void _TwoOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
if (bWIFICfg) { /* WMM */
- /* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
+ /* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
/* 0, 1, 0, 1, 0, 0, 0, 0, 0 }; */
/* 0:ep_0 num, 1:ep_1 num */
@@ -395,7 +395,7 @@ static void _ThreeOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
if (bWIFICfg) { /* for WMM */
- /* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
+ /* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
/* 1, 2, 1, 0, 0, 0, 0, 0, 0 }; */
/* 0:H, 1:N, 2:L */
@@ -410,7 +410,7 @@ static void _ThreeOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
} else { /* typical setting */
- /* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
+ /* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
/* 2, 2, 1, 0, 0, 0, 0, 0, 0 }; */
/* 0:H, 1:N, 2:L */
@@ -708,7 +708,7 @@ void SetHalODMVar(
bool bSet
)
{
- struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
+ struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
struct dm_odm_t *podmpriv = &pHalData->odmpriv;
/* _irqL irqL; */
switch (eVariable) {
@@ -786,7 +786,7 @@ static u32 Array_kfreemap[] = {
0xfc, 0x0,
};
-#define REG_RF_BB_GAIN_OFFSET 0x7f
+#define REG_RF_BB_GAIN_OFFSET 0x7f
//#define RF_GAIN_OFFSET_MASK 0xfffff
void rtw_bb_rf_gain_offset(struct adapter *padapter)
--
2.53.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 3/9] staging: rtl8723bs: fix block comment alignment
2026-04-14 9:58 [PATCH 0/9] staging: rtl8723bs: coding style cleanup in hal_com.c Marc Finkelbaum
2026-04-14 9:58 ` [PATCH 1/9] staging: rtl8723bs: remove extra blank lines Marc Finkelbaum
2026-04-14 9:58 ` [PATCH 2/9] staging: rtl8723bs: fix space-before-tab whitespace Marc Finkelbaum
@ 2026-04-14 9:58 ` Marc Finkelbaum
2026-04-14 11:51 ` Andy Shevchenko
2026-04-14 9:58 ` [PATCH 4/9] staging: rtl8723bs: add spaces around binary operators Marc Finkelbaum
` (6 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Marc Finkelbaum @ 2026-04-14 9:58 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Michael Straube, Dan Carpenter, Ethan Tidmore, Andy Shevchenko,
linux-staging, linux-kernel, Marc Finkelbaum
Add the required space after the opening '/*' on continuation lines in
four block comments: the two C2H event format header tables, the
clear_evt inline comment, and the HW_VAR_DM_FUNC_CLR comment in
SetHwReg.
No functional change.
Signed-off-by: Marc Finkelbaum <regpacy@gmail.com>
---
drivers/staging/rtl8723bs/hal/hal_com.c | 28 ++++++++++++-------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 07e4da49d757..be8b5e1dbab5 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -466,10 +466,10 @@ void rtw_init_hal_com_default_value(struct adapter *Adapter)
}
/*
-* C2H event format:
-* Field TRIGGER CONTENT CMD_SEQ CMD_LEN CMD_ID
-* BITS [127:120] [119:16] [15:8] [7:4] [3:0]
-*/
+ * C2H event format:
+ * Field TRIGGER CONTENT CMD_SEQ CMD_LEN CMD_ID
+ * BITS [127:120] [119:16] [15:8] [7:4] [3:0]
+ */
void c2h_evt_clear(struct adapter *adapter)
{
@@ -477,10 +477,10 @@ void c2h_evt_clear(struct adapter *adapter)
}
/*
-* C2H event format:
-* Field TRIGGER CMD_LEN CONTENT CMD_SEQ CMD_ID
-* BITS [127:120] [119:112] [111:16] [15:8] [7:0]
-*/
+ * C2H event format:
+ * Field TRIGGER CMD_LEN CONTENT CMD_SEQ CMD_ID
+ * BITS [127:120] [119:112] [111:16] [15:8] [7:0]
+ */
s32 c2h_evt_read_88xx(struct adapter *adapter, u8 *buf)
{
s32 ret = _FAIL;
@@ -514,9 +514,9 @@ s32 c2h_evt_read_88xx(struct adapter *adapter, u8 *buf)
clear_evt:
/*
- * Clear event to notify FW we have read the command.
- * If this field isn't clear, the FW won't update the next command message.
- */
+ * Clear event to notify FW we have read the command.
+ * If this field isn't clear, the FW won't update the next command message.
+ */
c2h_evt_clear(adapter);
exit:
return ret;
@@ -612,9 +612,9 @@ void SetHwReg(struct adapter *adapter, u8 variable, u8 *val)
break;
case HW_VAR_DM_FUNC_CLR:
/*
- * input is already a mask to clear function
- * don't invert it again! George, Lucas@20130513
- */
+ * input is already a mask to clear function
+ * don't invert it again! George, Lucas@20130513
+ */
odm->SupportAbility &= *((u32 *)val);
break;
case HW_VAR_AMPDU_MIN_SPACE:
--
2.53.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 4/9] staging: rtl8723bs: add spaces around binary operators
2026-04-14 9:58 [PATCH 0/9] staging: rtl8723bs: coding style cleanup in hal_com.c Marc Finkelbaum
` (2 preceding siblings ...)
2026-04-14 9:58 ` [PATCH 3/9] staging: rtl8723bs: fix block comment alignment Marc Finkelbaum
@ 2026-04-14 9:58 ` Marc Finkelbaum
2026-04-14 11:58 ` Andy Shevchenko
2026-04-14 9:58 ` [PATCH 5/9] staging: rtl8723bs: add space before inline block comments Marc Finkelbaum
` (5 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Marc Finkelbaum @ 2026-04-14 9:58 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Michael Straube, Dan Carpenter, Ethan Tidmore, Andy Shevchenko,
linux-staging, linux-kernel, Marc Finkelbaum
Add missing spaces around |, &, +, /, and % operators in bitfield OR
expressions (SCR_* flags, BIT* masks), array index arithmetic in
HalSetBrateCfg and rtw_bb_rf_gain_offset, and the register offset
arithmetic in rtw_hal_check_rxfifo_full.
No functional change.
Signed-off-by: Marc Finkelbaum <regpacy@gmail.com>
---
drivers/staging/rtl8723bs/hal/hal_com.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index be8b5e1dbab5..2f76d04aa9d3 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -540,7 +540,7 @@ void rtw_hal_update_sta_rate_mask(struct adapter *padapter, struct sta_info *pst
/* b/g mode ra_bitmap */
for (i = 0; i < sizeof(psta->bssrateset); i++) {
if (psta->bssrateset[i])
- tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value(psta->bssrateset[i]&0x7f);
+ tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value(psta->bssrateset[i] & 0x7f);
}
/* n mode ra_bitmap */
@@ -548,13 +548,13 @@ void rtw_hal_update_sta_rate_mask(struct adapter *padapter, struct sta_info *pst
limit = 8; /* 1R */
for (i = 0; i < limit; i++) {
- if (psta->htpriv.ht_cap.mcs.rx_mask[i/8] & BIT(i%8))
- tx_ra_bitmap |= BIT(i+12);
+ if (psta->htpriv.ht_cap.mcs.rx_mask[i / 8] & BIT(i % 8))
+ tx_ra_bitmap |= BIT(i + 12);
}
}
psta->ra_mask = tx_ra_bitmap;
- psta->init_rate = get_highest_rate_idx(tx_ra_bitmap)&0x3f;
+ psta->init_rate = get_highest_rate_idx(tx_ra_bitmap) & 0x3f;
}
void SetHwReg(struct adapter *adapter, u8 variable, u8 *val)
@@ -571,7 +571,7 @@ void SetHwReg(struct adapter *adapter, u8 variable, u8 *val)
u16 reg_scr;
reg_scr = rtw_read16(adapter, REG_SECCFG);
- rtw_write16(adapter, REG_SECCFG, reg_scr|SCR_CHK_KEYID|SCR_RxDecEnable|SCR_TxEncEnable);
+ rtw_write16(adapter, REG_SECCFG, reg_scr | SCR_CHK_KEYID | SCR_RxDecEnable | SCR_TxEncEnable);
}
break;
case HW_VAR_SEC_DK_CFG:
@@ -582,9 +582,9 @@ void SetHwReg(struct adapter *adapter, u8 variable, u8 *val)
if (val) { /* Enable default key related setting */
reg_scr |= SCR_TXBCUSEDK;
if (sec->dot11AuthAlgrthm != dot11AuthAlgrthm_8021X)
- reg_scr |= (SCR_RxUseDK|SCR_TxUseDK);
+ reg_scr |= (SCR_RxUseDK | SCR_TxUseDK);
} else /* Disable default key related setting */
- reg_scr &= ~(SCR_RXBCUSEDK|SCR_TXBCUSEDK|SCR_RxUseDK|SCR_TxUseDK);
+ reg_scr &= ~(SCR_RXBCUSEDK | SCR_TXBCUSEDK | SCR_RxUseDK | SCR_TxUseDK);
rtw_write8(adapter, REG_SECCFG, reg_scr);
}
@@ -770,7 +770,7 @@ bool GetU1ByteIntegerFromStringInDecimal(char *Str, u8 *pInt)
void rtw_hal_check_rxfifo_full(struct adapter *adapter)
{
/* switch counter to RX fifo */
- rtw_write8(adapter, REG_RXERR_RPT+3, rtw_read8(adapter, REG_RXERR_RPT+3)|0xf0);
+ rtw_write8(adapter, REG_RXERR_RPT + 3, rtw_read8(adapter, REG_RXERR_RPT + 3) | 0xf0);
}
static u32 Array_kfreemap[] = {
@@ -802,13 +802,13 @@ void rtw_bb_rf_gain_offset(struct adapter *padapter)
for (i = 0; i < ARRAY_SIZE(Array_kfreemap); i += 2) {
v1 = Array[i];
- v2 = Array[i+1];
+ v2 = Array[i + 1];
if (v1 == padapter->eeprompriv.EEPROMRFGainVal) {
target = v2;
break;
}
}
- PHY_SetRFReg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, BIT18|BIT17|BIT16|BIT15, target);
+ PHY_SetRFReg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, BIT18 | BIT17 | BIT16 | BIT15, target);
rtw_hal_read_rfreg(padapter, RF_PATH_A, 0x7f, 0xffffffff);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 5/9] staging: rtl8723bs: add space before inline block comments
2026-04-14 9:58 [PATCH 0/9] staging: rtl8723bs: coding style cleanup in hal_com.c Marc Finkelbaum
` (3 preceding siblings ...)
2026-04-14 9:58 ` [PATCH 4/9] staging: rtl8723bs: add spaces around binary operators Marc Finkelbaum
@ 2026-04-14 9:58 ` Marc Finkelbaum
2026-04-14 12:12 ` Andy Shevchenko
2026-04-14 9:58 ` [PATCH 6/9] staging: rtl8723bs: fix Yoda conditions and == false comparisons Marc Finkelbaum
` (4 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Marc Finkelbaum @ 2026-04-14 9:58 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Michael Straube, Dan Carpenter, Ethan Tidmore, Andy Shevchenko,
linux-staging, linux-kernel, Marc Finkelbaum
Add a space between the semicolon and the opening '/*' on all
Queue2Pipe assignment lines in _OneOutPipeMapping, _TwoOutPipeMapping,
and _ThreeOutPipeMapping.
No functional change.
Signed-off-by: Marc Finkelbaum <regpacy@gmail.com>
---
drivers/staging/rtl8723bs/hal/hal_com.c | 80 ++++++++++++-------------
1 file changed, 40 insertions(+), 40 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 2f76d04aa9d3..fcfcdfd079da 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -342,15 +342,15 @@ static void _OneOutPipeMapping(struct adapter *padapter)
{
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
- pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */
- pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];/* VI */
- pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[0];/* BE */
- pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[0];/* BK */
+ pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0]; /* VO */
+ pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0]; /* VI */
+ pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[0]; /* BE */
+ pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[0]; /* BK */
- pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];/* BCN */
- pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */
- pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];/* HIGH */
- pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
+ pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0]; /* BCN */
+ pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0]; /* MGT */
+ pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0]; /* HIGH */
+ pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0]; /* TXCMD */
}
static void _TwoOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
@@ -362,30 +362,30 @@ static void _TwoOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
/* 0, 1, 0, 1, 0, 0, 0, 0, 0 }; */
/* 0:ep_0 num, 1:ep_1 num */
- pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[1];/* VO */
- pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];/* VI */
- pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[1];/* BE */
- pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[0];/* BK */
+ pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[1]; /* VO */
+ pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0]; /* VI */
+ pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[1]; /* BE */
+ pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[0]; /* BK */
- pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];/* BCN */
- pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */
- pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];/* HIGH */
- pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
+ pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0]; /* BCN */
+ pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0]; /* MGT */
+ pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0]; /* HIGH */
+ pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0]; /* TXCMD */
} else { /* typical setting */
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
/* 1, 1, 0, 0, 0, 0, 0, 0, 0 }; */
/* 0:ep_0 num, 1:ep_1 num */
- pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */
- pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];/* VI */
- pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[1];/* BE */
- pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[1];/* BK */
+ pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0]; /* VO */
+ pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0]; /* VI */
+ pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[1]; /* BE */
+ pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[1]; /* BK */
- pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];/* BCN */
- pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */
- pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];/* HIGH */
- pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
+ pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0]; /* BCN */
+ pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0]; /* MGT */
+ pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0]; /* HIGH */
+ pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0]; /* TXCMD */
}
}
@@ -399,30 +399,30 @@ static void _ThreeOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
/* 1, 2, 1, 0, 0, 0, 0, 0, 0 }; */
/* 0:H, 1:N, 2:L */
- pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */
- pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1];/* VI */
- pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2];/* BE */
- pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[1];/* BK */
+ pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0]; /* VO */
+ pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1]; /* VI */
+ pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2]; /* BE */
+ pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[1]; /* BK */
- pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];/* BCN */
- pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */
- pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];/* HIGH */
- pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
+ pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0]; /* BCN */
+ pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0]; /* MGT */
+ pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0]; /* HIGH */
+ pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0]; /* TXCMD */
} else { /* typical setting */
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
/* 2, 2, 1, 0, 0, 0, 0, 0, 0 }; */
/* 0:H, 1:N, 2:L */
- pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */
- pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1];/* VI */
- pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2];/* BE */
- pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[2];/* BK */
+ pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0]; /* VO */
+ pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1]; /* VI */
+ pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2]; /* BE */
+ pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[2]; /* BK */
- pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];/* BCN */
- pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */
- pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];/* HIGH */
- pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
+ pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0]; /* BCN */
+ pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0]; /* MGT */
+ pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0]; /* HIGH */
+ pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0]; /* TXCMD */
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 6/9] staging: rtl8723bs: fix Yoda conditions and == false comparisons
2026-04-14 9:58 [PATCH 0/9] staging: rtl8723bs: coding style cleanup in hal_com.c Marc Finkelbaum
` (4 preceding siblings ...)
2026-04-14 9:58 ` [PATCH 5/9] staging: rtl8723bs: add space before inline block comments Marc Finkelbaum
@ 2026-04-14 9:58 ` Marc Finkelbaum
2026-04-14 12:21 ` Andy Shevchenko
2026-04-14 9:58 ` [PATCH 7/9] staging: rtl8723bs: reformat multi-line function signatures Marc Finkelbaum
` (3 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Marc Finkelbaum @ 2026-04-14 9:58 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Michael Straube, Dan Carpenter, Ethan Tidmore, Andy Shevchenko,
linux-staging, linux-kernel, Marc Finkelbaum
Replace reversed comparisons with natural-order equivalents:
- '0xFF == hw_channel_plan' -> 'hw_channel_plan == 0xFF'
- 'false == pHalData->bDisableSWChannelPlan' -> '!pHalData->...'
- 'is_supported_24g(...) == false' -> '!is_supported_24g(...)'
The multi-line if condition around bDisableSWChannelPlan is also
reformatted to standard kernel one-line style.
No functional change.
Signed-off-by: Marc Finkelbaum <regpacy@gmail.com>
---
drivers/staging/rtl8723bs/hal/hal_com.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index fcfcdfd079da..dc5e6a58fd9d 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -105,7 +105,7 @@ u8 hal_com_config_channel_plan(
pHalData->bDisableSWChannelPlan = false;
chnlPlan = def_channel_plan;
- if (0xFF == hw_channel_plan)
+ if (hw_channel_plan == 0xFF)
AutoLoadFail = true;
if (!AutoLoadFail) {
@@ -120,10 +120,8 @@ u8 hal_com_config_channel_plan(
}
}
- if (
- (false == pHalData->bDisableSWChannelPlan) &&
- rtw_is_channel_plan_valid(sw_channel_plan)
- )
+ if ((!pHalData->bDisableSWChannelPlan) &&
+ rtw_is_channel_plan_valid(sw_channel_plan))
chnlPlan = sw_channel_plan;
return chnlPlan;
@@ -134,7 +132,7 @@ bool HAL_IsLegalChannel(struct adapter *adapter, u32 Channel)
bool bLegalChannel = true;
if ((Channel <= 14) && (Channel >= 1)) {
- if (is_supported_24g(adapter->registrypriv.wireless_mode) == false)
+ if (!is_supported_24g(adapter->registrypriv.wireless_mode))
bLegalChannel = false;
} else {
bLegalChannel = false;
--
2.53.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 7/9] staging: rtl8723bs: reformat multi-line function signatures
2026-04-14 9:58 [PATCH 0/9] staging: rtl8723bs: coding style cleanup in hal_com.c Marc Finkelbaum
` (5 preceding siblings ...)
2026-04-14 9:58 ` [PATCH 6/9] staging: rtl8723bs: fix Yoda conditions and == false comparisons Marc Finkelbaum
@ 2026-04-14 9:58 ` Marc Finkelbaum
2026-04-14 9:58 ` [PATCH 8/9] staging: rtl8723bs: reformat switch-case blocks with braced bodies Marc Finkelbaum
` (2 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Marc Finkelbaum @ 2026-04-14 9:58 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Michael Straube, Dan Carpenter, Ethan Tidmore, Andy Shevchenko,
linux-staging, linux-kernel, Marc Finkelbaum
Convert one-parameter-per-line function signatures to standard kernel
style with parameters aligned to the opening parenthesis and wrapped at
80 columns. Affected functions: hal_com_config_channel_plan,
GetHalDefVar, SetHalODMVar, and rtw_hal_update_sta_rate_mask.
No functional change.
Signed-off-by: Marc Finkelbaum <regpacy@gmail.com>
---
drivers/staging/rtl8723bs/hal/hal_com.c | 26 +++++++++----------------
1 file changed, 9 insertions(+), 17 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index dc5e6a58fd9d..44bef1400947 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -90,13 +90,9 @@ void dump_chip_info(struct hal_version ChipVersion)
*Final channel plan decision
*
*/
-u8 hal_com_config_channel_plan(
- struct adapter *padapter,
- u8 hw_channel_plan,
- u8 sw_channel_plan,
- u8 def_channel_plan,
- bool AutoLoadFail
-)
+u8 hal_com_config_channel_plan(struct adapter *padapter, u8 hw_channel_plan,
+ u8 sw_channel_plan, u8 def_channel_plan,
+ bool AutoLoadFail)
{
struct hal_com_data *pHalData;
u8 chnlPlan;
@@ -525,7 +521,8 @@ u8 rtw_get_mgntframe_raid(struct adapter *adapter, unsigned char network_type)
return (network_type & WIRELESS_11B) ? RATEID_IDX_B : RATEID_IDX_G;
}
-void rtw_hal_update_sta_rate_mask(struct adapter *padapter, struct sta_info *psta)
+void rtw_hal_update_sta_rate_mask(struct adapter *padapter,
+ struct sta_info *psta)
{
u8 i, limit;
u32 tx_ra_bitmap;
@@ -649,9 +646,8 @@ void GetHwReg(struct adapter *adapter, u8 variable, u8 *val)
}
}
-u8 GetHalDefVar(
- struct adapter *adapter, enum hal_def_variable variable, void *value
-)
+u8 GetHalDefVar(struct adapter *adapter, enum hal_def_variable variable,
+ void *value)
{
struct hal_com_data *hal_data = GET_HAL_DATA(adapter);
u8 bResult = _SUCCESS;
@@ -699,12 +695,8 @@ u8 GetHalDefVar(
return bResult;
}
-void SetHalODMVar(
- struct adapter *Adapter,
- enum hal_odm_variable eVariable,
- void *pValue1,
- bool bSet
-)
+void SetHalODMVar(struct adapter *Adapter, enum hal_odm_variable eVariable,
+ void *pValue1, bool bSet)
{
struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
struct dm_odm_t *podmpriv = &pHalData->odmpriv;
--
2.53.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 8/9] staging: rtl8723bs: reformat switch-case blocks with braced bodies
2026-04-14 9:58 [PATCH 0/9] staging: rtl8723bs: coding style cleanup in hal_com.c Marc Finkelbaum
` (6 preceding siblings ...)
2026-04-14 9:58 ` [PATCH 7/9] staging: rtl8723bs: reformat multi-line function signatures Marc Finkelbaum
@ 2026-04-14 9:58 ` Marc Finkelbaum
2026-04-14 9:58 ` [PATCH 9/9] staging: rtl8723bs: wrap long lines and fix argument alignment Marc Finkelbaum
2026-04-14 16:08 ` [PATCH 0/9] staging: rtl8723bs: coding style cleanup in hal_com.c regpac youtube
9 siblings, 0 replies; 19+ messages in thread
From: Marc Finkelbaum @ 2026-04-14 9:58 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Michael Straube, Dan Carpenter, Ethan Tidmore, Andy Shevchenko,
linux-staging, linux-kernel, Marc Finkelbaum
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
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 9/9] staging: rtl8723bs: wrap long lines and fix argument alignment
2026-04-14 9:58 [PATCH 0/9] staging: rtl8723bs: coding style cleanup in hal_com.c Marc Finkelbaum
` (7 preceding siblings ...)
2026-04-14 9:58 ` [PATCH 8/9] staging: rtl8723bs: reformat switch-case blocks with braced bodies Marc Finkelbaum
@ 2026-04-14 9:58 ` Marc Finkelbaum
2026-04-14 12:31 ` Andy Shevchenko
2026-04-14 16:08 ` [PATCH 0/9] staging: rtl8723bs: coding style cleanup in hal_com.c regpac youtube
9 siblings, 1 reply; 19+ messages in thread
From: Marc Finkelbaum @ 2026-04-14 9:58 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Michael Straube, Dan Carpenter, Ethan Tidmore, Andy Shevchenko,
linux-staging, linux-kernel, Marc Finkelbaum
Break lines that exceed 80 columns and align continuation arguments to
the opening parenthesis. Affected sites: scnprintf calls in
dump_chip_info, hw_chnlPlan assignment, Queue2Pipe[7] assignments in
the pipe-mapping functions, rtw_hal_set_hwreg in hal_init_macaddr,
c2h_evt payload read loop, rtw_write16/rtw_write8 in SetHwReg and
rtw_hal_check_rxfifo_full, rtw_get_stainfo and the UndecoratedSmoothedPWDB
assignment in GetHalDefVar, ODM_CmnInfoPtrArrayHook calls in SetHalODMVar,
and rtw_hal_read_rfreg/PHY_SetRFReg in rtw_bb_rf_gain_offset.
No functional change.
Signed-off-by: Marc Finkelbaum <regpacy@gmail.com>
---
drivers/staging/rtl8723bs/hal/hal_com.c | 71 +++++++++++++++++--------
1 file changed, 48 insertions(+), 23 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 2688355f9265..0e3b5831d974 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -35,8 +35,10 @@ void dump_chip_info(struct hal_version ChipVersion)
char buf[128];
size_t cnt = 0;
- cnt += scnprintf(buf + cnt, sizeof(buf) - cnt, "Chip Version Info: CHIP_8723B_%s_",
- IS_NORMAL_CHIP(ChipVersion) ? "Normal_Chip" : "Test_Chip");
+ cnt += scnprintf(buf + cnt, sizeof(buf) - cnt,
+ "Chip Version Info: CHIP_8723B_%s_",
+ IS_NORMAL_CHIP(ChipVersion) ? "Normal_Chip" :
+ "Test_Chip");
if (IS_CHIP_VENDOR_TSMC(ChipVersion))
cnt += scnprintf(buf + cnt, sizeof(buf) - cnt, "TSMC_");
@@ -63,11 +65,12 @@ void dump_chip_info(struct hal_version ChipVersion)
cnt += scnprintf(buf + cnt, sizeof(buf) - cnt, "K_CUT_");
else
cnt += scnprintf(buf + cnt, sizeof(buf) - cnt,
- "UNKNOWN_CUT(%d)_", ChipVersion.CUTVersion);
+ "UNKNOWN_CUT(%d)_", ChipVersion.CUTVersion);
cnt += scnprintf(buf + cnt, sizeof(buf) - cnt, "1T1R_");
- cnt += scnprintf(buf + cnt, sizeof(buf) - cnt, "RomVer(%d)\n", ChipVersion.ROMVer);
+ cnt += scnprintf(buf + cnt, sizeof(buf) - cnt, "RomVer(%d)\n",
+ ChipVersion.ROMVer);
}
#define EEPROM_CHANNEL_PLAN_BY_HW_MASK 0x80
@@ -107,7 +110,8 @@ u8 hal_com_config_channel_plan(struct adapter *padapter, u8 hw_channel_plan,
if (!AutoLoadFail) {
u8 hw_chnlPlan;
- hw_chnlPlan = hw_channel_plan & (~EEPROM_CHANNEL_PLAN_BY_HW_MASK);
+ hw_chnlPlan = hw_channel_plan &
+ (~EEPROM_CHANNEL_PLAN_BY_HW_MASK);
if (rtw_is_channel_plan_valid(hw_chnlPlan)) {
if (hw_channel_plan & EEPROM_CHANNEL_PLAN_BY_HW_MASK)
pHalData->bDisableSWChannelPlan = true;
@@ -364,9 +368,11 @@ static void _TwoOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0]; /* BCN */
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0]; /* MGT */
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0]; /* HIGH */
- pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0]; /* TXCMD */
+ pdvobjpriv->Queue2Pipe[7] =
+ pdvobjpriv->RtOutPipe[0]; /* TXCMD */
} else { /* typical setting */
+
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
/* 1, 1, 0, 0, 0, 0, 0, 0, 0 }; */
/* 0:ep_0 num, 1:ep_1 num */
@@ -379,8 +385,8 @@ static void _TwoOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0]; /* BCN */
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0]; /* MGT */
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0]; /* HIGH */
- pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0]; /* TXCMD */
-
+ pdvobjpriv->Queue2Pipe[7] =
+ pdvobjpriv->RtOutPipe[0]; /* TXCMD */
}
}
@@ -401,9 +407,11 @@ static void _ThreeOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0]; /* BCN */
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0]; /* MGT */
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0]; /* HIGH */
- pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0]; /* TXCMD */
+ pdvobjpriv->Queue2Pipe[7] =
+ pdvobjpriv->RtOutPipe[0]; /* TXCMD */
} else { /* typical setting */
+
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
/* 2, 2, 1, 0, 0, 0, 0, 0, 0 }; */
/* 0:H, 1:N, 2:L */
@@ -416,7 +424,8 @@ static void _ThreeOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0]; /* BCN */
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0]; /* MGT */
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0]; /* HIGH */
- pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0]; /* TXCMD */
+ pdvobjpriv->Queue2Pipe[7] =
+ pdvobjpriv->RtOutPipe[0]; /* TXCMD */
}
}
@@ -449,7 +458,8 @@ bool Hal_MappingOutPipe(struct adapter *padapter, u8 NumOutPipe)
void hal_init_macaddr(struct adapter *adapter)
{
- rtw_hal_set_hwreg(adapter, HW_VAR_MAC_ADDR, adapter->eeprompriv.mac_addr);
+ rtw_hal_set_hwreg(adapter, HW_VAR_MAC_ADDR,
+ adapter->eeprompriv.mac_addr);
}
void rtw_init_hal_com_default_value(struct adapter *Adapter)
@@ -502,7 +512,8 @@ s32 c2h_evt_read_88xx(struct adapter *adapter, u8 *buf)
/* Read the content */
for (i = 0; i < c2h_evt->plen; i++)
- c2h_evt->payload[i] = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + 2 + i);
+ c2h_evt->payload[i] =
+ rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + 2 + i);
ret = _SUCCESS;
@@ -565,7 +576,9 @@ void SetHwReg(struct adapter *adapter, u8 variable, u8 *val)
u16 reg_scr;
reg_scr = rtw_read16(adapter, REG_SECCFG);
- rtw_write16(adapter, REG_SECCFG, reg_scr | SCR_CHK_KEYID | SCR_RxDecEnable | SCR_TxEncEnable);
+ rtw_write16(adapter, REG_SECCFG,
+ reg_scr | SCR_CHK_KEYID | SCR_RxDecEnable |
+ SCR_TxEncEnable);
} break;
case HW_VAR_SEC_DK_CFG: {
struct security_priv *sec = &adapter->securitypriv;
@@ -576,7 +589,8 @@ void SetHwReg(struct adapter *adapter, u8 variable, u8 *val)
if (sec->dot11AuthAlgrthm != dot11AuthAlgrthm_8021X)
reg_scr |= (SCR_RxUseDK | SCR_TxUseDK);
} else { /* Disable default key related setting */
- reg_scr &= ~(SCR_RXBCUSEDK | SCR_TXBCUSEDK | SCR_RxUseDK | SCR_TxUseDK);
+ reg_scr &= ~(SCR_RXBCUSEDK | SCR_TXBCUSEDK |
+ SCR_RxUseDK | SCR_TxUseDK);
}
rtw_write8(adapter, REG_SECCFG, reg_scr);
@@ -657,9 +671,11 @@ u8 GetHalDefVar(struct adapter *adapter, enum hal_def_variable variable,
pmlmepriv = &adapter->mlmepriv;
pstapriv = &adapter->stapriv;
- psta = rtw_get_stainfo(pstapriv, pmlmepriv->cur_network.network.mac_address);
+ psta = rtw_get_stainfo(pstapriv,
+ pmlmepriv->cur_network.network.mac_address);
if (psta)
- *((int *)value) = psta->rssi_stat.UndecoratedSmoothedPWDB;
+ *((int *)value) =
+ psta->rssi_stat.UndecoratedSmoothedPWDB;
} break;
case HAL_DEF_DBG_DM_FUNC:
*((u32 *)value) = hal_data->odmpriv.SupportAbility;
@@ -701,10 +717,14 @@ void SetHalODMVar(struct adapter *Adapter, enum hal_odm_variable eVariable,
struct sta_info *psta = pValue1;
if (bSet) {
- ODM_CmnInfoPtrArrayHook(podmpriv, ODM_CMNINFO_STA_STATUS, psta->mac_id, psta);
+ 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);
+ ODM_CmnInfoPtrArrayHook(podmpriv,
+ ODM_CMNINFO_STA_STATUS,
+ psta->mac_id, NULL);
/* spin_unlock_bh(&pHalData->odm_stainfo_lock); */
}
@@ -754,7 +774,8 @@ bool GetU1ByteIntegerFromStringInDecimal(char *Str, u8 *pInt)
void rtw_hal_check_rxfifo_full(struct adapter *adapter)
{
/* switch counter to RX fifo */
- rtw_write8(adapter, REG_RXERR_RPT + 3, rtw_read8(adapter, REG_RXERR_RPT + 3) | 0xf0);
+ rtw_write8(adapter, REG_RXERR_RPT + 3,
+ rtw_read8(adapter, REG_RXERR_RPT + 3) | 0xf0);
}
static u32 Array_kfreemap[] = {
@@ -782,19 +803,23 @@ void rtw_bb_rf_gain_offset(struct adapter *padapter)
if (value & BIT4) {
if (padapter->eeprompriv.EEPROMRFGainVal != 0xff) {
- rtw_hal_read_rfreg(padapter, RF_PATH_A, 0x7f, 0xffffffff);
+ rtw_hal_read_rfreg(padapter, RF_PATH_A, 0x7f,
+ 0xffffffff);
for (i = 0; i < ARRAY_SIZE(Array_kfreemap); i += 2) {
v1 = Array[i];
v2 = Array[i + 1];
- if (v1 == padapter->eeprompriv.EEPROMRFGainVal) {
+ if (v1 ==
+ padapter->eeprompriv.EEPROMRFGainVal) {
target = v2;
break;
}
}
- PHY_SetRFReg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, BIT18 | BIT17 | BIT16 | BIT15, target);
+ PHY_SetRFReg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET,
+ BIT18 | BIT17 | BIT16 | BIT15, target);
- rtw_hal_read_rfreg(padapter, RF_PATH_A, 0x7f, 0xffffffff);
+ rtw_hal_read_rfreg(padapter, RF_PATH_A, 0x7f,
+ 0xffffffff);
}
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 1/9] staging: rtl8723bs: remove extra blank lines
2026-04-14 9:58 ` [PATCH 1/9] staging: rtl8723bs: remove extra blank lines Marc Finkelbaum
@ 2026-04-14 11:45 ` Andy Shevchenko
0 siblings, 0 replies; 19+ messages in thread
From: Andy Shevchenko @ 2026-04-14 11:45 UTC (permalink / raw)
To: Marc Finkelbaum
Cc: Greg Kroah-Hartman, Michael Straube, Dan Carpenter, Ethan Tidmore,
linux-staging, linux-kernel
On Tue, Apr 14, 2026 at 12:58:25PM +0300, Marc Finkelbaum wrote:
> Remove double blank lines between function definitions and between a
> function end and the following macro definition. Also remove spurious
> blank lines at the start of an if/else body and trailing blank lines
> before a closing brace in _TwoOutPipeMapping, _ThreeOutPipeMapping,
> Hal_MappingOutPipe, and the HalSetBrateCfg rate loop.
>
> No functional change.
...
> @@ -394,7 +388,6 @@ static void _TwoOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
> pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
>
Haven't you missed to remove this one as well? Or even more if there are other
similar cases...
> }
> -
> }
>
> static void _ThreeOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 2/9] staging: rtl8723bs: fix space-before-tab whitespace
2026-04-14 9:58 ` [PATCH 2/9] staging: rtl8723bs: fix space-before-tab whitespace Marc Finkelbaum
@ 2026-04-14 11:48 ` Andy Shevchenko
0 siblings, 0 replies; 19+ messages in thread
From: Andy Shevchenko @ 2026-04-14 11:48 UTC (permalink / raw)
To: Marc Finkelbaum
Cc: Greg Kroah-Hartman, Michael Straube, Dan Carpenter, Ethan Tidmore,
linux-staging, linux-kernel
On Tue, Apr 14, 2026 at 12:58:26PM +0300, Marc Finkelbaum wrote:
> Replace tab characters with a single space in macro definitions
> (EEPROM_CHANNEL_PLAN_BY_HW_MASK, REG_RF_BB_GAIN_OFFSET), the
> dump_chip_info parameter list, the pHalData pointer declaration in
> SetHalODMVar, and the BK/BE/VI/VO tabular comments inside
> _TwoOutPipeMapping and _ThreeOutPipeMapping.
>
> No functional change.
...
> -#define EEPROM_CHANNEL_PLAN_BY_HW_MASK 0x80
> +#define EEPROM_CHANNEL_PLAN_BY_HW_MASK 0x80
Please, leave tab indentation of the value (between K and 0).
...
> -#define REG_RF_BB_GAIN_OFFSET 0x7f
> +#define REG_RF_BB_GAIN_OFFSET 0x7f
Ditto.
> //#define RF_GAIN_OFFSET_MASK 0xfffff
This (and these in general) has to be fixed accordingly as it's clearly not an
example of the code in the comment, but a real code that got commented out for
some reason. For the latter the style should be adjusted accordingly.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 3/9] staging: rtl8723bs: fix block comment alignment
2026-04-14 9:58 ` [PATCH 3/9] staging: rtl8723bs: fix block comment alignment Marc Finkelbaum
@ 2026-04-14 11:51 ` Andy Shevchenko
0 siblings, 0 replies; 19+ messages in thread
From: Andy Shevchenko @ 2026-04-14 11:51 UTC (permalink / raw)
To: Marc Finkelbaum
Cc: Greg Kroah-Hartman, Michael Straube, Dan Carpenter, Ethan Tidmore,
linux-staging, linux-kernel
On Tue, Apr 14, 2026 at 12:58:27PM +0300, Marc Finkelbaum wrote:
> Add the required space after the opening '/*' on continuation lines in
> four block comments: the two C2H event format header tables, the
> clear_evt inline comment, and the HW_VAR_DM_FUNC_CLR comment in
> SetHwReg.
>
> No functional change.
...
> /*
> -* C2H event format:
> -* Field TRIGGER CONTENT CMD_SEQ CMD_LEN CMD_ID
> -* BITS [127:120] [119:16] [15:8] [7:4] [3:0]
> -*/
> + * C2H event format:
> + * Field TRIGGER CONTENT CMD_SEQ CMD_LEN CMD_ID
> + * BITS [127:120] [119:16] [15:8] [7:4] [3:0]
> + */
These tables (here and below) are formatted with mixing tab and spaces...
You need to fix that properly to use either tab-based or space-based one,
not the mixed (current) one.
...
> /*
> - * input is already a mask to clear function
> - * don't invert it again! George, Lucas@20130513
> - */
> + * input is already a mask to clear function
> + * don't invert it again! George, Lucas@20130513
> + */
While at it, fix also English grammar and punctuation.
/*
* Input is already a mask to clear function,
* don't invert it again! George, Lucas@20130513
*/
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 4/9] staging: rtl8723bs: add spaces around binary operators
2026-04-14 9:58 ` [PATCH 4/9] staging: rtl8723bs: add spaces around binary operators Marc Finkelbaum
@ 2026-04-14 11:58 ` Andy Shevchenko
0 siblings, 0 replies; 19+ messages in thread
From: Andy Shevchenko @ 2026-04-14 11:58 UTC (permalink / raw)
To: Marc Finkelbaum
Cc: Greg Kroah-Hartman, Michael Straube, Dan Carpenter, Ethan Tidmore,
linux-staging, linux-kernel
On Tue, Apr 14, 2026 at 12:58:28PM +0300, Marc Finkelbaum wrote:
> Add missing spaces around |, &, +, /, and % operators in bitfield OR
> expressions (SCR_* flags, BIT* masks), array index arithmetic in
> HalSetBrateCfg and rtw_bb_rf_gain_offset, and the register offset
> arithmetic in rtw_hal_check_rxfifo_full.
>
> No functional change.
...
> for (i = 0; i < limit; i++) {
> - if (psta->htpriv.ht_cap.mcs.rx_mask[i/8] & BIT(i%8))
> - tx_ra_bitmap |= BIT(i+12);
> + if (psta->htpriv.ht_cap.mcs.rx_mask[i / 8] & BIT(i % 8))
> + tx_ra_bitmap |= BIT(i + 12);
> }
Looking at this, ideally rx_mask should be unsigned long type (or
DEFINE_BITMAP() if longer than 32-bit) and this loop either using
bitops or something like bitmap_copy(), bitmap_scatter().
It's a side note, in case you want to create a real patch, and not like
this "whitespace cleanup series".
...
> - rtw_write16(adapter, REG_SECCFG, reg_scr|SCR_CHK_KEYID|SCR_RxDecEnable|SCR_TxEncEnable);
> + rtw_write16(adapter, REG_SECCFG, reg_scr | SCR_CHK_KEYID | SCR_RxDecEnable | SCR_TxEncEnable);
This is way too long line, wrap it.
rtw_write16(adapter, REG_SECCFG,
reg_scr | SCR_CHK_KEYID | SCR_RxDecEnable | SCR_TxEncEnable);
...
> + rtw_write8(adapter, REG_RXERR_RPT + 3, rtw_read8(adapter, REG_RXERR_RPT + 3) | 0xf0);
This kind of operations are better when you introduce a helper rtw_update8(). With it it will be
rtw_update8(adapter, REG_RXERR_RPT + 3, <mask>, 0xf0);
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 5/9] staging: rtl8723bs: add space before inline block comments
2026-04-14 9:58 ` [PATCH 5/9] staging: rtl8723bs: add space before inline block comments Marc Finkelbaum
@ 2026-04-14 12:12 ` Andy Shevchenko
0 siblings, 0 replies; 19+ messages in thread
From: Andy Shevchenko @ 2026-04-14 12:12 UTC (permalink / raw)
To: Marc Finkelbaum
Cc: Greg Kroah-Hartman, Michael Straube, Dan Carpenter, Ethan Tidmore,
linux-staging, linux-kernel
On Tue, Apr 14, 2026 at 12:58:29PM +0300, Marc Finkelbaum wrote:
> Add a space between the semicolon and the opening '/*' on all
> Queue2Pipe assignment lines in _OneOutPipeMapping, _TwoOutPipeMapping,
> and _ThreeOutPipeMapping.
>
> No functional change.
...
> + pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0]; /* VO */
> + pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0]; /* VI */
> + pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[0]; /* BE */
> + pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[0]; /* BK */
>
> + pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0]; /* BCN */
> + pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0]; /* MGT */
> + pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0]; /* HIGH */
> + pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0]; /* TXCMD */
I would rather have something like
enum {
RTL8723BS_PIPE_VO,
RTL8723BS_PIPE_VI,
...
};
and replace indices on the left by the enum values and drop comments.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 6/9] staging: rtl8723bs: fix Yoda conditions and == false comparisons
2026-04-14 9:58 ` [PATCH 6/9] staging: rtl8723bs: fix Yoda conditions and == false comparisons Marc Finkelbaum
@ 2026-04-14 12:21 ` Andy Shevchenko
2026-04-14 18:25 ` Luka Gejak
0 siblings, 1 reply; 19+ messages in thread
From: Andy Shevchenko @ 2026-04-14 12:21 UTC (permalink / raw)
To: Marc Finkelbaum
Cc: Greg Kroah-Hartman, Michael Straube, Dan Carpenter, Ethan Tidmore,
linux-staging, linux-kernel
On Tue, Apr 14, 2026 at 12:58:30PM +0300, Marc Finkelbaum wrote:
> Replace reversed comparisons with natural-order equivalents:
> - '0xFF == hw_channel_plan' -> 'hw_channel_plan == 0xFF'
> - 'false == pHalData->bDisableSWChannelPlan' -> '!pHalData->...'
> - 'is_supported_24g(...) == false' -> '!is_supported_24g(...)'
>
> The multi-line if condition around bDisableSWChannelPlan is also
> reformatted to standard kernel one-line style.
>
> No functional change.
...
> - if (
> - (false == pHalData->bDisableSWChannelPlan) &&
> - rtw_is_channel_plan_valid(sw_channel_plan)
> - )
> + if ((!pHalData->bDisableSWChannelPlan) &&
Too many parentheses.
> + rtw_is_channel_plan_valid(sw_channel_plan))
> chnlPlan = sw_channel_plan;
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 9/9] staging: rtl8723bs: wrap long lines and fix argument alignment
2026-04-14 9:58 ` [PATCH 9/9] staging: rtl8723bs: wrap long lines and fix argument alignment Marc Finkelbaum
@ 2026-04-14 12:31 ` Andy Shevchenko
0 siblings, 0 replies; 19+ messages in thread
From: Andy Shevchenko @ 2026-04-14 12:31 UTC (permalink / raw)
To: Marc Finkelbaum
Cc: Greg Kroah-Hartman, Michael Straube, Dan Carpenter, Ethan Tidmore,
linux-staging, linux-kernel
On Tue, Apr 14, 2026 at 12:58:33PM +0300, Marc Finkelbaum wrote:
> Break lines that exceed 80 columns and align continuation arguments to
> the opening parenthesis. Affected sites: scnprintf calls in
> dump_chip_info, hw_chnlPlan assignment, Queue2Pipe[7] assignments in
> the pipe-mapping functions, rtw_hal_set_hwreg in hal_init_macaddr,
> c2h_evt payload read loop, rtw_write16/rtw_write8 in SetHwReg and
> rtw_hal_check_rxfifo_full, rtw_get_stainfo and the UndecoratedSmoothedPWDB
> assignment in GetHalDefVar, ODM_CmnInfoPtrArrayHook calls in SetHalODMVar,
> and rtw_hal_read_rfreg/PHY_SetRFReg in rtw_bb_rf_gain_offset.
>
> No functional change.
"No" to most of the changes here. Use the common sense.
...
> char buf[128];
> size_t cnt = 0;
>
> - cnt += scnprintf(buf + cnt, sizeof(buf) - cnt, "Chip Version Info: CHIP_8723B_%s_",
> - IS_NORMAL_CHIP(ChipVersion) ? "Normal_Chip" : "Test_Chip");
> + cnt += scnprintf(buf + cnt, sizeof(buf) - cnt,
> + "Chip Version Info: CHIP_8723B_%s_",
> + IS_NORMAL_CHIP(ChipVersion) ? "Normal_Chip" :
> + "Test_Chip");
Rather check if this needs to be converted to use sysfs_emit_at().
...
> - hw_chnlPlan = hw_channel_plan & (~EEPROM_CHANNEL_PLAN_BY_HW_MASK);
> + hw_chnlPlan = hw_channel_plan &
> + (~EEPROM_CHANNEL_PLAN_BY_HW_MASK);
Definitely "no". And there are too many parentheses.
hw_chnlPlan = hw_channel_plan & ~EEPROM_CHANNEL_PLAN_BY_HW_MASK;
is exactly 80 characters, btw.
...
> pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0]; /* BCN */
> pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0]; /* MGT */
> pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0]; /* HIGH */
> - pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0]; /* TXCMD */
> + pdvobjpriv->Queue2Pipe[7] =
> + pdvobjpriv->RtOutPipe[0]; /* TXCMD */
"No".
These are well adjusted right now and also you already touched this code
once, do not do ping-pong series (order the changes the way that you don't
change the same line(s) more than once).
...
> } else { /* typical setting */
> +
Huh?!
You have a patch that removed this and other blank lines, what's going on?
...
> if (padapter->eeprompriv.EEPROMRFGainVal != 0xff) {
> - rtw_hal_read_rfreg(padapter, RF_PATH_A, 0x7f, 0xffffffff);
> + rtw_hal_read_rfreg(padapter, RF_PATH_A, 0x7f,
> + 0xffffffff);
83 is okay when it gives better readability (and here is the case).
> for (i = 0; i < ARRAY_SIZE(Array_kfreemap); i += 2) {
> v1 = Array[i];
> v2 = Array[i + 1];
> - if (v1 == padapter->eeprompriv.EEPROMRFGainVal) {
> + if (v1 ==
> + padapter->eeprompriv.EEPROMRFGainVal) {
> target = v2;
> break;
> }
> }
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 0/9] staging: rtl8723bs: coding style cleanup in hal_com.c
2026-04-14 9:58 [PATCH 0/9] staging: rtl8723bs: coding style cleanup in hal_com.c Marc Finkelbaum
` (8 preceding siblings ...)
2026-04-14 9:58 ` [PATCH 9/9] staging: rtl8723bs: wrap long lines and fix argument alignment Marc Finkelbaum
@ 2026-04-14 16:08 ` regpac youtube
9 siblings, 0 replies; 19+ messages in thread
From: regpac youtube @ 2026-04-14 16:08 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Michael Straube, Dan Carpenter, Ethan Tidmore, Andy Shevchenko,
linux-staging, linux-kernel
Please disregard this series. I'll resend a cleaner version addressing
the feedback from Andy. Thanks, Marc
вт, 14 апр. 2026 г. в 12:58, Marc Finkelbaum <regpacy@gmail.com>:
>
> This series cleans up checkpatch --strict warnings in
> drivers/staging/rtl8723bs/hal/hal_com.c. All changes are purely
> cosmetic; the compiled .text section is byte-identical before
> and after the series (verified with objdump -d).
>
> Marc Finkelbaum (9):
> staging: rtl8723bs: remove extra blank lines
> staging: rtl8723bs: fix space-before-tab whitespace
> staging: rtl8723bs: fix block comment alignment
> staging: rtl8723bs: add spaces around binary operators
> staging: rtl8723bs: add space before inline block comments
> staging: rtl8723bs: fix Yoda conditions and == false comparisons
> staging: rtl8723bs: reformat multi-line function signatures
> staging: rtl8723bs: reformat switch-case blocks with braced bodies
> staging: rtl8723bs: wrap long lines and fix argument alignment
>
> drivers/staging/rtl8723bs/hal/hal_com.c | 296 ++++++++++++------------
> 1 file changed, 146 insertions(+), 150 deletions(-)
>
> --
> 2.53.0
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 6/9] staging: rtl8723bs: fix Yoda conditions and == false comparisons
2026-04-14 12:21 ` Andy Shevchenko
@ 2026-04-14 18:25 ` Luka Gejak
0 siblings, 0 replies; 19+ messages in thread
From: Luka Gejak @ 2026-04-14 18:25 UTC (permalink / raw)
To: Andy Shevchenko, Marc Finkelbaum
Cc: Greg Kroah-Hartman, Michael Straube, Dan Carpenter, Ethan Tidmore,
linux-staging, linux-kernel
On Tue Apr 14, 2026 at 2:21 PM CEST, Andy Shevchenko wrote:
> On Tue, Apr 14, 2026 at 12:58:30PM +0300, Marc Finkelbaum wrote:
>> Replace reversed comparisons with natural-order equivalents:
>> - '0xFF == hw_channel_plan' -> 'hw_channel_plan == 0xFF'
>> - 'false == pHalData->bDisableSWChannelPlan' -> '!pHalData->...'
>> - 'is_supported_24g(...) == false' -> '!is_supported_24g(...)'
>>
>> The multi-line if condition around bDisableSWChannelPlan is also
>> reformatted to standard kernel one-line style.
>>
>> No functional change.
>
> ...
>
>> - if (
>> - (false == pHalData->bDisableSWChannelPlan) &&
>> - rtw_is_channel_plan_valid(sw_channel_plan)
>> - )
>> + if ((!pHalData->bDisableSWChannelPlan) &&
>
> Too many parentheses.
Also does too many things at once(reversing yoda style, simplifying
boolean expresions) therefore should be splited to 2 patches addressing
2 different types of cleanups.
Best regards,
Luka Gejak
>
>> + rtw_is_channel_plan_valid(sw_channel_plan))
>> chnlPlan = sw_channel_plan;
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2026-04-14 18:26 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-14 9:58 [PATCH 0/9] staging: rtl8723bs: coding style cleanup in hal_com.c Marc Finkelbaum
2026-04-14 9:58 ` [PATCH 1/9] staging: rtl8723bs: remove extra blank lines Marc Finkelbaum
2026-04-14 11:45 ` Andy Shevchenko
2026-04-14 9:58 ` [PATCH 2/9] staging: rtl8723bs: fix space-before-tab whitespace Marc Finkelbaum
2026-04-14 11:48 ` Andy Shevchenko
2026-04-14 9:58 ` [PATCH 3/9] staging: rtl8723bs: fix block comment alignment Marc Finkelbaum
2026-04-14 11:51 ` Andy Shevchenko
2026-04-14 9:58 ` [PATCH 4/9] staging: rtl8723bs: add spaces around binary operators Marc Finkelbaum
2026-04-14 11:58 ` Andy Shevchenko
2026-04-14 9:58 ` [PATCH 5/9] staging: rtl8723bs: add space before inline block comments Marc Finkelbaum
2026-04-14 12:12 ` Andy Shevchenko
2026-04-14 9:58 ` [PATCH 6/9] staging: rtl8723bs: fix Yoda conditions and == false comparisons Marc Finkelbaum
2026-04-14 12:21 ` Andy Shevchenko
2026-04-14 18:25 ` Luka Gejak
2026-04-14 9:58 ` [PATCH 7/9] staging: rtl8723bs: reformat multi-line function signatures Marc Finkelbaum
2026-04-14 9:58 ` [PATCH 8/9] staging: rtl8723bs: reformat switch-case blocks with braced bodies Marc Finkelbaum
2026-04-14 9:58 ` [PATCH 9/9] staging: rtl8723bs: wrap long lines and fix argument alignment Marc Finkelbaum
2026-04-14 12:31 ` Andy Shevchenko
2026-04-14 16:08 ` [PATCH 0/9] staging: rtl8723bs: coding style cleanup in hal_com.c regpac youtube
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox