Re: [PATCH v2 0/3] staging: rtl8723bs: refactor PHY_ConvertTxPowerLimitToPowerIndex()

From: Greg Kroah-Hartman

Date: Fri Oct 02 2026 - 02:10:42 EST


On Fri, Oct 02, 2026 at 01:07:34AM -0300, Leonardo Martins Martins wrote:
> The function PHY_ConvertTxPowerLimitToPowerIndex() has several style
> problems, such as mixed-case names, deeply nested code, and redundant
> bounds checking.
>
> Patch 1 renames mixed-case variables that are on the same scope as this
> function, struct fields such as TxPwrLimit_2_4G were left as is. Patch 2
> removes redundant parts of the code, and patch 3 solves the nesting
> issue by extracting the inner loop into an auxiliary function like it is
> done in rtw_phy_tx_power_limit_config(), at
> drivers/net/wireless/realtek/rtw88/phy.c
>
> Checkpatch issues a few warnings and checks for deep nesting and long
> lines, but these are solved by the last patch.
>
> Compile tested only.

When doing logic refactoring, testing on the real hardware is best.

thanks,

greg k-h