From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: linux-kernel@vger.kernel.org
Cc: viro@parcelfarce.linux.theplanet.co.uk
Subject: Re: [RFC][PATCH] kmalloc + memset(foo, 0, bar) = kmalloc0
Date: Thu, 11 Sep 2003 16:11:28 +0200 [thread overview]
Message-ID: <200309111611.28198@bilbo.math.uni-mannheim.de> (raw)
In-Reply-To: <20030911134557.GV454@parcelfarce.linux.theplanet.co.uk>
Am Donnerstag, 11. September 2003 15:45 schrieben Sie:
> On Thu, Sep 11, 2003 at 03:40:58PM +0200, Rolf Eike Beer wrote:
> > Hi,
> >
> > a (very) simple grep in drivers/ showed more than 300 matches of code
> > like this:
> >
> > foo = kmalloc(bar, baz);
> > if (! foo)
> > return -ENOMEM;
> > memset(foo, 0, sizeof(foo));
> Erm. It would better *not* be there in such amounts - sizeof(foo) would
> be a size of pointer...
Eek, yes. Typo from me.
> > Why not add a small inlined function doing the memset for us
> > and reducing the code to
> >
> > foo = kmalloc0(bar, baz);
> > if (! foo)
> > return -ENOMEM;
>
> Bad choice of name - too easy to confuse with kmalloc().
Yes, maybe. But don't expect more innovations from me today, it's someone
else's turn ;)
Eike
next prev parent reply other threads:[~2003-09-11 14:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-11 13:40 [RFC][PATCH] kmalloc + memset(foo, 0, bar) = kmalloc0 Rolf Eike Beer
2003-09-11 13:45 ` viro
2003-09-11 14:11 ` Rolf Eike Beer [this message]
2003-09-11 17:09 ` Jamie Lokier
2003-09-11 21:58 ` J.A. Magallon
2003-09-11 22:12 ` Alan Cox
2003-09-11 22:25 ` J.A. Magallon
2003-09-11 13:58 ` Breno Silva
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=200309111611.28198@bilbo.math.uni-mannheim.de \
--to=eike-kernel@sf-tec.de \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@parcelfarce.linux.theplanet.co.uk \
/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.