[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aYlygIEu0qvZMUZg@stanley.mountain>
Date: Mon, 9 Feb 2026 08:37:04 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: William Hansen-Baird <william.hansen.baird@...il.com>
Cc: gregkh@...uxfoundation.org, david.laight.linux@...il.com,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] staging: rtl8723bs: replace ternary min comparison
with min()
On Sat, Feb 07, 2026 at 05:01:36PM -0500, William Hansen-Baird wrote:
> 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@...il.com>
> ---
LGTM.
Reviewed-by: Dan Carpenter <dan.carpenter@...aro.org>
regards,
dan carpenter
Powered by blists - more mailing lists