From: David Gibson <david@gibson.dropbear.id.au>
To: Thomas Huth <thuth@redhat.com>
Cc: zhang.zhanghailiang@huawei.com, qemu-trivial@nongnu.org,
qemu-devel@nongnu.org,
"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
ganqixin@huawei.com, Euler Robot <euler.robot@huawei.com>,
Chen Qun <kuhn.chenqun@huawei.com>
Subject: Re: [PATCH 7/9] ppc: silence the compiler warnings
Date: Thu, 29 Oct 2020 10:38:35 +1100 [thread overview]
Message-ID: <20201028233835.GG5604@yekko.fritz.box> (raw)
In-Reply-To: <ddcb887d-42ec-2021-1785-a6fb0d13d6b9@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2238 bytes --]
On Wed, Oct 28, 2020 at 03:42:31PM +0100, Thomas Huth wrote:
> On 28/10/2020 05.29, David Gibson wrote:
> > On Wed, Oct 28, 2020 at 12:18:17PM +0800, Chen Qun wrote:
> >> When using -Wimplicit-fallthrough in our CFLAGS, the compiler showed warning:
> >> hw/ppc/ppc.c: In function ‘ppc6xx_set_irq’:
> >> hw/ppc/ppc.c:118:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
> >> 118 | if (level) {
> >> | ^
> >> hw/ppc/ppc.c:123:9: note: here
> >> 123 | case PPC6xx_INPUT_INT:
> >> | ^~~~
> >>
> >> Add the corresponding "fall through" comment to fix it.
> >>
> >> Reported-by: Euler Robot <euler.robot@huawei.com>
> >> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> >
> > Acked-by: David Gibson <david@gibson.dropbear.id.au>
> >
> >> ---
> >> Cc: David Gibson <david@gibson.dropbear.id.au>
> >> ---
> >> hw/ppc/ppc.c | 1 +
> >> 1 file changed, 1 insertion(+)
> >>
> >> diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
> >> index 4a11fb1640..f9eb8f21b4 100644
> >> --- a/hw/ppc/ppc.c
> >> +++ b/hw/ppc/ppc.c
> >> @@ -120,6 +120,7 @@ static void ppc6xx_set_irq(void *opaque, int pin, int level)
> >> } else {
> >> cpu_ppc_tb_stop(env);
> >> }
> >> + /* fall through */
> >> case PPC6xx_INPUT_INT:
> >> /* Level sensitive - active high */
> >> LOG_IRQ("%s: set the external IRQ state to %d\n",
> >
>
> Is that fall through actually really the right thing to do here? I'd rather
> expect to see a PPC_INTERRUPT_DECR instead of a PPC_INTERRUPT_EXT in case
> someone messes with the TBEN pin? So I assume this is likely rather bug and
> we should a "break" statement here instead?
Oh.. good catch, I think I misread this. I thought the change was
correct, because DECRs look somewhat like external interrupts. But
this is TBEN, not a DECR interrupt per se. So, yes, I think this was
a bug and it should be a break instead.
--
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:[~2020-10-29 0:38 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-28 4:18 [PATCH 0/9] silence the compiler warnings Chen Qun
2020-10-28 4:18 ` [PATCH 1/9] target/i386: silence the compiler warnings in gen_shiftd_rm_T1 Chen Qun
2020-10-28 12:57 ` Thomas Huth
2020-10-28 13:20 ` Philippe Mathieu-Daudé
2020-10-28 15:31 ` Richard Henderson
2020-10-28 16:51 ` Thomas Huth
2020-10-29 2:40 ` Chenqun (kuhn)
2020-10-28 15:31 ` Richard Henderson
2020-10-28 4:18 ` [PATCH 2/9] hw/intc/arm_gicv3_kvm: silence the compiler warnings Chen Qun
2020-10-28 20:20 ` Peter Maydell
2020-10-28 4:18 ` [PATCH 3/9] accel/tcg/user-exec: " Chen Qun
2020-10-28 13:52 ` Thomas Huth
2020-10-28 15:37 ` Richard Henderson
2020-10-29 6:13 ` Chenqun (kuhn)
2020-10-28 4:18 ` [PATCH 4/9] linux-user/mips/cpu_loop: " Chen Qun
2020-10-28 13:22 ` Thomas Huth
2020-10-28 4:18 ` [PATCH 5/9] target/sparc/translate: " Chen Qun
2020-10-28 6:39 ` Artyom Tarasenko
2020-10-28 9:50 ` Philippe Mathieu-Daudé
2020-10-28 4:18 ` [PATCH 6/9] target/sparc/win_helper: " Chen Qun
2020-10-28 6:42 ` Artyom Tarasenko
2020-10-28 9:51 ` Philippe Mathieu-Daudé
2020-10-29 2:45 ` Chenqun (kuhn)
2020-10-28 4:18 ` [PATCH 7/9] ppc: " Chen Qun
2020-10-28 4:29 ` David Gibson
2020-10-28 14:42 ` Thomas Huth
2020-10-28 23:38 ` David Gibson [this message]
2020-10-29 7:06 ` Chenqun (kuhn)
2020-10-28 4:18 ` [PATCH 8/9] target/ppc: " Chen Qun
2020-10-28 4:30 ` David Gibson
2020-10-28 9:56 ` Philippe Mathieu-Daudé
2020-10-28 15:06 ` Thomas Huth
2020-10-28 23:39 ` David Gibson
2020-10-29 7:16 ` Chenqun (kuhn)
2020-10-28 4:18 ` [PATCH 9/9] hw/timer/renesas_tmr: " Chen Qun
2020-10-28 9:59 ` Philippe Mathieu-Daudé
2020-10-28 15:04 ` Thomas Huth
2020-10-28 20:14 ` Peter Maydell
2020-10-29 8:26 ` Chenqun (kuhn)
2020-10-29 8:12 ` Chenqun (kuhn)
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=20201028233835.GG5604@yekko.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=euler.robot@huawei.com \
--cc=ganqixin@huawei.com \
--cc=kuhn.chenqun@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=thuth@redhat.com \
--cc=zhang.zhanghailiang@huawei.com \
/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).