[CRIU] [PATCH 1/2] compiler: Add comment about is_log2 helper

Cyrill Gorcunov gorcunov at openvz.org
Mon Dec 10 09:07:12 EST 2012


Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 include/compiler.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/compiler.h b/include/compiler.h
index 621cedb..fd8fd2f 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -66,6 +66,10 @@
 	(void) (&_max1 == &_max2);		\
 	_max1 > _max2 ? _max1 : _max2; })
 
-#define is_log2(v)		(((v) & ((v) - 1)) == 0)
+/*
+ * Note the side effects here: if v = [0;1] it will
+ * return true for obvious reason
+ */
+#define is_log2(v)             (((v) & ((v) - 1)) == 0)
 
 #endif /* CR_COMPILER_H_ */
-- 
1.8.0.1



More information about the CRIU mailing list