Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mark Rustad and committed by
David S. Miller
db404b13 e53da5fb

+2 -2
+2 -2
include/linux/genl_magic_func.h
··· 178 178 #define __assign(attr_nr, attr_flag, name, nla_type, type, assignment...) \ 179 179 nla = ntb[attr_nr]; \ 180 180 if (nla) { \ 181 - if (exclude_invariants && ((attr_flag) & DRBD_F_INVARIANT)) { \ 181 + if (exclude_invariants && !!((attr_flag) & DRBD_F_INVARIANT)) { \ 182 182 pr_info("<< must not change invariant attr: %s\n", #name); \ 183 183 return -EEXIST; \ 184 184 } \ 185 185 assignment; \ 186 - } else if (exclude_invariants && ((attr_flag) & DRBD_F_INVARIANT)) { \ 186 + } else if (exclude_invariants && !!((attr_flag) & DRBD_F_INVARIANT)) { \ 187 187 /* attribute missing from payload, */ \ 188 188 /* which was expected */ \ 189 189 } else if ((attr_flag) & DRBD_F_REQUIRED) { \