btrfs: fix kvcalloc() arguments order in btrfs_ioctl_send() 15/312215/1 accepted/tizen/unified/toolchain/20240610.172841 accepted/tizen/unified/x/20240610.223419
authorDmitry Antipov <dmantipov@yandex.ru>
Thu, 21 Dec 2023 08:47:45 +0000 (11:47 +0300)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 5 Jun 2024 06:41:42 +0000 (15:41 +0900)
commit4c6699f21346842a6da031cc50ac3b4117b5d1ea
tree573db105fc15024d180a692ee557aa97d8a620f2
parent056e616d308587ac7e2cea7a1a7414a060bce15b
btrfs: fix kvcalloc() arguments order in btrfs_ioctl_send()

When compiling with gcc version 14.0.0 20231220 (experimental)
and W=1, I've noticed the following warning:

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),
      |                                            ^

Since 'n' and 'size' arguments of 'kvcalloc()' 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: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
(cherry picked from commit 6ff09b6b8c2fb6b3edda4ffaa173153a40653067)
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I30403a32f70d9760f2ce200f8195b87ad62baf4e
fs/btrfs/send.c