* [PATCH] hw/rtc/twl92230: Add missing 'break'
@ 2020-12-11 15:46 Philippe Mathieu-Daudé
2020-12-11 15:48 ` Peter Maydell
2020-12-11 15:53 ` Thomas Huth
0 siblings, 2 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-12-11 15:46 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Thomas Huth, qemu-trivial,
Philippe Mathieu-Daudé, qemu-arm
Add missing 'break' to fix:
hw/rtc/twl92230.c: In function ‘menelaus_write’:
hw/rtc/twl92230.c:713:5: error: label at end of compound statement
713 | default:
| ^~~~~~~
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
I noticed Thomas "Compile QEMU with -Wimplicit-fallthrough" series
and remembered this old patch.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/rtc/twl92230.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/rtc/twl92230.c b/hw/rtc/twl92230.c
index f838913b378..28656cb0e59 100644
--- a/hw/rtc/twl92230.c
+++ b/hw/rtc/twl92230.c
@@ -714,6 +714,7 @@ static void menelaus_write(void *opaque, uint8_t addr, uint8_t value)
#ifdef VERBOSE
printf("%s: unknown register %02x\n", __func__, addr);
#endif
+ break;
}
}
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/rtc/twl92230: Add missing 'break'
2020-12-11 15:46 [PATCH] hw/rtc/twl92230: Add missing 'break' Philippe Mathieu-Daudé
@ 2020-12-11 15:48 ` Peter Maydell
2020-12-11 15:53 ` Thomas Huth
1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2020-12-11 15:48 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: QEMU Trivial, Thomas Huth, qemu-arm, QEMU Developers
On Fri, 11 Dec 2020 at 15:46, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Add missing 'break' to fix:
>
> hw/rtc/twl92230.c: In function ‘menelaus_write’:
> hw/rtc/twl92230.c:713:5: error: label at end of compound statement
> 713 | default:
> | ^~~~~~~
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> I noticed Thomas "Compile QEMU with -Wimplicit-fallthrough" series
> and remembered this old patch.
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> hw/rtc/twl92230.c | 1 +
> 1 file changed, 1 insertion(+)
I guess the compiler doesn't care about missing 'break' in
the last case in a switch statement. But I think putting in
the 'break' is better style anyway.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/rtc/twl92230: Add missing 'break'
2020-12-11 15:46 [PATCH] hw/rtc/twl92230: Add missing 'break' Philippe Mathieu-Daudé
2020-12-11 15:48 ` Peter Maydell
@ 2020-12-11 15:53 ` Thomas Huth
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Huth @ 2020-12-11 15:53 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: qemu-trivial, Peter Maydell, qemu-arm
On 11/12/2020 16.46, Philippe Mathieu-Daudé wrote:
> Add missing 'break' to fix:
>
> hw/rtc/twl92230.c: In function ‘menelaus_write’:
> hw/rtc/twl92230.c:713:5: error: label at end of compound statement
> 713 | default:
> | ^~~~~~~
... which occurs when disabling the "VERBOSE" switch in this file (that is
enabled by default - that's why we've not noticed this before).
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> I noticed Thomas "Compile QEMU with -Wimplicit-fallthrough" series
> and remembered this old patch.
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> hw/rtc/twl92230.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/rtc/twl92230.c b/hw/rtc/twl92230.c
> index f838913b378..28656cb0e59 100644
> --- a/hw/rtc/twl92230.c
> +++ b/hw/rtc/twl92230.c
> @@ -714,6 +714,7 @@ static void menelaus_write(void *opaque, uint8_t addr, uint8_t value)
> #ifdef VERBOSE
> printf("%s: unknown register %02x\n", __func__, addr);
> #endif
> + break;
> }
> }
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-11 16:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-11 15:46 [PATCH] hw/rtc/twl92230: Add missing 'break' Philippe Mathieu-Daudé
2020-12-11 15:48 ` Peter Maydell
2020-12-11 15:53 ` Thomas Huth
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).