Skip to content

Commit db404b1

Browse files
mdrustaddavem330
authored andcommitted
genl_magic: Resolve logical-op warnings
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>
1 parent e53da5f commit db404b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/genl_magic_func.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ static int s_name ## _from_attrs_for_change(struct s_name *s, \
178178
#define __assign(attr_nr, attr_flag, name, nla_type, type, assignment...) \
179179
nla = ntb[attr_nr]; \
180180
if (nla) { \
181-
if (exclude_invariants && ((attr_flag) & DRBD_F_INVARIANT)) { \
181+
if (exclude_invariants && !!((attr_flag) & DRBD_F_INVARIANT)) { \
182182
pr_info("<< must not change invariant attr: %s\n", #name); \
183183
return -EEXIST; \
184184
} \
185185
assignment; \
186-
} else if (exclude_invariants && ((attr_flag) & DRBD_F_INVARIANT)) { \
186+
} else if (exclude_invariants && !!((attr_flag) & DRBD_F_INVARIANT)) { \
187187
/* attribute missing from payload, */ \
188188
/* which was expected */ \
189189
} else if ((attr_flag) & DRBD_F_REQUIRED) { \

0 commit comments

Comments
 (0)