Re: [PATCH AUTOSEL 5.10 01/10] watch_queue: fix kcalloc() arguments order

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

> From: Dmitry Antipov <dmantipov@xxxxxxxxx>
> 
> [ Upstream commit 1bfc466b13cf6652ba227c282c27a30ffede69a5 ]
> 
> When compiling with gcc version 14.0.0 20231220 (experimental)
> and W=1, I've noticed the following warning:
> 
> kernel/watch_queue.c: In function 'watch_queue_set_size':
> kernel/watch_queue.c:273:32: warning: 'kcalloc' sizes specified with 'sizeof'
> in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
>   273 |         pages = kcalloc(sizeof(struct page *), nr_pages, GFP_KERNEL);
>       |                                ^~~~~~
> 
> 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.

Not a bugfix, please drop.

BR,
									Pavel
									-- 
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux