[lttng-dev] [PATCH lttng-modules] Make upper bound of kernel version checking macro exclusive

Andrew Gabbasov andrew_gabbasov at mentor.com
Tue Nov 27 07:21:53 EST 2012


It's more usable to have the upper limit exclusive. It helps to avoid
hardcoding of stable branch highest version number, i.e. having a range
from 3.1.0 up to 3.2.0 (exclusively) gives us all 3.1.x versions.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov at mentor.com>
---
 lttng-kernel-version.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lttng-kernel-version.h b/lttng-kernel-version.h
index 280a398..0eb56b3 100644
--- a/lttng-kernel-version.h
+++ b/lttng-kernel-version.h
@@ -27,10 +27,10 @@
 
 /*
  * This macro checks if the kernel version is between the two specified
- * versions (inclusive).
+ * versions (lower limit inclusive, upper limit exclusive).
  */
 #define LTTNG_KERNEL_RANGE(a_low, b_low, c_low, a_high, b_high, c_high) \
 	(LINUX_VERSION_CODE >= KERNEL_VERSION(a_low, b_low, c_low) && \
-	 LINUX_VERSION_CODE <= KERNEL_VERSION(a_high, b_high, c_high))
+	 LINUX_VERSION_CODE < KERNEL_VERSION(a_high, b_high, c_high))
 
 #endif /* _LTTNG_KERNEL_VERSION_H */
-- 
1.7.10.4




More information about the lttng-dev mailing list