summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/types.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/types.h b/include/linux/types.h
index 94ceb057eb64..f1c0ce5eb845 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -4,10 +4,12 @@
#ifdef __KERNEL__
#include <linux/config.h>
+#define BITS_TO_LONGS(bits) \
+ (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
#define DECLARE_BITMAP(name,bits) \
- unsigned long name[((bits)+BITS_PER_LONG-1)/BITS_PER_LONG]
+ unsigned long name[BITS_TO_LONGS(bits)]
#define CLEAR_BITMAP(name,bits) \
- memset(name, 0, ((bits)+BITS_PER_LONG-1)/8)
+ memset(name, 0, BITS_TO_LONGS(bits)*sizeof(unsigned long))
#endif
#include <linux/posix_types.h>