Re: [PATCH 4/9] staging: rtl8723bs: add spaces around binary operators
From: Andy Shevchenko
Date: Tue Apr 14 2026 - 07:59:03 EST
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