Skip to content

Commit

Permalink
xilinx_axienet: Fix bit mask code
Browse files Browse the repository at this point in the history
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 <sw@weilnetz.de>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
  • Loading branch information
stweil authored and edgarigl committed Jun 10, 2013
1 parent 7387de1 commit 4e298e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/net/xilinx_axienet.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 4e298e4

Please sign in to comment.