Re: [PATCH] staging: rtl8723bs: replace magic numbers with named constants
From: Dan Carpenter
Date: Thu Jun 04 2026 - 10:49:23 EST
On Wed, Jun 03, 2026 at 03:31:27PM +0100, Jad Keskes wrote:
> Remove the magic numbers in rtl8723b_InitBeaconParameters() as requested
> by the outstanding TODO comment. Replace 0x6404 and 0x660F with named
> constants defined in rtl8723b_hal.h alongside the existing beacon timing
> constants.
>
> Signed-off-by: Jad Keskes <inasj268@xxxxxxxxx>
Just having the same define but as a goto doesn't add any information
or value.
This is actually the third attempt to do this. The first two were AI
patches. On the first time, I asked how the author came up with the
definition and the had the AI generate a halucinated fake spec. On the
second patch, the AI found the first fake spec and assumed it was
correct. :P
Your patch at least doesn't try to pass off any wrong information so
that's good.
I was able to find this explanation from an out of tree driver.
https://gitlab.elettra.eu/intel_socfpga/linux-socfpga/-/blob/socfpga-5.15.60-lts/drivers/net/wireless/realtek/rtw88/rtw8822b.c?ref_type=heads
#define WLAN_TBTT_PROHIBIT 0x04 /* unit : 32us */
#define WLAN_TBTT_HOLD_TIME 0x064 /* unit : 32us */
But it's weird that the comment here says ms. I don't know what
is correct. That driver doesn't have any explanation for the 0x660f
value.
regards,
dan carpenter