]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Fix dubious uses of bitwise operators
authorMichael Brown <mcb30@ipxe.org>
Sun, 28 Apr 2013 16:30:01 +0000 (17:30 +0100)
committerMichael Brown <mcb30@ipxe.org>
Sun, 28 Apr 2013 16:31:23 +0000 (17:31 +0100)
Detected by sparse.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/rtl818x/rtl8185_rtl8225.c
src/net/fcoe.c

index 50cc84addd247287522e2ae53346c034e2d6aaf5..ae92531ce41f7bc1586d7dbc701890aaccaf26ae 100644 (file)
@@ -71,7 +71,7 @@ static void rtl8225_write(struct net80211_device *dev, u8 addr, u16 data)
        udelay(10);
 
        for (i = 15; i >= 0; i--) {
-               u16 reg = reg80 | !!(bangdata & (1 << i));
+               u16 reg = ( reg80 | ( ( bangdata >> i ) & 1 ) );
 
                if (i & 1)
                        rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg);
index d11304258fba0073f204dc7d9b4e36bcb06199f3..e9e404ec34c71e29709e22f9030a77ad53d805c0 100644 (file)
@@ -1011,7 +1011,7 @@ static void fcoe_expired ( struct retry_timer *timer, int over __unused ) {
        /* Increment the timeout counter */
        fcoe->timeouts++;
 
-       if ( vlan_can_be_trunk ( fcoe->netdev ) &
+       if ( vlan_can_be_trunk ( fcoe->netdev ) &&
             ! ( fcoe->flags & FCOE_VLAN_TIMED_OUT ) ) {
 
                /* If we have already found a VLAN, send infrequent