]> git.proxmox.com Git - mirror_qemu.git/commitdiff
etraxfs_eth: correct use of ! and &
authorBlue Swirl <blauwirbel@gmail.com>
Thu, 26 Aug 2010 18:04:18 +0000 (18:04 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Thu, 26 Aug 2010 18:04:18 +0000 (18:04 +0000)
Combining bitwise AND and logical NOT is suspicious.

Fixed by this Coccinelle script:
// From http://article.gmane.org/gmane.linux.kernel/646367
@@ expression E1,E2; @@
(
 !E1 & !E2
|
- !E1 & E2
+ !(E1 & E2)
)

Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hw/etraxfs_eth.c

index b897c9c16760973ebfa1660ccd63f21500725339..ade96f14ac02b17afd96713cff670ccb61ebe191 100644 (file)
@@ -464,7 +464,7 @@ static int eth_match_groupaddr(struct fs_eth *eth, const unsigned char *sa)
 
        /* First bit on the wire of a MAC address signals multicast or
           physical address.  */
-       if (!m_individual && !sa[0] & 1)
+       if (!m_individual && !(sa[0] & 1))
                return 0;
 
        /* Calculate the hash index for the GA registers. */