mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-15 19:56:03 +00:00
staging: rtl8723bs: replace ternary min comparison with min()
Change type of local variable wpa_ie_len from int to u8. wpa_ie_len gets its value either from elems->wpa_ie_len or elems->rsn_ie_len which are both u8, and thus there's no reason to cast them to int. This allows rewriting ternary min comparison using the min() function from linux/minmax.h as now both sides are unsigned. Rewrite as well wpa_ie_len + 2 to wpa_ie_len + 2u, to keep the expression unsigned and avoid overflows. Signed-off-by: William Hansen-Baird <william.hansen.baird@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/20260207220136.67923-1-william.hansen.baird@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c18828f2f8
commit
cd35895500
1 changed files with 4 additions and 2 deletions
Loading…
Add table
Add a link
Reference in a new issue