mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
staging: rtl8723bs: simplify rtw_spt_band_alloc
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@linaro.org> Signed-off-by: Serhat Kumral <serhatkumral1@gmail.com> Reviewed-by: Dan Carpenter <error27@gmail.com> Link: https://patch.msgid.link/20260622160947.7970-1-serhatkumral1@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f1bd1bc61d
commit
f35a327e90
1 changed files with 12 additions and 19 deletions
Loading…
Add table
Add a link
Reference in a new issue