[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 3/8] hw/timer/sh_timer: Silence warnings about missing fallthrough
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 3/8] hw/timer/sh_timer: Silence warnings about missing fallthrough statements |
Date: |
Tue, 27 Oct 2020 00:29:30 +0100 |
From: Thomas Huth <thuth@redhat.com>
When compiling with -Werror=implicit-fallthrough, gcc complains about
missing fallthrough annotations in this file. Looking at the code,
the fallthrough is very likely intended here, so add some comments
to silence the compiler warnings.
Fixes: cd1a3f6840e ("Stand-alone TMU emulation code")
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20201020153935.54315-3-thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/timer/sh_timer.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c
index b09e30f9388..934daaa7dcc 100644
--- a/hw/timer/sh_timer.c
+++ b/hw/timer/sh_timer.c
@@ -122,6 +122,7 @@ static void sh_timer_write(void *opaque, hwaddr offset,
if (s->feat & TIMER_FEAT_EXTCLK) {
break;
}
+ /* fallthrough */
default:
hw_error("sh_timer_write: Reserved TPSC value\n");
break;
@@ -135,6 +136,7 @@ static void sh_timer_write(void *opaque, hwaddr offset,
if (s->feat & TIMER_FEAT_EXTCLK) {
break;
}
+ /* fallthrough */
default:
hw_error("sh_timer_write: Reserved CKEG value\n");
break;
@@ -147,6 +149,7 @@ static void sh_timer_write(void *opaque, hwaddr offset,
if (s->feat & TIMER_FEAT_CAPT) {
break;
}
+ /* fallthrough */
default:
hw_error("sh_timer_write: Reserved ICPE value\n");
break;
@@ -180,6 +183,7 @@ static void sh_timer_write(void *opaque, hwaddr offset,
s->tcpr = value;
break;
}
+ /* fallthrough */
default:
hw_error("sh_timer_write: Bad offset %x\n", (int)offset);
}
--
2.26.2
- [PULL 0/8] Renesas patches for 2020-10-27, Philippe Mathieu-Daudé, 2020/10/26
- [PULL 1/8] elf: Add EM_RX definition, Philippe Mathieu-Daudé, 2020/10/26
- [PULL 3/8] hw/timer/sh_timer: Silence warnings about missing fallthrough statements,
Philippe Mathieu-Daudé <=
- [PULL 2/8] hw/timer/sh_timer: Coding style clean-up, Philippe Mathieu-Daudé, 2020/10/26
- [PULL 4/8] hw/timer/sh_timer: Remove superfluous "break" statements, Philippe Mathieu-Daudé, 2020/10/26
- [PULL 5/8] target/sh4: Update coding style to make checkpatch.pl happy, Philippe Mathieu-Daudé, 2020/10/26
- [PULL 6/8] target/sh4: fix some comment spelling errors, Philippe Mathieu-Daudé, 2020/10/26
- [PULL 7/8] target/rx: Fix some comment spelling errors, Philippe Mathieu-Daudé, 2020/10/26
- [PULL 8/8] target/rx: Fix Lesser GPL version number, Philippe Mathieu-Daudé, 2020/10/26
- Re: [PULL 0/8] Renesas patches for 2020-10-27, Peter Maydell, 2020/10/28