fs/super.c: use && instead of & for warn_on condition
PATCH 1/1 fs/super.c: use && instead of & for warn_on condition
This fixes the following sparse warning:
fs/super.c:1202:9: warning: dubious: x & !y
Bitwise and logical and are equivalent here, but logical was intended. The generated code is identical, with and without CONFIG_LOCKDEP.
Signed-off-by Vincent Stehlé <[email protected]>
Cc Oleg Nesterov <[email protected]>
Cc Alexander Viro <[email protected]>
--- fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/super.c +1 -1
@@ -1199,7 +1199,7 @@ int __sb_start_write(struct super_block *sb, int level, bool wait)else ret =percpu_down_read_trylock (sb->s_writers.rw_sem + level-1 ); -WARN_ON (force_trylock & !ret); +WARN_ON (force_trylock && !ret);return ret; }EXPORT_SYMBOL (__sb_start_write);
Signature · 1 line
2.5.1
fs/super.c int __sb_start_write(struct super_block *sb, int level, bool wait) · line 1202
Quoted 9 lines · Vincent Stehl�
fs/super.c +1
-1@@ -1199,7 +1199,7 @@ int __sb_start_write(struct super_block *sb, int level, bool wait)else ret =percpu_down_read_trylock (sb->s_writers.rw_sem + level-1 ); -WARN_ON (force_trylock & !ret); +WARN_ON (force_trylock && !ret);
OOPS! yes, this is a typo, thanks! Harmless in this particular case, but still.
Acked-by Oleg Nesterov <[email protected]>
Quoted 6 lines · Oleg Nesterov
Quoted 6 lines
fs/super.c +0
-0@@ -1199,7 +1199,7 @@ int __sb_start_write(struct super_block *sb, int level, bool wait)else ret =percpu_down_read_trylock (sb->s_writers.rw_sem + level-1 );
Quoted 7 lines
fs/super.c int __sb_start_write(struct super_block *sb, int level, bool wait) · line 1202
Quoted 2 lines
fs/super.c +1
-1-WARN_ON (force_trylock & !ret); +WARN_ON (force_trylock && !ret);OOPS! yes, this is a typo, thanks! Harmless in this particular case, but still.
Acked-by Oleg Nesterov <[email protected]>
Doesn't seem to be in linux-next as of today, so I am taking it now. Thanks,
Signature · 2 lines
Jiri Kosina SUSE Labs