[PATCH] hw/arm/highbank: Silence warnings about missing fallthrough statements

Thomas Huth posted 1 patch 3 years, 6 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201020105938.23209-1-thuth@redhat.com
Maintainers: Rob Herring <robh@kernel.org>, Peter Maydell <peter.maydell@linaro.org>
hw/arm/highbank.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH] hw/arm/highbank: Silence warnings about missing fallthrough statements
Posted by Thomas Huth 3 years, 6 months ago
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.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/arm/highbank.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index da0510d7ce..f71087860d 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -92,10 +92,12 @@ static void hb_reset_secondary(ARMCPU *cpu, const struct arm_boot_info *info)
         address_space_stl_notdirty(&address_space_memory,
                                    SMP_BOOT_REG + 0x30, 0,
                                    MEMTXATTRS_UNSPECIFIED, NULL);
+        /* fallthrough */
     case 3:
         address_space_stl_notdirty(&address_space_memory,
                                    SMP_BOOT_REG + 0x20, 0,
                                    MEMTXATTRS_UNSPECIFIED, NULL);
+        /* fallthrough */
     case 2:
         address_space_stl_notdirty(&address_space_memory,
                                    SMP_BOOT_REG + 0x10, 0,
-- 
2.18.2


Re: [PATCH] hw/arm/highbank: Silence warnings about missing fallthrough statements
Posted by Peter Maydell 3 years, 6 months ago
On Tue, 20 Oct 2020 at 11:59, Thomas Huth <thuth@redhat.com> wrote:
>
> 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.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  hw/arm/highbank.c | 2 ++
>  1 file changed, 2 insertions(+)


Applied to target-arm.next, thanks.

-- PMM