Linux SPARSE checker discussions
 help / color / mirror / Atom feed
* Spurious warning about using kzalloc instead of kmalloc
@ 2024-07-03 15:02 Richard Fitzgerald
  2024-07-03 15:28 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Fitzgerald @ 2024-07-03 15:02 UTC (permalink / raw)
  To: dan.carpenter, 679652+tititiou36; +Cc: linux-sparse

As far as I can tell from the limited commit message and comments, the
purpose of commit 6a74b670 ("Refactor and add new functions tested by
check_kvmalloc_array_zero()") is to suggest that uses of __GFP_ZERO are
replaced by the appropriate zeroing allocator, like kzalloc.

But this warning is being reported on the function
cs_dsp_coeff_read_ctrl_raw() in drivers/firmware/cirrus/cs_dsp.c

That function does not have a __GFP_ZERO, the kmalloc is:

scratch = kmalloc(len, GFP_KERNEL | GFP_DMA);

and it is intentional to use kmalloc because the entire buffer is
then overwritten, so it's inefficient to zero-fill it first.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-03 15:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-03 15:02 Spurious warning about using kzalloc instead of kmalloc Richard Fitzgerald
2024-07-03 15:28 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox