lkml.org 
[lkml]   [2006]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectreplace "memset(...,0,PAGE_SIZE)" calls with "clear_page()"?

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-12-29 07:23    [W:0.082 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site