[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] xilinx_axienet: Fix bit mask code
From: |
Edgar E. Iglesias |
Subject: |
Re: [Qemu-devel] [PATCH] xilinx_axienet: Fix bit mask code |
Date: |
Mon, 10 Jun 2013 13:05:28 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sun, Jun 09, 2013 at 10:56:20PM +0200, Stefan Weil wrote:
> 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).
Applied, thanks Stefan
>
> Signed-off-by: Stefan Weil <address@hidden>
> ---
>
> Please review - I did not look for a Xilinx manual to see whether
> the code was correct at all.
>
> Regards,
> Stefan Weil
>
> hw/net/xilinx_axienet.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c
> index 8989e95..2ca1511 100644
> --- a/hw/net/xilinx_axienet.c
> +++ b/hw/net/xilinx_axienet.c
> @@ -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) {
> --
> 1.7.10.4
>