qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Vasily Khoruzhick <anarsoul@gmail.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] Fix obvious mistake in pxa2xx i2s driver
Date: Sun, 20 Feb 2011 19:24:46 +0100	[thread overview]
Message-ID: <20110220182446.GU18619@volta.aurel32.net> (raw)
In-Reply-To: <1297702750-32203-1-git-send-email-anarsoul@gmail.com>

On Mon, Feb 14, 2011 at 06:59:10PM +0200, Vasily Khoruzhick wrote:
> RST bit is (1 << 3) bit, not (1 << 2), fix condition
> that enables i2s if ENB is set and RST is not set.
> 
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---
>  hw/pxa2xx.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c
> index d966846..68b67ae 100644
> --- a/hw/pxa2xx.c
> +++ b/hw/pxa2xx.c
> @@ -1631,7 +1631,7 @@ static void pxa2xx_i2s_write(void *opaque, target_phys_addr_t addr,
>          }
>          if (value & (1 << 4))				/* EFWR */
>              printf("%s: Attempt to use special function\n", __FUNCTION__);
> -        s->enable = ((value ^ 4) & 5) == 5;		/* ENB && !RST*/
> +        s->enable = ((value ^ (1 << 3)) & 9) == 9;		/* ENB && !RST*/
>          pxa2xx_i2s_update(s);
>          break;
>      case SACR1:

The fix looks fine, but the resulting code is probably over
engineered... What about:

         s->enable = (value & 9) == 1;

?

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

  parent reply	other threads:[~2011-02-20 18:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-14 16:59 [Qemu-devel] [PATCH] Fix obvious mistake in pxa2xx i2s driver Vasily Khoruzhick
2011-02-20 14:19 ` [Qemu-devel] " Vasily Khoruzhick
2011-02-20 18:24 ` Aurelien Jarno [this message]
2011-02-20 18:39   ` [Qemu-devel] " Vasily Khoruzhick
2011-02-20 18:45     ` Aurelien Jarno
2011-02-20 19:23       ` [Qemu-devel] [PATCH v2] " Vasily Khoruzhick
2011-02-20 19:29         ` [Qemu-devel] " Aurelien Jarno

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=20110220182446.GU18619@volta.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=anarsoul@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /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).