]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
fs/super.c: use && instead of & for warn_on condition
authorVincent Stehlé <vincent.stehle@freescale.com>
Mon, 21 Sep 2015 15:18:34 +0000 (17:18 +0200)
committerJiri Kosina <jkosina@suse.cz>
Tue, 8 Dec 2015 13:50:57 +0000 (14:50 +0100)
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é <vincent.stehle@freescale.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
fs/super.c

index 954aeb80e202be0a40fc42eeca465c033ab1fc9a..7ea56de57d4b874a3d3737aa49dafa94715a6ff8 100644 (file)
@@ -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);