* [net] genl_magic: Resolve logical-op warnings
@ 2014-10-14 13:28 Jeff Kirsher
2014-10-14 21:04 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Kirsher @ 2014-10-14 13:28 UTC (permalink / raw)
To: davem; +Cc: Mark Rustad, linux-kernel, johannes.berg, netdev, Jeff Kirsher
From: Mark Rustad <mark.d.rustad@intel.com>
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>
---
include/linux/genl_magic_func.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/genl_magic_func.h b/include/linux/genl_magic_func.h
index c0894dd..667c311 100644
--- a/include/linux/genl_magic_func.h
+++ b/include/linux/genl_magic_func.h
@@ -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) { \
--
1.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [net] genl_magic: Resolve logical-op warnings
2014-10-14 13:28 [net] genl_magic: Resolve logical-op warnings Jeff Kirsher
@ 2014-10-14 21:04 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-10-14 21:04 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: mark.d.rustad, linux-kernel, johannes.berg, netdev
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 14 Oct 2014 06:28:38 -0700
> From: Mark Rustad <mark.d.rustad@intel.com>
>
> 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>
Applied, thanks Jeff.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-14 21:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-14 13:28 [net] genl_magic: Resolve logical-op warnings Jeff Kirsher
2014-10-14 21:04 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.