[PATCH] __mod_page_state - pass unsigned long instead of unsigned

From: Benjamin LaHaise
Date: Wed Jun 01 2005 - 09:58:06 EST


By making the offset argument of __mod_page_state an unsigned long instead
of unsigned, we can avoid forcing the compiler to sign extend a usually
constant argument. This saves 1 instruction on x86-64.

-ben

Signed-off-by: Benjamin LaHaise <benjamin.c.lahaise@xxxxxxxxx>
diff -purN v2.6.12-rc5/include/linux/page-flags.h test-rc5/include/linux/page-flags.h
--- v2.6.12-rc5/include/linux/page-flags.h 2005-05-30 13:29:33.000000000 -0400
+++ test-rc5/include/linux/page-flags.h 2005-06-01 10:45:53.000000000 -0400
@@ -137,7 +137,7 @@ struct page_state {
extern void get_page_state(struct page_state *ret);
extern void get_full_page_state(struct page_state *ret);
extern unsigned long __read_page_state(unsigned offset);
-extern void __mod_page_state(unsigned offset, unsigned long delta);
+extern void __mod_page_state(unsigned long offset, unsigned long delta);

#define read_page_state(member) \
__read_page_state(offsetof(struct page_state, member))
diff -purN v2.6.12-rc5/mm/page_alloc.c test-rc5/mm/page_alloc.c
--- v2.6.12-rc5/mm/page_alloc.c 2005-05-30 13:29:34.000000000 -0400
+++ test-rc5/mm/page_alloc.c 2005-06-01 10:46:25.000000000 -0400
@@ -1128,7 +1128,7 @@ unsigned long __read_page_state(unsigned
return ret;
}

-void __mod_page_state(unsigned offset, unsigned long delta)
+void __mod_page_state(unsigned long offset, unsigned long delta)
{
unsigned long flags;
void* ptr;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/