qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Yoshinori Sato <ysato@users.sourceforge.jp>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Magnus Damm <magnus.damm@gmail.com>
Subject: [PATCH 2/3] hw/timer/sh_timer: Silence warnings about missing fallthrough statements
Date: Tue, 20 Oct 2020 17:39:34 +0200	[thread overview]
Message-ID: <20201020153935.54315-3-thuth@redhat.com> (raw)
In-Reply-To: <20201020153935.54315-1-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.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 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 b09e30f938..934daaa7dc 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.18.2



  parent reply	other threads:[~2020-10-20 15:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-20 15:39 [PATCH 0/3] sh4: Trivial clean-ups for sh_timer.c Thomas Huth
2020-10-20 15:39 ` [PATCH 1/3] hw/timer/sh_timer: Coding style clean-up Thomas Huth
2020-10-24 20:06   ` Philippe Mathieu-Daudé
2020-10-20 15:39 ` Thomas Huth [this message]
2020-10-24 20:10   ` [PATCH 2/3] hw/timer/sh_timer: Silence warnings about missing fallthrough statements Philippe Mathieu-Daudé
2020-10-20 15:39 ` [PATCH 3/3] hw/timer/sh_timer: Remove superfluous "break" statements Thomas Huth
2020-10-24 20:10   ` Philippe Mathieu-Daudé
2020-10-21 16:48 ` [PATCH 0/3] sh4: Trivial clean-ups for sh_timer.c Richard Henderson
2020-10-25  0:38 ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201020153935.54315-3-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=magnus.damm@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=ysato@users.sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).