From: Richard Knutsson <ricknu-0@student.ltu.se>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] is there a short form for "memset(blah, 0, len)"?
Date: Sat, 10 Feb 2007 19:12:48 +0000 [thread overview]
Message-ID: <45CE1930.3050500@student.ltu.se> (raw)
In-Reply-To: <Pine.LNX.4.64.0702101112510.4576@CPE00045a9c397f-CM001225dbafb6>
Robert P. J. Day wrote:
> On Sat, 10 Feb 2007, Bernd Petrovitsch wrote:
>
>
>> On Sat, 2007-02-10 at 11:14 -0500, Robert P. J. Day wrote:
>>
>>> i doubt anything will ever come of this but, given the number of
>>> calls to "memset(addr, 0, len)", did anyone ever consider defining a
>>> macro short form, say:
>>>
>>> clearmem(addr, len)
>>> zeromem(addr, len)
>>>
>> *BSD had "bzero()".
>>
>>
>>> or something like that? just curious.
>>>
>> Did you ever read the man page of "bzero()"?
>>
>
> sure, but that's a *userspace* routine. AFAIK, there is no such
> routine in the linux kernel. is there a reason there isn't? wouldn't
> it be kind of useful?
>
> grep -Enr "define +.*memset *\(.*0" *
arch/alpha/boot/misc.c:25:#define memzero(s,n) memset ((s),0,(n))
arch/cris/arch-v10/boot/compressed/misc.c:38:#define memzero(s, n) memset ((s), 0, (n))
arch/cris/arch-v32/boot/compressed/misc.c:40:#define memzero(s, n) memset ((s), 0, (n))
arch/i386/boot/compressed/misc.c:110:#define memzero(s, n) memset ((s), 0, (n))
arch/m32r/boot/compressed/misc.c:26:#define memzero(s, n) memset ((s), 0, (n))
arch/sh/boot/compressed/misc.c:30:#define memzero(s, n) memset ((s), 0, (n))
arch/sh64/boot/compressed/misc.c:28:#define memzero(s, n) memset ((s), 0, (n))
...
So it seems memzero() is a candidate, don't you think?
Richard Knutsson
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
next prev parent reply other threads:[~2007-02-10 19:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-10 16:14 [KJ] is there a short form for "memset(blah, 0, len)"? Robert P. J. Day
2007-02-10 17:01 ` Bernd Petrovitsch
2007-02-10 18:25 ` Robert P. J. Day
2007-02-10 18:55 ` Bernd Petrovitsch
2007-02-10 19:12 ` Richard Knutsson [this message]
2007-02-10 19:56 ` Robert P. J. Day
2007-02-10 20:03 ` Robert P. J. Day
2007-02-10 20:11 ` Robert P. J. Day
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=45CE1930.3050500@student.ltu.se \
--to=ricknu-0@student.ltu.se \
--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.