From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ulzv1-0000nx-Am for qemu-devel@nongnu.org; Mon, 10 Jun 2013 07:05:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ulzv0-0001Rc-0I for qemu-devel@nongnu.org; Mon, 10 Jun 2013 07:05:47 -0400 Received: from mail-ea0-x231.google.com ([2a00:1450:4013:c01::231]:63186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ulzuz-0001RM-Ij for qemu-devel@nongnu.org; Mon, 10 Jun 2013 07:05:45 -0400 Received: by mail-ea0-f177.google.com with SMTP id j14so5276580eak.36 for ; Mon, 10 Jun 2013 04:05:44 -0700 (PDT) Date: Mon, 10 Jun 2013 13:05:28 +0200 From: "Edgar E. Iglesias" Message-ID: <20130610110528.GB5991@smtp.vpn> References: <1370811380-32554-1-git-send-email-sw@weilnetz.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1370811380-32554-1-git-send-email-sw@weilnetz.de> Subject: Re: [Qemu-devel] [PATCH] xilinx_axienet: Fix bit mask code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Peter Crosthwaite , qemu-devel 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 > --- > > 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 >