The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* replace "memset(...,0,PAGE_SIZE)" calls with "clear_page()"?
@ 2006-12-29  6:16 Robert P. J. Day
  2006-12-30 20:49 ` Denis Vlasenko
  0 siblings, 1 reply; 21+ messages in thread
From: Robert P. J. Day @ 2006-12-29  6:16 UTC (permalink / raw)
  To: Linux kernel mailing list


  is there some reason there are so many calls of the form

  memset(addr, 0, PAGE_SIZE)

rather than the apparently equivalent invocation of

  clear_page(addr)

the majority of architectures appear to define the clear_page() macro
in their include/<arch>/page.h header file, but not entirely
identically, and in some cases that definition is conditional, as with
i386:

=============================================================
#ifdef CONFIG_X86_USE_3DNOW
...
#define clear_page(page)        mmx_clear_page((void *)(page))
...
#else
...
#define clear_page(page)        memset((void *)(page), 0, PAGE_SIZE)
...
#endif
============================================================

  should it perhaps be part of the CodingStyle doc to use the
clear_page() macro rather than an explicit call to memset()?  (and
should all architectures be required to define that macro?)

rday

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2007-01-03 13:25 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-29  6:16 replace "memset(...,0,PAGE_SIZE)" calls with "clear_page()"? Robert P. J. Day
2006-12-30 20:49 ` Denis Vlasenko
2006-12-30 22:08   ` Robert P. J. Day
2006-12-30 22:40     ` Denis Vlasenko
2007-01-03  6:23       ` dean gaudet
2006-12-30 22:45     ` Arjan van de Ven
2006-12-30 23:04       ` Robert P. J. Day
2006-12-31 18:39         ` Paul Mundt
2006-12-31 19:04           ` Robert P. J. Day
2007-01-01  1:59             ` Folkert van Heusden
2007-01-01  8:33               ` Robert P. J. Day
2007-01-01 10:14                 ` Arjan van de Ven
2007-01-01 10:27                   ` Robert P. J. Day
2007-01-01 19:05                     ` Dave Jones
2007-01-01  8:42               ` Paul Mundt
2007-01-01 17:09                 ` Randy Dunlap
2006-12-31 13:39       ` Folkert van Heusden
2006-12-31 13:45         ` Arjan van de Ven
2006-12-31 16:39           ` Robert P. J. Day
2006-12-31 17:43             ` Arjan van de Ven
2007-01-03 13:20               ` Robert P. J. Day

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox