summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo M. Correia <[email protected]>2009-02-25 21:06:15 +0000
committerBrian Behlendorf <[email protected]>2009-02-25 15:50:58 -0800
commiteb7c7f44e8b7630f027cf92e0490062428f7fced (patch)
tree3461f07458feb4b7bffb9d0f2c3586196e142728
parent7819a92a9bb9e1bc5dd9f50bc644baf39f2946c9 (diff)
Changed ptob()/btop() mult/div into bit shifts.
Added necessary include for PAGE_SHIFT.
-rw-r--r--include/sys/param.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/sys/param.h b/include/sys/param.h
index d6b4f761f..dbcdb6e9c 100644
--- a/include/sys/param.h
+++ b/include/sys/param.h
@@ -1,8 +1,10 @@
#ifndef _SPL_PARAM_H
#define _SPL_PARAM_H
+#include <asm/page.h>
+
/* Pages to bytes and back */
-#define ptob(pages) (pages * PAGE_SIZE)
-#define btop(bytes) (bytes / PAGE_SIZE)
+#define ptob(pages) (pages << PAGE_SHIFT)
+#define btop(bytes) (bytes >> PAGE_SHIFT)
#endif /* SPL_PARAM_H */