Skip to contentSkip to conversation

tweak page_address

PATCH New Eric W. Biederman 1 participant 1 message May 23, 1999

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

PATCH 1/1 tweak page_address

Replace a multiplication by a shift in page_address. The compiler probably already does but why take chances.

Eric

include/linux/pagemap.h +1 -1
diff -uNrX linux-ignore-files linux-2.3.3.eb2/include/linux/pagemap.h linux-2.3.3.eb3/include/linux/pagemap.h
@@ -14,7 +14,7 @@
 
 static inline unsigned long page_address(struct page * page)
 {
-	return PAGE_OFFSET + PAGE_SIZE * (page - mem_map);
+	return PAGE_OFFSET + ((page - mem_map) << PAGE_SHIFT);
 }
 
 /*

--
To unsubscribe, send a message with 'unsubscribe linux-mm my@address' in the body to [email protected]. For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/