From: Adrian Bunk <bunk@kernel.org>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 3/3] remove explicit memset to memory allocated with
Date: Mon, 31 Dec 2007 00:51:37 +0000 [thread overview]
Message-ID: <20071231005137.GC3083@does.not.exist> (raw)
In-Reply-To: <005801c841bb$6723d330$0b01a8c0@bureau>
On Tue, Dec 18, 2007 at 11:53:58PM +0100, Andi Drebes wrote:
> Hi!
>
> > 1) Remove an explicit memset(.., 0, ...) to a varialable allocated with
> > kzalloc.
> >
> > 2) Allocate 'src' with kmalloc instead of kzalloc as all elements of the
> > 'src' buffer are initialized in a 'for(...)' loop
> The changes look good to me, but there's another thing that could be done in that file:
> There's no need for the expression "sizeof(u8)" since it always returns 1. Could you
> fix that too and submit a new patch?
>
> There are quite a lot of statements like that in the kernel...
>
> $ grep -r "sizeof(u8)" . | wc -l
> 53
What is the problem you are trying to solve?
It might in some places be an improvement to replace a sizeof(u8) with a
sizeof() on the actual variable, but blindly replacing sizeof(u8) with 1
sounds like an attempt to make the code harder to read without bringing
any advantage...
> Regards,
> Andi
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
next prev parent reply other threads:[~2007-12-31 0:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-18 21:17 [PATCH 3/3] remove explicit memset to memory allocated with k[zc]alloc Christophe Jaillet
2007-12-18 22:53 ` Andi Drebes
2007-12-31 0:51 ` Adrian Bunk [this message]
2007-12-31 11:29 ` Andi Drebes
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=20071231005137.GC3083@does.not.exist \
--to=bunk@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.