aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2018-10-03 17:25:36 -0400
committerJan Kara <jack@suse.cz>2018-10-04 07:28:50 -0400
commita39f7ec41766118bf836d266224505741570ada6 (patch)
tree441cd39d5155d82b43cb83fed15902326d6b5424
parent23c9deeb3285d34fd243abb3d6b9f07db60c3cf4 (diff)
fsnotify: convert runtime BUG_ON() to BUILD_BUG_ON()
The BUG_ON() statements to verify number of bits in ALL_FSNOTIFY_BITS and ALL_INOTIFY_BITS are converted to build time check of the constant. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--fs/notify/fsnotify.c2
-rw-r--r--fs/notify/inotify/inotify_user.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index 7391a02bf723..875975504409 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -395,7 +395,7 @@ static __init int fsnotify_init(void)
395{ 395{
396 int ret; 396 int ret;
397 397
398 BUG_ON(hweight32(ALL_FSNOTIFY_BITS) != 23); 398 BUILD_BUG_ON(HWEIGHT32(ALL_FSNOTIFY_BITS) != 23);
399 399
400 ret = init_srcu_struct(&fsnotify_mark_srcu); 400 ret = init_srcu_struct(&fsnotify_mark_srcu);
401 if (ret) 401 if (ret)
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index ac6978d3208c..105576daca4a 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -815,7 +815,7 @@ static int __init inotify_user_setup(void)
815 BUILD_BUG_ON(IN_ISDIR != FS_ISDIR); 815 BUILD_BUG_ON(IN_ISDIR != FS_ISDIR);
816 BUILD_BUG_ON(IN_ONESHOT != FS_IN_ONESHOT); 816 BUILD_BUG_ON(IN_ONESHOT != FS_IN_ONESHOT);
817 817
818 BUG_ON(hweight32(ALL_INOTIFY_BITS) != 22); 818 BUILD_BUG_ON(HWEIGHT32(ALL_INOTIFY_BITS) != 22);
819 819
820 inotify_inode_mark_cachep = KMEM_CACHE(inotify_inode_mark, 820 inotify_inode_mark_cachep = KMEM_CACHE(inotify_inode_mark,
821 SLAB_PANIC|SLAB_ACCOUNT); 821 SLAB_PANIC|SLAB_ACCOUNT);