Skip to contentSkip to conversation

Get rid of arch_free_page() warning

PATCH New David Howells 1 participant 1 message Dec 14, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Get rid of arch_free_page() warning

The attached patch gets rid of a warning produced when compiling mm/page_alloc.c if the arch doesn't supply its own arch_free_page().

The problem is that there's one place in there that ignores the return value of this function, and so you get a warning from gcc about an ineffectual statement.

---
warthog>diffstat ../archfreepage-2610rc3.diff

 gfp.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)
include/linux/gfp.h +4 -1
diff -uNr linux-2.6.10-rc3-mm1-mmcleanup/include/linux/gfp.h linux-2.6.10-rc3-mm1-misc/include/linux/gfp.h
@@ -79,7 +79,10 @@
  * immediately bail: the arch-specific function has done all the work.
  */
 #ifndef HAVE_ARCH_FREE_PAGE
-#define arch_free_page(page, order) 0
+static inline int arch_free_page(struct page *page, unsigned int order)
+{
+	return 0;
+}
 #endif
 
 extern struct page *