Re: [PATCH v2 2/4] staging: rtl8723bs: Fix comparison style in IS_CCK_RATE and IS_OFDM_RATE macros
From: Greg KH
Date: Mon May 11 2026 - 04:33:37 EST
On Sun, May 10, 2026 at 01:52:05PM -0400, Pramod Maurya wrote:
> Place the variable on the left side of comparisons, wrap macro
> arguments in parentheses to avoid precedence issues, and wrap the
> long macro definitions with a line continuation.
>
> Signed-off-by: Pramod Maurya <pramod.nexgen@xxxxxxxxx>
> ---
> drivers/staging/rtl8723bs/include/ieee80211.h | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
> index 7a3609d019aa..11825ace95a9 100644
> --- a/drivers/staging/rtl8723bs/include/ieee80211.h
> +++ b/drivers/staging/rtl8723bs/include/ieee80211.h
> @@ -394,8 +394,10 @@ enum {
> };
>
> #define IS_HT_RATE(_rate) (_rate >= MGN_MCS0 && _rate <= MGN_MCS31)
> -#define IS_CCK_RATE(_rate) (MGN_1M == _rate || _rate == MGN_2M || _rate == MGN_5_5M || _rate == MGN_11M)
> -#define IS_OFDM_RATE(_rate) (MGN_6M <= _rate && _rate <= MGN_54M && _rate != MGN_11M)
> +#define IS_CCK_RATE(_rate) \
> + ((_rate) == MGN_1M || (_rate) == MGN_2M || (_rate) == MGN_5_5M || (_rate) == MGN_11M)
> +#define IS_OFDM_RATE(_rate) \
> + ((_rate) >= MGN_6M && (_rate) <= MGN_54M && (_rate) != MGN_11M)
This is now harder to read, why not just reduce the number of tabs for
all of these #defines? ANd are you sure the () change is needed?
thanks,
greg k-h