summaryrefslogtreecommitdiff
path: root/include/linux/mman.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.osdl.org>2003-10-04 21:11:08 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-10-04 21:11:08 -0700
commitda3103c8efd7570939617bfa1f06fcdab9a9a11d (patch)
treef0e07dbc22384372c17d6b836f3a794fef62eed8 /include/linux/mman.h
parent799cc173710f8bac2e3d234445dbcf59483a872f (diff)
parent11d3c5ea4e4b16afcbe5f0966ed44b8b8f5ce5e5 (diff)
Merge bk://kernel.bkbits.net/davem/net-2.5
into home.osdl.org:/home/torvalds/v2.5/linux
Diffstat (limited to 'include/linux/mman.h')
-rw-r--r--include/linux/mman.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/mman.h b/include/linux/mman.h
index cfb6ac61bbde..07da84fcbd15 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -28,8 +28,13 @@ static inline void vm_unacct_memory(long pages)
vm_acct_memory(-pages);
}
-/* Optimisation macro. */
-#define _calc_vm_trans(x,bit1,bit2) \
+/*
+ * Optimisation macro. It is equivalent to:
+ * (x & bit1) ? bit2 : 0
+ * but this version is faster.
+ * ("bit1" and "bit2" must be single bits)
+ */
+#define _calc_vm_trans(x, bit1, bit2) \
((bit1) <= (bit2) ? ((x) & (bit1)) * ((bit2) / (bit1)) \
: ((x) & (bit1)) / ((bit1) / (bit2)))