public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Felix Schlepper <f3sch.git@outlook.com>
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/3] Staging: rtl8192e: Using kzalloc and delete memset
Date: Thu, 23 Jun 2022 10:05:19 +0300	[thread overview]
Message-ID: <20220623070519.GP16517@kadam> (raw)
In-Reply-To: <AM9P190MB12995D1FF1EECE4C633A865FA5B29@AM9P190MB1299.EURP190.PROD.OUTLOOK.COM>

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


  reply	other threads:[~2022-06-23  7:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1655909205.git.f3sch.git@outlook.com>
2022-06-22 15:12 ` [PATCH v3 1/3] Staging: rtl8192e: Use struct_size Felix Schlepper
2022-06-22 15:12 ` [PATCH v3 2/3] Staging: rtl8192e: Using kzalloc and delete memset Felix Schlepper
2022-06-23  7:05   ` Dan Carpenter [this message]
2022-06-22 15:12 ` [PATCH v3 3/3] Staging: rtl8192e: Cleaning up error handling Felix Schlepper
2022-06-23  6:54   ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220623070519.GP16517@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=f3sch.git@outlook.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox