From: Sascha Wildner Date: Thu, 6 Sep 2018 00:57:10 +0000 (+0200) Subject: kernel: Fix some -Wint-in-bool-context warnings. X-Git-Tag: v5.5.0~229 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/9e2814118aabe1f24cf0048501b294f73e8c15e9 kernel: Fix some -Wint-in-bool-context warnings. I.e., stop treating integers like booleans. In ix(4) I commented out a problematic function that returns bool but tries to return -1 if there was an error. --- diff --git a/sys/dev/netif/ix/ixgbe_api.c b/sys/dev/netif/ix/ixgbe_api.c index 5d6efac507..4a1dbe6da5 100644 --- a/sys/dev/netif/ix/ixgbe_api.c +++ b/sys/dev/netif/ix/ixgbe_api.c @@ -1335,6 +1335,7 @@ s32 ixgbe_bypass_rw(struct ixgbe_hw *hw, u32 cmd, u32 *status) IXGBE_NOT_IMPLEMENTED); } +#if 0 /** * ixgbe_bypass_valid_rd - Verify valid return from bit-bang. * @@ -1352,6 +1353,7 @@ bool ixgbe_bypass_valid_rd(struct ixgbe_hw *hw, u32 in_reg, u32 out_reg) return ixgbe_call_func(hw, hw->mac.ops.bypass_valid_rd, (in_reg, out_reg), IXGBE_NOT_IMPLEMENTED); } +#endif /** * ixgbe_bypass_set - Set a bypass field in the FW CTRL Regiter. diff --git a/sys/dev/netif/ix/ixgbe_api.h b/sys/dev/netif/ix/ixgbe_api.h index 926273405b..d240ae6b2c 100644 --- a/sys/dev/netif/ix/ixgbe_api.h +++ b/sys/dev/netif/ix/ixgbe_api.h @@ -199,7 +199,9 @@ s32 ixgbe_get_fcoe_boot_status(struct ixgbe_hw *hw, u16 *bs); s32 ixgbe_bypass_rw(struct ixgbe_hw *hw, u32 cmd, u32 *status); s32 ixgbe_bypass_set(struct ixgbe_hw *hw, u32 cmd, u32 event, u32 action); s32 ixgbe_bypass_rd_eep(struct ixgbe_hw *hw, u32 addr, u8 *value); +#if 0 bool ixgbe_bypass_valid_rd(struct ixgbe_hw *hw, u32 in_reg, u32 out_reg); +#endif s32 ixgbe_dmac_config(struct ixgbe_hw *hw); s32 ixgbe_dmac_update_tcs(struct ixgbe_hw *hw); s32 ixgbe_dmac_config_tcs(struct ixgbe_hw *hw); diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 89c5e9cc9b..6664bd8844 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1072,8 +1072,8 @@ fail: } #define rtinitflags(x) \ - (((x)->ia_ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT)) \ - ? RTF_HOST : 0) + ((((x)->ia_ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT)) != 0) \ + ? RTF_HOST : 0) /* * Add a route to prefix ("connected route" in cisco terminology).