From: David Sterba <dsterba@suse.cz>
To: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>,
Denis Efremov <efremov@linux.com>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] btrfs: send: Silence build warning about kvcalloc()
Date: Mon, 8 Jan 2024 18:41:47 +0100 [thread overview]
Message-ID: <20240108174147.GC28693@twin.jikos.cz> (raw)
In-Reply-To: <20240108041351.9847-1-yangtiezhu@loongson.cn>
On Mon, Jan 08, 2024 at 12:13:51PM +0800, Tiezhu Yang wrote:
> There exist the following warning when building kernel v6.7:
>
> CC fs/btrfs/send.o
> fs/btrfs/send.c: In function ‘btrfs_ioctl_send’:
> fs/btrfs/send.c:8208:44: warning: ‘kvcalloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
> 8208 | sctx->clone_roots = kvcalloc(sizeof(*sctx->clone_roots),
> | ^
> fs/btrfs/send.c:8208:44: note: earlier argument should specify number of elements, later size of each element
>
> tested with the latest upstream toolchains (20240105):
>
> [fedora@linux 6.7.test]$ gcc --version
> gcc (GCC) 14.0.0 20240105 (experimental)
> [fedora@linux 6.7.test]$ as --version
> GNU assembler (GNU Binutils) 2.41.50.20240105
> [fedora@linux 6.7.test]$ ld --version
> GNU ld (GNU Binutils) 2.41.50.20240105
>
> just switch the first and second arguments of kvcalloc() to silence
> the build warning, compile tested only.
>
> Fixes: bae12df966f0 ("btrfs: use kvcalloc for allocation in btrfs_ioctl_send()")
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Thanks, a fix has been already sent
https://lore.kernel.org/linux-btrfs/20231221084748.10094-1-dmantipov@yandex.ru/
prev parent reply other threads:[~2024-01-08 17:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-08 4:13 Tiezhu Yang
2024-01-08 17:41 ` David Sterba [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=20240108174147.GC28693@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=efremov@linux.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yangtiezhu@loongson.cn \
/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®