lkml.org 
[lkml]   [2022]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/3] Staging: rtl8192e: Using kzalloc and delete memset
On Wed, Jun 22, 2022 at 05:12:45PM +0200, Felix Schlepper wrote:
> By using kzalloc, we can delete a memset and avoid
> memory initialization defects.
>

This commit message is slightly confusing. The "avoid memory
initialization defects" bit is very vague.

The difference between the original code and patched code is that the
patched code zeroes out the txb->fragments[] array. The original code
worked. The new code is slightly cleaner, but also slower. Whatever,
either way is fine.

But just state it clearly in the commit message.

"By using kzalloc, we can delete a memset. The practical difference
is that using kzalloc() will zero out the txb->fragments[] array.
The original code worked fine, but zeroing everything seems nicer."

regards,
dan carpenter

\
 
 \ /
  Last update: 2022-06-23 09:06    [W:0.032 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site