Re: memset as memzero

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Robert P. J. Day <rpjday@...>
Cc: Cyrill Gorcunov <gorcunov@...>, LKML <linux-kernel@...>, Andrew Morton <akpm@...>, Ingo Molnar <mingo@...>, Linus Torvalds <torvalds@...>
Date: Saturday, September 22, 2007 - 5:35 am

[Robert P. J. Day - Sat, Sep 22, 2007 at 04:48:28AM -0400]
| On Sat, 22 Sep 2007, Cyrill Gorcunov wrote:
| 
| > Hi list,
| >
| > could anyone tell me why there is no official memzero function (or
| > macros) in the kernel. As I see a lot of kernel parts calls for it
| > (defying own macros as alias to memset). Maybe there is a special
| > reason not to do so? Actually my suggestion is to define _one_
| > general macros for this.
| 
| i brought up this issue on the KJ list once upon a time:
| 
| https://lists.linux-foundation.org/pipermail/kernel-janitors/2007-February/017847.html
| 
| and there didn't seem to be much enthusiasm for it.
| 
|   however, i am still curious why there isn't more use of the
| already-defined "clear_page" macro.  most architectures appear to
| define it:
| 
| $ grep -r "define.*clear_page" include
| 
| but there are still numerous explicit calls to memset() to zero a
| chunk of memory that is exactly PAGE_SIZE in size.  just an
| observation.
| 
| rday
| -- 
| ========================================================================
| Robert P. J. Day
| Linux Consulting, Training and Annoying Kernel Pedantry
| Waterloo, Ontario, CANADA
| 
| http://crashcourse.ca
| ========================================================================
| 

Thanks Robert for the answer, I'll mark this (clear_page) in my "must to
take a look" list ;)
Well if there is no strong reason of keeping this separate '#define memzero'
I think it's a good case to merge them in some _single_ #define ;)

Waiting for other comments...

P.S.
In a mail you pointed to said that memset(...,0,...) is quite clear -
yes it's quite clear indeed but we already _have_ a lot of '#define memzero'
and who knows or may give the guarantee that new '#define memzero '_will not_'
appear in the kernel.

		Cyrill

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
memset as memzero, Cyrill Gorcunov, (Sat Sep 22, 4:33 am)
Re: memset as memzero, Arjan van de Ven, (Sat Sep 22, 3:46 pm)
Re: memset as memzero, Cyrill Gorcunov, (Sat Sep 22, 3:32 pm)
Re: memset as memzero, Bernd Eckenfels, (Sat Sep 22, 3:25 pm)
Re: memset as memzero, Linus Torvalds, (Sat Sep 22, 2:53 pm)
Re: memset as memzero, Dave Jones, (Sun Sep 23, 11:32 am)
Re: memset as memzero, Robert P. J. Day, (Sun Sep 23, 12:33 pm)
Re: memset as memzero, Arnaldo Carvalho de Melo, (Sun Sep 23, 12:46 pm)
Re: memset as memzero, Arnaldo Carvalho de Melo, (Sun Sep 23, 12:07 pm)
Re: memset as memzero, Linus Torvalds, (Sun Sep 23, 1:05 pm)
Re: memset as memzero, Willy Tarreau, (Sun Sep 23, 2:46 pm)
Re: memset as memzero, Robert P. J. Day, (Sat Sep 22, 4:48 am)
Re: memset as memzero, Cyrill Gorcunov, (Sat Sep 22, 5:35 am)
Re: memset as memzero, Robert P. J. Day, (Sat Sep 22, 5:55 am)
Re: memset as memzero, Cyrill Gorcunov, (Sat Sep 22, 6:15 am)