From: Dan Carpenter <dan.carpenter@linaro.org>
To: William Hansen-Baird <william.hansen.baird@gmail.com>
Cc: gregkh@linuxfoundation.org, david.laight.linux@gmail.com,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] staging: rtl8723bs: replace ternary min comparison with min()
Date: Mon, 9 Feb 2026 08:37:04 +0300 [thread overview]
Message-ID: <aYlygIEu0qvZMUZg@stanley.mountain> (raw)
In-Reply-To: <20260207220136.67923-1-william.hansen.baird@gmail.com>
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@gmail.com>
> ---
LGTM.
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
regards,
dan carpenter
prev parent reply other threads:[~2026-02-09 7:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-07 22:01 [PATCH v4] staging: rtl8723bs: replace ternary min comparison with min() William Hansen-Baird
2026-02-09 5:37 ` Dan Carpenter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aYlygIEu0qvZMUZg@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=david.laight.linux@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=william.hansen.baird@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox