lkml.org 
[lkml]   [2013]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 8/9] fsnotify: use BUILD_BUG_ON() to test the weight of ALL_FSNOTIFY_EVENTS
Date
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


\
 
 \ /
  Last update: 2013-03-15 19:01    [W:0.080 / U:1.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site