Re: [PATCH] ALSA: seq: fix kvmalloc_array() arguments order

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



On Thu, 21 Dec 2023 10:16:00 +0100,
Dmitry Antipov wrote:
> 
> When compiling with gcc version 14.0.0 20231220 (experimental)
> and W=1, I've noticed the following warning:
> 
> sound/core/seq/seq_memory.c: In function 'snd_seq_pool_init':
> sound/core/seq/seq_memory.c:445:41: warning: 'kvmalloc_array' sizes specified with
> 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
>   445 |         cellptr = kvmalloc_array(sizeof(struct snd_seq_event_cell), pool->size,
>       |                                         ^~~~~~
> 
> Since 'n' and 'size' arguments of 'kvmalloc_array()' 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@xxxxxxxxx>

Applied, thanks.


Takashi




[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux