diff options
author | hselasky <hselasky@FreeBSD.org> | 2015-02-23 12:54:46 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2015-02-23 12:54:46 +0000 |
commit | 403694c32d67445760f33838487e7096d211803c (patch) | |
tree | 0f5c5ab55121547930b6bf6b67390b8e54cd63a9 | |
parent | 5fbf9aadca411dccffb73f749dc6067a6a55a27d (diff) | |
download | FreeBSD-src-403694c32d67445760f33838487e7096d211803c.zip FreeBSD-src-403694c32d67445760f33838487e7096d211803c.tar.gz |
Macro fixes:
- Add missing "order_base_2()" macro.
- Fix BUILD_BUG_ON() macro.
MFC after: 1 month
Sponsored by: Mellanox Technologies
-rw-r--r-- | sys/ofed/include/linux/kernel.h | 2 | ||||
-rw-r--r-- | sys/ofed/include/linux/log2.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/sys/ofed/include/linux/kernel.h b/sys/ofed/include/linux/kernel.h index 2f665c6..d07b3eb 100644 --- a/sys/ofed/include/linux/kernel.h +++ b/sys/ofed/include/linux/kernel.h @@ -59,7 +59,7 @@ #define KERN_INFO "<6>" #define KERN_DEBUG "<7>" -#define BUILD_BUG_ON(x) CTASSERT(x) +#define BUILD_BUG_ON(x) CTASSERT(!(x)) #define BUG() panic("BUG") #define BUG_ON(condition) do { if (condition) BUG(); } while(0) diff --git a/sys/ofed/include/linux/log2.h b/sys/ofed/include/linux/log2.h index ffc1fdb..77a2924 100644 --- a/sys/ofed/include/linux/log2.h +++ b/sys/ofed/include/linux/log2.h @@ -167,4 +167,6 @@ int __ilog2_u64(u64 n) __ilog2_u64(n) \ ) +#define order_base_2(x) ilog2(roundup_pow_of_two(x)) + #endif /* _LINUX_LOG2_H_ */ |