From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Stefan Weil <sw@weilnetz.de>
Cc: Peter Crosthwaite <peter.crosthwaite@petalogix.com>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] xilinx_axienet: Fix bit mask code
Date: Mon, 10 Jun 2013 13:05:28 +0200 [thread overview]
Message-ID: <20130610110528.GB5991@smtp.vpn> (raw)
In-Reply-To: <1370811380-32554-1-git-send-email-sw@weilnetz.de>
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 <sw@weilnetz.de>
> ---
>
> 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
>
prev parent reply other threads:[~2013-06-10 11:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-09 20:56 [Qemu-devel] [PATCH] xilinx_axienet: Fix bit mask code Stefan Weil
2013-06-09 21:22 ` Peter Maydell
2013-06-10 11:05 ` Edgar E. Iglesias [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130610110528.GB5991@smtp.vpn \
--to=edgar.iglesias@gmail.com \
--cc=peter.crosthwaite@petalogix.com \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).