summaryrefslogtreecommitdiff
path: root/include/linux/compiler.h
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2003-08-14 10:23:15 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-08-14 10:23:15 -0700
commit2e0623e3e0d76e796aaa1ff2f7891bc7d43ebca2 (patch)
tree6b13bf7b19c4072896c07c86b4c20dc1c39a99d9 /include/linux/compiler.h
parentca5c021cb12beb814100e333aa68c1b254376537 (diff)
[PATCH] fix [un]likely(), add ptr support
From: Albert Cahalan <albert@users.sourceforge.net> 1. allows likely() and unlikely() to work for pointers 2. fixes likely() (in C, any non-zero value is true)
Diffstat (limited to 'include/linux/compiler.h')
-rw-r--r--include/linux/compiler.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 79e1773251f2..356428f649fc 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -24,8 +24,8 @@
#define __builtin_expect(x, expected_value) (x)
#endif
-#define likely(x) __builtin_expect((x),1)
-#define unlikely(x) __builtin_expect((x),0)
+#define likely(x) __builtin_expect(!!(x), 1)
+#define unlikely(x) __builtin_expect(!!(x), 0)
/*
* Allow us to mark functions as 'deprecated' and have gcc emit a nice