From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Jason Wang" <jasowang@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
qemu-arm@nongnu.org, "Peter Chubb" <peter.chubb@nicta.com.au>,
"Aleksandar Markovic" <amarkovic@wavecomp.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [PATCH v2 4/6] hw/net/imx_fec: Rewrite fall through comments
Date: Wed, 18 Dec 2019 20:25:24 +0100 [thread overview]
Message-ID: <20191218192526.13845-5-philmd@redhat.com> (raw)
In-Reply-To: <20191218192526.13845-1-philmd@redhat.com>
GCC9 is confused by this comment when building with CFLAG
-Wimplicit-fallthrough=2:
hw/net/imx_fec.c: In function ‘imx_eth_write’:
hw/net/imx_fec.c:906:12: error: this statement may fall through [-Werror=implicit-fallthrough=]
906 | if (unlikely(single_tx_ring)) {
| ^
hw/net/imx_fec.c:912:5: note: here
912 | case ENET_TDAR: /* FALLTHROUGH */
| ^~~~
cc1: all warnings being treated as errors
Rewrite the comments in the correct place, using 'fall through'
which is recognized by GCC and static analyzers.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
Cc: Peter Chubb <peter.chubb@nicta.com.au>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Jason Wang <jasowang@redhat.com>
Cc: qemu-arm@nongnu.org
---
hw/net/imx_fec.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c
index bd99236864..c01ce4f078 100644
--- a/hw/net/imx_fec.c
+++ b/hw/net/imx_fec.c
@@ -909,7 +909,8 @@ static void imx_eth_write(void *opaque, hwaddr offset, uint64_t value,
TYPE_IMX_FEC, __func__);
return;
}
- case ENET_TDAR: /* FALLTHROUGH */
+ /* fall through */
+ case ENET_TDAR:
if (s->regs[ENET_ECR] & ENET_ECR_ETHEREN) {
s->regs[index] = ENET_TDAR_TDAR;
imx_eth_do_tx(s, index);
--
2.21.0
next prev parent reply other threads:[~2019-12-18 19:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-18 19:25 [PATCH v2 0/6] Fix more GCC9 -O3 warnings Philippe Mathieu-Daudé
2019-12-18 19:25 ` [PATCH v2 1/6] audio/audio: Add missing fall through comment Philippe Mathieu-Daudé
2019-12-18 19:36 ` Aleksandar Markovic
2020-01-07 7:22 ` Gerd Hoffmann
2019-12-18 19:25 ` [PATCH v2 2/6] hw/display/tcx: Add missing fall through comments Philippe Mathieu-Daudé
2019-12-18 19:36 ` Aleksandar Markovic
2019-12-22 11:12 ` Mark Cave-Ayland
2019-12-18 19:25 ` [PATCH v2 3/6] hw/timer/aspeed_timer: Add a fall through comment Philippe Mathieu-Daudé
2019-12-18 19:25 ` Philippe Mathieu-Daudé [this message]
2019-12-18 19:36 ` [PATCH v2 4/6] hw/net/imx_fec: Rewrite fall through comments Thomas Huth
2019-12-18 19:25 ` [RFC PATCH v2 5/6] hw/net/imx_fec: Remove unuseful FALLTHROUGH comments Philippe Mathieu-Daudé
2019-12-18 19:28 ` Thomas Huth
2019-12-18 19:35 ` Aleksandar Markovic
2019-12-18 20:30 ` Richard Henderson
2019-12-18 19:25 ` [RFC PATCH v2 6/6] hw/pci-host/designware: Remove unuseful FALLTHROUGH comment Philippe Mathieu-Daudé
2019-12-18 19:32 ` Thomas Huth
2019-12-18 19:35 ` Aleksandar Markovic
2019-12-18 20:31 ` Richard Henderson
2019-12-18 21:28 ` Aleksandar Markovic
2020-01-17 16:55 ` [PATCH v2 0/6] Fix more GCC9 -O3 warnings 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=20191218192526.13845-5-philmd@redhat.com \
--to=philmd@redhat.com \
--cc=amarkovic@wavecomp.com \
--cc=jasowang@redhat.com \
--cc=peter.chubb@nicta.com.au \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/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).