[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 7/9] ppc: silence the compiler warnings
From: |
Thomas Huth |
Subject: |
Re: [PATCH 7/9] ppc: silence the compiler warnings |
Date: |
Wed, 28 Oct 2020 15:42:31 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
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?
Thomas
- Re: [PATCH 2/9] hw/intc/arm_gicv3_kvm: silence the compiler warnings, (continued)
[PATCH 1/9] target/i386: silence the compiler warnings in gen_shiftd_rm_T1, Chen Qun, 2020/10/28
Re: [PATCH 1/9] target/i386: silence the compiler warnings in gen_shiftd_rm_T1, Richard Henderson, 2020/10/28
[PATCH 4/9] linux-user/mips/cpu_loop: silence the compiler warnings, Chen Qun, 2020/10/28