Re: [PATCH] Staging rtlwifi efuse fix up a warning kzalloc
From: Larry Finger
Date: Sat Aug 26 2017 - 10:48:40 EST
On 08/26/2017 08:01 AM, Yurii Pavlenko wrote:
Hello,
I have attached a small patch to fix a warning "Prefer kcalloc over kzalloc with multiply"
for efuse.c as part of challenge 10 of Eudyptula.
Best regards,
Yurii Pavlenko
Signed-off-by: Yurii Pavlenko <pyldev@xxxxxxxxx>
Before you waste any more of our time, please read the material about patch
submission at Documentation/process/submitting-patches.rst in your source tree.
In its present form, this patch is not usable!
I also disagree with the checkpatch warning. To me, there is no difference
between specifying the size of the allocation as "EFUSE_MAX_WORD_UNIT,
sizeof(u16 *)" or "EFUSE_MAX_WORD_UNIT * sizeof(u16 *)". In fact, the only real
difference is that the source is ONE character larger with the kzalloc version!
Is that important? Certainly not to me! One thing that is readily apparent is
that kzalloc() zeros the allocated space. Of course, so does kcalloc(), but it
is not apparent from the name.
Most of the checkpatch warnings improve readability of the source, and do find
real or potential errors. This particular one does not, and I will NACK every
patch that tries to force code that I maintain to use kcalloc over kzalloc.
Larry