From: David Gibson <david@gibson.dropbear.id.au>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
qemu-block@nongnu.org, Michael Tokarev <mjt@tls.msk.ru>,
qemu-trivial@nongnu.org, Corey Minyard <minyard@acm.org>,
Max Reitz <mreitz@redhat.com>, Laurent Vivier <laurent@vivier.eu>,
Peter Maydell <peter.maydell@linaro.org>,
Kevin Wolf <kwolf@redhat.com>,
qemu-ppc@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Stefan Weil <sw@weilnetz.de>
Subject: Re: [Qemu-trivial] [PATCH-for-4.1? 5/7] target/ppc: Rewrite a fall through comment
Date: Sat, 20 Jul 2019 00:20:13 +1000 [thread overview]
Message-ID: <20190719142013.GA4174@umbus.fritz.box> (raw)
In-Reply-To: <20190719131425.10835-6-philmd@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2322 bytes --]
On Fri, Jul 19, 2019 at 03:14:23PM +0200, Philippe Mathieu-Daudé wrote:
> GCC9 is confused by this comment when building with CFLAG
> -Wimplicit-fallthrough=2:
>
> target/ppc/mmu_helper.c: In function ‘dump_mmu’:
> target/ppc/mmu_helper.c:1349:12: error: this statement may fall through [-Werror=implicit-fallthrough=]
> 1349 | if (ppc64_v3_radix(env_archcpu(env))) {
> | ^
> target/ppc/mmu_helper.c:1356:5: note: here
> 1356 | default:
> | ^~~~~~~
> cc1: all warnings being treated as errors
>
> Rewrite the comment using 'fall through' which is recognized by
> GCC and static analyzers.
>
> Reported-by: Stefan Weil <sw@weilnetz.de>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> target/ppc/mmu_helper.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c
> index 261a8fe707..862824b073 100644
> --- a/target/ppc/mmu_helper.c
> +++ b/target/ppc/mmu_helper.c
> @@ -98,7 +98,7 @@ static int pp_check(int key, int pp, int nx)
> case 0x1:
> case 0x2:
> access |= PAGE_WRITE;
> - /* No break here */
> + /* fall through */
> case 0x3:
> access |= PAGE_READ;
> break;
> @@ -706,7 +706,7 @@ static int mmu40x_get_physical_address(CPUPPCState *env, mmu_ctx_t *ctx,
> if (pr != 0) {
> goto check_perms;
> }
> - /* No break here */
> + /* fall through */
> case 0x3:
> /* All accesses granted */
> ctx->prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
> @@ -720,7 +720,7 @@ static int mmu40x_get_physical_address(CPUPPCState *env, mmu_ctx_t *ctx,
> ret = -2;
> break;
> }
> - /* No break here */
> + /* fall through */
> case 0x1:
> check_perms:
> /* Check from TLB entry */
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: David Gibson <david@gibson.dropbear.id.au>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
qemu-block@nongnu.org, Corey Minyard <minyard@acm.org>,
qemu-trivial@nongnu.org, Stefan Weil <sw@weilnetz.de>,
Michael Tokarev <mjt@tls.msk.ru>,
qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
qemu-ppc@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Max Reitz <mreitz@redhat.com>, Laurent Vivier <laurent@vivier.eu>
Subject: Re: [Qemu-devel] [PATCH-for-4.1? 5/7] target/ppc: Rewrite a fall through comment
Date: Sat, 20 Jul 2019 00:20:13 +1000 [thread overview]
Message-ID: <20190719142013.GA4174@umbus.fritz.box> (raw)
In-Reply-To: <20190719131425.10835-6-philmd@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2322 bytes --]
On Fri, Jul 19, 2019 at 03:14:23PM +0200, Philippe Mathieu-Daudé wrote:
> GCC9 is confused by this comment when building with CFLAG
> -Wimplicit-fallthrough=2:
>
> target/ppc/mmu_helper.c: In function ‘dump_mmu’:
> target/ppc/mmu_helper.c:1349:12: error: this statement may fall through [-Werror=implicit-fallthrough=]
> 1349 | if (ppc64_v3_radix(env_archcpu(env))) {
> | ^
> target/ppc/mmu_helper.c:1356:5: note: here
> 1356 | default:
> | ^~~~~~~
> cc1: all warnings being treated as errors
>
> Rewrite the comment using 'fall through' which is recognized by
> GCC and static analyzers.
>
> Reported-by: Stefan Weil <sw@weilnetz.de>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> target/ppc/mmu_helper.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c
> index 261a8fe707..862824b073 100644
> --- a/target/ppc/mmu_helper.c
> +++ b/target/ppc/mmu_helper.c
> @@ -98,7 +98,7 @@ static int pp_check(int key, int pp, int nx)
> case 0x1:
> case 0x2:
> access |= PAGE_WRITE;
> - /* No break here */
> + /* fall through */
> case 0x3:
> access |= PAGE_READ;
> break;
> @@ -706,7 +706,7 @@ static int mmu40x_get_physical_address(CPUPPCState *env, mmu_ctx_t *ctx,
> if (pr != 0) {
> goto check_perms;
> }
> - /* No break here */
> + /* fall through */
> case 0x3:
> /* All accesses granted */
> ctx->prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
> @@ -720,7 +720,7 @@ static int mmu40x_get_physical_address(CPUPPCState *env, mmu_ctx_t *ctx,
> ret = -2;
> break;
> }
> - /* No break here */
> + /* fall through */
> case 0x1:
> check_perms:
> /* Check from TLB entry */
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-07-20 14:08 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-19 13:14 [Qemu-trivial] [PATCH-for-4.1? 0/7] Trivial switch 'fall through' comment fixes for GCC9 Philippe Mathieu-Daudé
2019-07-19 13:14 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-07-19 13:14 ` [Qemu-trivial] [PATCH-for-4.1? 1/7] json: Move switch 'fall through' comment to correct place Philippe Mathieu-Daudé
2019-07-19 13:14 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-07-19 15:31 ` [Qemu-trivial] " Eric Blake
2019-07-19 15:31 ` Eric Blake
2019-08-21 8:54 ` [Qemu-trivial] " Laurent Vivier
2019-08-21 8:54 ` [Qemu-devel] " Laurent Vivier
2019-07-19 13:14 ` [Qemu-trivial] [PATCH-for-4.1? 2/7] hw/dma/omap_dma: " Philippe Mathieu-Daudé
2019-07-19 13:14 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-07-19 13:27 ` [Qemu-trivial] " Peter Maydell
2019-07-19 13:27 ` [Qemu-devel] " Peter Maydell
2019-08-21 8:55 ` [Qemu-trivial] " Laurent Vivier
2019-08-21 8:55 ` [Qemu-devel] " Laurent Vivier
2019-07-19 13:14 ` [Qemu-trivial] [PATCH-for-4.1 3/7] hw/block/pflash_cfi02: Rewrite a fall through comment Philippe Mathieu-Daudé
2019-07-19 13:14 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-07-19 13:27 ` [Qemu-trivial] " Peter Maydell
2019-07-19 13:27 ` [Qemu-devel] " Peter Maydell
2019-07-22 11:43 ` [Qemu-trivial] " Philippe Mathieu-Daudé
2019-07-22 11:43 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-07-25 0:27 ` [Qemu-trivial] [Qemu-block] " John Snow
2019-07-25 0:27 ` [Qemu-devel] " John Snow
2019-07-25 10:59 ` [Qemu-trivial] " Philippe Mathieu-Daudé
2019-07-25 10:59 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-07-19 13:14 ` [Qemu-trivial] [PATCH-for-4.1? 4/7] hw/ipmi: " Philippe Mathieu-Daudé
2019-07-19 13:14 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-07-21 2:10 ` [Qemu-trivial] " Corey Minyard
2019-07-21 2:10 ` [Qemu-devel] " Corey Minyard
2019-08-21 8:56 ` [Qemu-trivial] " Laurent Vivier
2019-08-21 8:56 ` [Qemu-devel] " Laurent Vivier
2019-07-19 13:14 ` [Qemu-trivial] [PATCH-for-4.1? 5/7] target/ppc: " Philippe Mathieu-Daudé
2019-07-19 13:14 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-07-19 14:20 ` David Gibson [this message]
2019-07-19 14:20 ` David Gibson
2019-08-21 8:57 ` [Qemu-trivial] " Laurent Vivier
2019-08-21 8:57 ` [Qemu-devel] " Laurent Vivier
2019-07-19 13:14 ` [Qemu-trivial] [PATCH-for-4.1? 6/7] vl: " Philippe Mathieu-Daudé
2019-07-19 13:14 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-07-25 0:28 ` [Qemu-trivial] [Qemu-block] " John Snow
2019-07-25 0:28 ` [Qemu-devel] " John Snow
2019-08-21 8:58 ` [Qemu-trivial] " Laurent Vivier
2019-08-21 8:58 ` [Qemu-devel] " Laurent Vivier
2019-07-19 13:14 ` [Qemu-trivial] [PATCH-for-4.1? 7/7] spapr_events: " Philippe Mathieu-Daudé
2019-07-19 13:14 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-07-19 14:20 ` [Qemu-trivial] " David Gibson
2019-07-19 14:20 ` [Qemu-devel] " David Gibson
2019-08-21 8:59 ` [Qemu-trivial] " Laurent Vivier
2019-08-21 8:59 ` [Qemu-devel] " Laurent Vivier
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=20190719142013.GA4174@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=laurent@vivier.eu \
--cc=minyard@acm.org \
--cc=mjt@tls.msk.ru \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=sw@weilnetz.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.