genl_magic: Resolve logical-op warnings
authorMark Rustad <mark.d.rustad@intel.com>
Tue, 14 Oct 2014 13:28:38 +0000 (06:28 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Oct 2014 21:03:53 +0000 (17:03 -0400)
Resolve "logical 'and' applied to non-boolean constant" warnings"
that appear in W=2 builds by adding !! to a bit test.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/genl_magic_func.h

index c0894dd8827b27378d31bb88f591bc2fd1e43a9c..667c31101b8b91f0b1d17a99a08edd9cf8d29d63 100644 (file)
@@ -178,12 +178,12 @@ static int s_name ## _from_attrs_for_change(struct s_name *s,             \
 #define __assign(attr_nr, attr_flag, name, nla_type, type, assignment...)      \
                nla = ntb[attr_nr];                                             \
                if (nla) {                                              \
-                       if (exclude_invariants && ((attr_flag) & DRBD_F_INVARIANT)) {           \
+                       if (exclude_invariants && !!((attr_flag) & DRBD_F_INVARIANT)) {         \
                                pr_info("<< must not change invariant attr: %s\n", #name);      \
                                return -EEXIST;                         \
                        }                                               \
                        assignment;                                     \
-               } else if (exclude_invariants && ((attr_flag) & DRBD_F_INVARIANT)) {            \
+               } else if (exclude_invariants && !!((attr_flag) & DRBD_F_INVARIANT)) {          \
                        /* attribute missing from payload, */           \
                        /* which was expected */                        \
                } else if ((attr_flag) & DRBD_F_REQUIRED) {             \