* [Qemu-devel] [PATCH] Fix obvious mistake in pxa2xx i2s driver
@ 2011-02-14 16:59 Vasily Khoruzhick
2011-02-20 14:19 ` [Qemu-devel] " Vasily Khoruzhick
2011-02-20 18:24 ` [Qemu-devel] " Aurelien Jarno
0 siblings, 2 replies; 7+ messages in thread
From: Vasily Khoruzhick @ 2011-02-14 16:59 UTC (permalink / raw)
To: qemu-devel@nongnu.org; +Cc: Vasily Khoruzhick
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:
--
1.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] Re: [PATCH] Fix obvious mistake in pxa2xx i2s driver
2011-02-14 16:59 [Qemu-devel] [PATCH] Fix obvious mistake in pxa2xx i2s driver Vasily Khoruzhick
@ 2011-02-20 14:19 ` Vasily Khoruzhick
2011-02-20 18:24 ` [Qemu-devel] " Aurelien Jarno
1 sibling, 0 replies; 7+ messages in thread
From: Vasily Khoruzhick @ 2011-02-20 14:19 UTC (permalink / raw)
To: qemu-devel@nongnu.org
On Monday 14 February 2011 18:59:10 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.
>
Ping
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix obvious mistake in pxa2xx i2s driver
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
2011-02-20 18:39 ` Vasily Khoruzhick
1 sibling, 1 reply; 7+ messages in thread
From: Aurelien Jarno @ 2011-02-20 18:24 UTC (permalink / raw)
To: Vasily Khoruzhick; +Cc: qemu-devel@nongnu.org
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix obvious mistake in pxa2xx i2s driver
2011-02-20 18:24 ` [Qemu-devel] " Aurelien Jarno
@ 2011-02-20 18:39 ` Vasily Khoruzhick
2011-02-20 18:45 ` Aurelien Jarno
0 siblings, 1 reply; 7+ messages in thread
From: Vasily Khoruzhick @ 2011-02-20 18:39 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: qemu-devel@nongnu.org
On Sunday 20 February 2011 20:24:46 Aurelien Jarno wrote:
> The fix looks fine, but the resulting code is probably over
> engineered... What about:
>
> s->enable = (value & 9) == 1;
>
> ?
Looks OK to me.
Regards
Vasily
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix obvious mistake in pxa2xx i2s driver
2011-02-20 18:39 ` Vasily Khoruzhick
@ 2011-02-20 18:45 ` Aurelien Jarno
2011-02-20 19:23 ` [Qemu-devel] [PATCH v2] " Vasily Khoruzhick
0 siblings, 1 reply; 7+ messages in thread
From: Aurelien Jarno @ 2011-02-20 18:45 UTC (permalink / raw)
To: Vasily Khoruzhick; +Cc: qemu-devel@nongnu.org
On Sun, Feb 20, 2011 at 08:39:20PM +0200, Vasily Khoruzhick wrote:
> On Sunday 20 February 2011 20:24:46 Aurelien Jarno wrote:
>
> > The fix looks fine, but the resulting code is probably over
> > engineered... What about:
> >
> > s->enable = (value & 9) == 1;
> >
> > ?
>
> Looks OK to me.
>
Can you please provide a new version with that code instead, I'll apply
it.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH v2] Fix obvious mistake in pxa2xx i2s driver
2011-02-20 18:45 ` Aurelien Jarno
@ 2011-02-20 19:23 ` Vasily Khoruzhick
2011-02-20 19:29 ` [Qemu-devel] " Aurelien Jarno
0 siblings, 1 reply; 7+ messages in thread
From: Vasily Khoruzhick @ 2011-02-20 19:23 UTC (permalink / raw)
To: qemu-devel@nongnu.org, Aurelien Jarno; +Cc: Vasily Khoruzhick
RST bit is (1 << 4) bit, not (1 << 3), fix condition
that enables i2s if ENB is set and RST is not set.
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
v2: simplify expression
hw/pxa2xx.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c
index d966846..6e41fc6 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 & 9) == 1; /* ENB && !RST*/
pxa2xx_i2s_update(s);
break;
case SACR1:
--
1.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] Re: [PATCH v2] Fix obvious mistake in pxa2xx i2s driver
2011-02-20 19:23 ` [Qemu-devel] [PATCH v2] " Vasily Khoruzhick
@ 2011-02-20 19:29 ` Aurelien Jarno
0 siblings, 0 replies; 7+ messages in thread
From: Aurelien Jarno @ 2011-02-20 19:29 UTC (permalink / raw)
To: Vasily Khoruzhick; +Cc: qemu-devel@nongnu.org
On Sun, Feb 20, 2011 at 09:23:59PM +0200, Vasily Khoruzhick wrote:
> RST bit is (1 << 4) bit, not (1 << 3), fix condition
> that enables i2s if ENB is set and RST is not set.
>
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---
> v2: simplify expression
>
> hw/pxa2xx.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
Thanks, applied.
> diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c
> index d966846..6e41fc6 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 & 9) == 1; /* ENB && !RST*/
> pxa2xx_i2s_update(s);
> break;
> case SACR1:
> --
> 1.7.4
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-02-20 19:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [Qemu-devel] " Aurelien Jarno
2011-02-20 18:39 ` 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
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).