WAN: bit and/or confusion
authorroel kluin <roel.kluin@gmail.com>
Thu, 20 Aug 2009 04:04:40 +0000 (04:04 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 31 Aug 2009 05:02:26 +0000 (22:02 -0700)
Fix the tests that check whether Frame* bits are not set

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wan/dscc4.c

index e81946d985431e839693cbaf41415732c6557250..cc00e0f89ecb331a856bce843f4a251c1f8e4278 100644 (file)
@@ -663,12 +663,12 @@ static inline void dscc4_rx_skb(struct dscc4_dev_priv *dpriv,
        } else {
                if (skb->data[pkt_len] & FrameRdo)
                        dev->stats.rx_fifo_errors++;
-               else if (!(skb->data[pkt_len] | ~FrameCrc))
+               else if (!(skb->data[pkt_len] FrameCrc))
                        dev->stats.rx_crc_errors++;
-               else if (!(skb->data[pkt_len] | ~(FrameVfr | FrameRab)))
+               else if ((skb->data[pkt_len] & (FrameVfr | FrameRab)) !=
+                               FrameVfr | FrameRab)
                        dev->stats.rx_length_errors++;
-               else
-                       dev->stats.rx_errors++;
+               dev->stats.rx_errors++;
                dev_kfree_skb_irq(skb);
        }
 refill: