Re: [PATCH v2] staging: rtl8723bs: simplify rtw_spt_band_alloc

From: Dan Carpenter

Date: Tue Jun 23 2026 - 01:22:49 EST


On Mon, Jun 22, 2026 at 07:09:47PM +0300, Serhat Kumral wrote:
> The function only supports NL80211_BAND_2GHZ and falls through to
> exit for any other band. Replace the n_channels and n_bitrates local
> variables with the compile-time constants RTW_2G_CHANNELS_NUM and
> RTW_G_RATES_NUM directly.
>
> Use simple addition in kzalloc() instead of chained size_add() calls,
> since the sizes are derived from compile-time constants and cannot
> overflow. Replace the intermediate alloc_sz variable accordingly.
>
> Remove the redundant second band check before the init calls, as
> the early exit at the top of the function guarantees that only the
> 2GHz case can reach that point.
>
> No functional change intended.
>
> Suggested-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
>
> Signed-off-by: Serhat Kumral <serhatkumral1@xxxxxxxxx>
> ---

Thanks!

Reviewed-by: Dan Carpenter <error27@xxxxxxxxx>

regards,
dan carpenter