Messages in this thread Patch in this message | | | From | Lai Jiangshan <> | Subject | [PATCH 8/9] fsnotify: use BUILD_BUG_ON() to test the weight of ALL_FSNOTIFY_EVENTS | Date | Sat, 16 Mar 2013 00:50:56 +0800 |
| |
BUILD_BUG_ON() is build-time-test for constant. avoid runtime test. also use HWEIGHT32() for build-time.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Cc: Eric Paris <eparis@parisplace.org> --- 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
| |