Linux-Watchdog Archive on
 help / color / Atom feed
From: "Gustavo A. R. Silva" <>
To: Wim Van Sebroeck <>,
	Guenter Roeck <>
	"Gustavo A. R. Silva" <>
Subject: [PATCH] watchdog: machzwd: Mark expected switch fall-through
Date: Wed, 10 Apr 2019 13:49:05 -0500
Message-ID: <20190410184905.GA24283@embeddedor> (raw)

In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.

This patch fixes the following warnings:

drivers/watchdog/machzwd.c: In function ‘zf_set_timer’:
./arch/x86/include/asm/io.h:355:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
 #define outw outw
drivers/watchdog/machzwd.c:80:53: note: in expansion of macro ‘outw’
 #define zf_writew(port, data)  { outb(port, INDEX); outw(data, DATA_W); }
drivers/watchdog/machzwd.c:179:3: note: in expansion of macro ‘zf_writew’
   zf_writew(COUNTER_1, new);
drivers/watchdog/machzwd.c:180:2: note: here
  case WD2:

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enable

Signed-off-by: Gustavo A. R. Silva <>
 drivers/watchdog/machzwd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
index 88d823d87a4b..108928dbc754 100644
--- a/drivers/watchdog/machzwd.c
+++ b/drivers/watchdog/machzwd.c
@@ -177,6 +177,7 @@ static inline void zf_set_timer(unsigned short new, unsigned char n)
 	switch (n) {
 	case WD1:
 		zf_writew(COUNTER_1, new);
+		/* fall through */
 	case WD2:
 		zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);

             reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-10 18:49 Gustavo A. R. Silva [this message]
2019-04-10 20:35 ` Guenter Roeck
2019-04-10 20:51   ` Gustavo A. R. Silva
2019-04-24 17:01     ` Gustavo A. R. Silva
2019-04-24 17:28       ` Guenter Roeck
2019-04-24 17:36         ` Gustavo A. R. Silva

Reply instructions:

You may reply publically 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:

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

  git send-email \
    --in-reply-to=20190410184905.GA24283@embeddedor \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Watchdog Archive on

Archives are clonable:
	git clone --mirror linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ \
	public-inbox-index linux-watchdog

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone