[PATCH 8/9] fsnotify: use BUILD_BUG_ON() to test the weight of ALL_FSNOTIFY_EVENTS
From: Lai Jiangshan
Date: Fri Mar 15 2013 - 12:53:00 EST
BUILD_BUG_ON() is build-time-test for constant. avoid runtime test.
also use HWEIGHT32() for build-time.
Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
Cc: Eric Paris <eparis@xxxxxxxxxxxxxx>
---
fs/notify/fsnotify.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index aba962a..eaa0e9e 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -298,7 +298,7 @@ EXPORT_SYMBOL_GPL(fsnotify);
static __init int fsnotify_init(void)
{
- BUG_ON(hweight32(ALL_FSNOTIFY_EVENTS) != 23);
+ BUILD_BUG_ON(HWEIGHT32(ALL_FSNOTIFY_EVENTS) != 23);
return 0;
}
--
1.7.4.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/