From: Thorsten Blum <thorsten.blum@toblux.com>
To: Marco Elver <elver@google.com>
Cc: dvyukov@google.com, kasan-dev@googlegroups.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kcsan: Use min() to fix Coccinelle warning
Date: Mon, 24 Jun 2024 01:00:15 -0700 [thread overview]
Message-ID: <A820FF35-B5A3-410A-BAF3-0446938CD951@toblux.com> (raw)
In-Reply-To: <CANpmjNMHPt7UvcZBDf-rbxP=Jm4+Ews+oYeT4b2D_nxWoN9a+g@mail.gmail.com>
On 24. Jun 2024, at 00:02, Marco Elver <elver@google.com> wrote:
> On Mon, 24 Jun 2024 at 00:08, Thorsten Blum <thorsten.blum@toblux.com> wrote:
>>
>> Fixes the following Coccinelle/coccicheck warning reported by
>> minmax.cocci:
>>
>> WARNING opportunity for min()
>>
>> Use size_t instead of int for the result of min().
>>
>> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
>
> Reviewed-by: Marco Elver <elver@google.com>
>
> Thanks for polishing (but see below). Please compile-test with
> CONFIG_KCSAN=y if you haven't.
Yes, I compile-tested it with CONFIG_KCSAN=y, but forgot to mention it.
> While we're here polishing things this could be:
>
> const size_t read_len = min(count, sizeof(kbuf) - 1);
>
> ( +const, remove redundant () )
Should I submit a v2 or are you adding this already?
Thanks,
Thorsten
next prev parent reply other threads:[~2024-06-24 8:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-23 22:06 Thorsten Blum
2024-06-24 7:02 ` Marco Elver
2024-06-24 8:00 ` Thorsten Blum [this message]
2024-06-24 8:44 ` Marco Elver
2024-06-28 14:51 ` David Laight
2024-06-28 15:03 ` Marco Elver
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=A820FF35-B5A3-410A-BAF3-0446938CD951@toblux.com \
--to=thorsten.blum@toblux.com \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®