]> Git Repo - qemu.git/commitdiff
xilinx_axienet: Fix bit mask code
authorStefan Weil <[email protected]>
Sun, 9 Jun 2013 20:56:20 +0000 (22:56 +0200)
committerEdgar E. Iglesias <[email protected]>
Mon, 10 Jun 2013 11:00:41 +0000 (13:00 +0200)
Obviously the code wanted to mask the lower bits but failed to do so
because of a missing "<".

cppcheck detected a conditional expression which was always true (1 < 7).

Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Edgar E. Iglesias <[email protected]>
hw/net/xilinx_axienet.c

index 8989e95297df5ad32d61f8a030a58d0fe8d555f2..2ca1511c06045f8f738b9a466764f572534d9418 100644 (file)
@@ -575,7 +575,7 @@ static void enet_write(void *opaque, hwaddr addr,
             break;
 
         case R_MC:
-             value &= ((1 < 7) - 1);
+             value &= ((1 << 7) - 1);
 
              /* Enable the MII.  */
              if (value & MC_EN) {
This page took 0.026035 seconds and 4 git commands to generate.