kern: Fix [-Werror=logical-not-parenthesis]
authorJohn Marino <draco@marino.st>
Wed, 11 Feb 2015 01:48:43 +0000 (02:48 +0100)
committerJohn Marino <draco@marino.st>
Wed, 11 Feb 2015 01:48:43 +0000 (02:48 +0100)
Since the whole point of this error is that logic order can be
ambiguous, I'm not 100% sure confident in these fixes, but they are
required to get the kernel to build with gcc 5.0.

sys/dev/drm/i915/i915_gem_tiling.c
sys/dev/drm/i915/intel_display.c
sys/dev/netif/ix/ixgbe_common.c
sys/netinet6/in6.c

index 64af0a1..a57b15a 100644 (file)
@@ -485,7 +485,7 @@ i915_gem_object_do_bit_17_swizzle(struct drm_i915_gem_object *obj)
        for (i = 0; i < page_count; i++) {
                char new_bit_17 = VM_PAGE_TO_PHYS(obj->pages[i]) >> 17;
                if ((new_bit_17 & 0x1) !=
-                   (test_bit(i, obj->bit_17) != 0)) {
+                   (test_bit(i, obj->bit_17) ? 1 : 0)) {
                        i915_gem_swizzle_page(obj->pages[i]);
                        vm_page_dirty(obj->pages[i]);
                }
index 3cef484..c135942 100644 (file)
@@ -9182,7 +9182,7 @@ intel_check_plane_mapping(struct intel_crtc *crtc)
        val = I915_READ(reg);
 
        if ((val & DISPLAY_PLANE_ENABLE) &&
-           (!!(val & DISPPLANE_SEL_PIPE_MASK) == crtc->pipe))
+           (!!( (val & DISPPLANE_SEL_PIPE_MASK) == crtc->pipe) ))
                return false;
 
        return true;
index bd1f5bf..c6927a3 100644 (file)
@@ -2886,8 +2886,8 @@ static s32 ixgbe_fc_autoneg_fiber(struct ixgbe_hw *hw)
         */
 
        linkstat = IXGBE_READ_REG(hw, IXGBE_PCS1GLSTA);
-       if ((!!(linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE) == 0) ||
-           (!!(linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT) == 1)) {
+       if (((linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE) == 0) ||
+           ((linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT) == 1)) {
                ERROR_REPORT1(IXGBE_ERROR_POLLING,
                             "Auto-Negotiation did not complete or timed out");
                goto out;
index 3447766..2aee04e 100644 (file)
@@ -2142,7 +2142,7 @@ in6_ifawithscope(struct ifnet *oifp, struct in6_addr *dst, struct ucred *cred)
 
                        /* Skip adresses not valid for current jail */
                        if (jailed &&
-                           !jailed_ip(cred->cr_prison, (struct sockaddr *)(ifa->ifa_addr)) != 0)
+                           !(jailed_ip(cred->cr_prison, (struct sockaddr *)(ifa->ifa_addr)) != 0))
                                continue;
 
                        /*