From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Mark Brown <broonie@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] regmap: fix kcalloc() arguments order
Date: Thu, 4 Jan 2024 14:08:38 +0000 [thread overview]
Message-ID: <20240104140838.GF14858@ediswmail.ad.cirrus.com> (raw)
In-Reply-To: <20231220175829.533700-1-dmantipov@yandex.ru>
On Wed, Dec 20, 2023 at 08:58:19PM +0300, Dmitry Antipov wrote:
> When compiling with gcc version 14.0.0 20231220 (experimental)
> and W=1, I've noticed a bunch of four similar warnings like:
>
> drivers/base/regmap/regmap-ram.c: In function '__regmap_init_ram':
> drivers/base/regmap/regmap-ram.c:68:37: warning: 'kcalloc' sizes specified with
> 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
> 68 | data->read = kcalloc(sizeof(bool), config->max_register + 1,
> | ^~~~
>
> Since 'n' and 'size' arguments of 'kcalloc()' are multiplied to
> calculate the final size, their actual order doesn't affect the
> result and so this is not a bug. But it's still worth to fix it.
>
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> ---
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
prev parent reply other threads:[~2024-01-04 14:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-20 17:58 Dmitry Antipov
2023-12-20 21:31 ` Mark Brown
2024-01-04 14:08 ` Charles Keepax [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=20240104140838.GF14858@ediswmail.ad.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=dmantipov@yandex.ru \
--cc=gregkh@linuxfoundation.org \
--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®