Re: [PATCH 00/61] staging: rtl8723bs: monolithic HAL cleanup and tx power limit fix

From: Greg Kroah-Hartman

Date: Wed Jul 15 2026 - 09:07:48 EST


On Wed, Jul 15, 2026 at 07:47:28PM +0700, Arsenii Pashchenko wrote:
> Hello,
>
> This patch series performs a massive, systematic cleanup of the legacy
> vendor HAL layer and redundant abstraction wrappers in the rtl8723bs
> driver, concluding with a functional fix for the TX power limit lookup.
>
> The primary goal of this refactoring is to drastically improve the
> readability and maintainability of the codebase, transforming the
> highly tangled, Windows-legacy Realtek abstractions into a cleaner,
> more idiomatic Linux driver structure.
>
> KEY CHANGES IN THIS SERIES:
>
> 1. Dead Code & Stub Removal: Eliminated several unimplemented functions,
> empty stubs (like OnAtim, DoReserved), duplicate prototypes, and
> completely unused helpers (NULL_hdl, set_csa_hdl, tdls_hdl).
> 2. Wrapper Collapse & Inlining: Removed multiple layers of superficial
> wrappers around core operations (e.g., rtw_ap_set_group_key,
> issue_deauth, issue_probereq, rtw_free_mlme_priv, etc.). High-frequency
> or single-use HAL entry points (like SetHwReg8723BS, GetHwReg8723BS,
> and xmit helpers) have been carefully inlined directly into their
> respective dispatchers to enhance readability.
> 3. Scope & Warning Fixes: Restructured local functions (like
> lps_ctrl_wk_hdl) by marking them static and aligning headers, which
> resolves missing-prototypes compiler warnings.
> 4. Logical Fixes: In the final patch, a critical copy-paste bug in
> phy_get_tx_pwr_lmt() was resolved. The computed channel index from
> phy_GetChannelIndexOfTxPowerLimit() was mistakenly assigned back to
> the 'channel' parameter and discarded, leaving 'idx_channel' at -1.
> This caused the function to always fail validation and return
> MAX_POWER_INDEX. Correcting this restores the intended hardware tx
> power limit logic and resolves a compiler warning.
> 5. Refined Abstractions: In places where removing a wrapper would
> decrease overall elegance or require awkward type workarounds, the
> cleanest architectural approach was intentionally preserved.
>
> TESTING & VERIFICATION:
>
> - Hardware: I do not possess the physical rtl8723bs hardware, so
> real-world runtime wireless testing was not performed.
> - Compilation: The entire series compiles flawlessly against the
> latest tree.
> - Code Style: All 61 patches have been fully validated with
> `scripts/checkpatch.pl` and return 0 errors / 0 warnings per patch.
> (Note: A few pre-existing vendor style warnings remain in the modified
> files, but no new ones were introduced).
>
> This cleanup significantly reduces the boilerplate footprint, making
> future maintenance and eventual mac80211 migration tasks much more
> approachable.

How did you do all of these? Without testing I am loath to take such
large changes, right? Did you use a llm?

thanks,

greg k-h