qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ds1338: Add missing break statement
@ 2012-02-25 13:50 Stefan Weil
  2012-02-25 16:06 ` Peter Maydell
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Stefan Weil @ 2012-02-25 13:50 UTC (permalink / raw)
  To: Paul Brook; +Cc: Stefan Weil, qemu-devel

Without the break statement, case 5 sets month and year from the same
data. This does not look correct.

The missing break was reported by splint.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 hw/ds1338.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/ds1338.c b/hw/ds1338.c
index 6397f0a..d590d9c 100644
--- a/hw/ds1338.c
+++ b/hw/ds1338.c
@@ -100,6 +100,7 @@ static int ds1338_send(I2CSlave *i2c, uint8_t data)
             break;
         case 5:
             s->now.tm_mon = from_bcd(data & 0x1f) - 1;
+            break;
         case 6:
             s->now.tm_year = from_bcd(data) + 100;
             break;
-- 
1.7.9

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] ds1338: Add missing break statement
  2012-02-25 13:50 [Qemu-devel] [PATCH] ds1338: Add missing break statement Stefan Weil
@ 2012-02-25 16:06 ` Peter Maydell
  2012-03-10 19:20 ` Stefan Weil
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2012-02-25 16:06 UTC (permalink / raw)
  To: Stefan Weil; +Cc: Paul Brook, qemu-devel

On 25 February 2012 13:50, Stefan Weil <sw@weilnetz.de> wrote:
> Without the break statement, case 5 sets month and year from the same
> data. This does not look correct.

Yep, looks like a simple missing break, checked against the
datasheet at http://datasheets.maxim-ic.com/en/ds/DS1338-DS1338Z.pdf

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] ds1338: Add missing break statement
  2012-02-25 13:50 [Qemu-devel] [PATCH] ds1338: Add missing break statement Stefan Weil
  2012-02-25 16:06 ` Peter Maydell
@ 2012-03-10 19:20 ` Stefan Weil
  2012-03-10 20:34 ` Andreas Färber
  2012-03-15 10:16 ` Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Weil @ 2012-03-10 19:20 UTC (permalink / raw)
  To: Paul Brook; +Cc: qemu-trivial, Anthony Liguori, qemu-devel, jforbes

Am 25.02.2012 14:50, schrieb Stefan Weil:
> Without the break statement, case 5 sets month and year from the same
> data. This does not look correct.
>
> The missing break was reported by splint.
>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
> hw/ds1338.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/hw/ds1338.c b/hw/ds1338.c
> index 6397f0a..d590d9c 100644
> --- a/hw/ds1338.c
> +++ b/hw/ds1338.c
> @@ -100,6 +100,7 @@ static int ds1338_send(I2CSlave *i2c, uint8_t data)
> break;
> case 5:
> s->now.tm_mon = from_bcd(data & 0x1f) - 1;
> + break;
> case 6:
> s->now.tm_year = from_bcd(data) + 100;
> break;

Ping. This is a simple bug fix. It was reviewed by Peter Maydell (thanks!).
Could someone please commit it to QEMU master (maybe to stable-1.0, too)?

Regards,
Stefan Weil

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] ds1338: Add missing break statement
  2012-02-25 13:50 [Qemu-devel] [PATCH] ds1338: Add missing break statement Stefan Weil
  2012-02-25 16:06 ` Peter Maydell
  2012-03-10 19:20 ` Stefan Weil
@ 2012-03-10 20:34 ` Andreas Färber
  2012-03-15 10:16 ` Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Andreas Färber @ 2012-03-10 20:34 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-trivial, Paul Brook, qemu-devel

Am 25.02.2012 14:50, schrieb Stefan Weil:
> Without the break statement, case 5 sets month and year from the same
> data. This does not look correct.
> 
> The missing break was reported by splint.
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>

Assigning data to both month and year certainly makes no sense,

Reviewed-by: Andreas Färber <afaerber@suse.de>

Andreas

> ---
>  hw/ds1338.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/ds1338.c b/hw/ds1338.c
> index 6397f0a..d590d9c 100644
> --- a/hw/ds1338.c
> +++ b/hw/ds1338.c
> @@ -100,6 +100,7 @@ static int ds1338_send(I2CSlave *i2c, uint8_t data)
>              break;
>          case 5:
>              s->now.tm_mon = from_bcd(data & 0x1f) - 1;
> +            break;
>          case 6:
>              s->now.tm_year = from_bcd(data) + 100;
>              break;

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] ds1338: Add missing break statement
  2012-02-25 13:50 [Qemu-devel] [PATCH] ds1338: Add missing break statement Stefan Weil
                   ` (2 preceding siblings ...)
  2012-03-10 20:34 ` Andreas Färber
@ 2012-03-15 10:16 ` Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2012-03-15 10:16 UTC (permalink / raw)
  To: Stefan Weil; +Cc: Paul Brook, qemu-devel

On Sat, Feb 25, 2012 at 02:50:25PM +0100, Stefan Weil wrote:
> Without the break statement, case 5 sets month and year from the same
> data. This does not look correct.
> 
> The missing break was reported by splint.
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>  hw/ds1338.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)

Sorry, looks like I missed a couple of your patches in my inbox.

Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches

Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-15 10:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-25 13:50 [Qemu-devel] [PATCH] ds1338: Add missing break statement Stefan Weil
2012-02-25 16:06 ` Peter Maydell
2012-03-10 19:20 ` Stefan Weil
2012-03-10 20:34 ` Andreas Färber
2012-03-15 10:16 ` Stefan Hajnoczi

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).