From nobody Wed Nov 5 05:11:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1533136539725382.40461871035234; Wed, 1 Aug 2018 08:15:39 -0700 (PDT) Received: from localhost ([::1]:41692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fksqU-0007if-IE for importer@patchew.org; Wed, 01 Aug 2018 11:15:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkspU-0006sH-LS for qemu-devel@nongnu.org; Wed, 01 Aug 2018 11:14:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkspP-0002dx-LV for qemu-devel@nongnu.org; Wed, 01 Aug 2018 11:14:24 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38204 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fkspP-0002dr-FH for qemu-devel@nongnu.org; Wed, 01 Aug 2018 11:14:19 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EEDE040201BE for ; Wed, 1 Aug 2018 15:14:18 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-228.ams2.redhat.com [10.36.116.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 695551002965 for ; Wed, 1 Aug 2018 15:14:18 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 1 Aug 2018 17:14:17 +0200 Message-Id: <20180801151417.23655-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 01 Aug 2018 15:14:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 01 Aug 2018 15:14:19 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pbonzini@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH] fix "Missing break in switch" coverity reports X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Many of these are marked as "intentional/fix required" because they just need adding a fall through comment. This is exactly what this patch does, except for target/mips/translate.c where it is easier to duplicate the code, and hw/audio/sb16.c where I consulted the DOSBox sources and decide to just remove the LOG_UNIMP before the fallthrough. Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- disas/m68k.c | 1 + hw/arm/pxa2xx.c | 2 +- hw/audio/cs4231a.c | 1 + hw/audio/gusemu_hal.c | 1 + hw/audio/sb16.c | 4 +--- hw/display/cg3.c | 1 + hw/display/cirrus_vga.c | 3 ++- hw/timer/sh_timer.c | 1 + target/arm/helper.c | 1 + target/i386/translate.c | 2 ++ target/mips/translate.c | 2 ++ 11 files changed, 14 insertions(+), 5 deletions(-) diff --git a/disas/m68k.c b/disas/m68k.c index a687df437c..0dc8aa1a3c 100644 --- a/disas/m68k.c +++ b/disas/m68k.c @@ -1623,6 +1623,7 @@ print_insn_arg (const char *d, =20 case 'X': place =3D '8'; + /* fall through */ case 'Y': case 'Z': case 'W': diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index b67b0cefb6..f598a1c053 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -409,7 +409,7 @@ static uint64_t pxa2xx_mm_read(void *opaque, hwaddr add= r, case MDCNFG ... SA1110: if ((addr & 3) =3D=3D 0) return s->mm_regs[addr >> 2]; - + /* fall through */ default: printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c index aaebec1839..9089dcb47e 100644 --- a/hw/audio/cs4231a.c +++ b/hw/audio/cs4231a.c @@ -305,6 +305,7 @@ static void cs_reset_voices (CSState *s, uint32_t val) =20 case 6: as.endianness =3D 1; + /* fall through */ case 2: as.fmt =3D AUD_FMT_S16; s->shift =3D as.nchannels; diff --git a/hw/audio/gusemu_hal.c b/hw/audio/gusemu_hal.c index 1150fc4426..ae40ca341c 100644 --- a/hw/audio/gusemu_hal.c +++ b/hw/audio/gusemu_hal.c @@ -261,6 +261,7 @@ void gus_write(GUSEmuState * state, int port, int size,= unsigned int data) GUSregb(IRQStatReg2x6) =3D 0x10; GUS_irqrequest(state, state->gusirq, 1); } + /* fall through */ case 0x20D: /* SB2xCd no IRQ */ GUSregb(SB2xCd) =3D (uint8_t) data; break; diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c index 5a4d32364e..665a7e75c5 100644 --- a/hw/audio/sb16.c +++ b/hw/audio/sb16.c @@ -741,10 +741,8 @@ static void complete (SB16State *s) ldebug ("set time const %d\n", s->time_const); break; =20 - case 0x42: /* FT2 sets output freq with this, go figu= re */ - qemu_log_mask(LOG_UNIMP, "cmd 0x42 might not do what it think = it" - " should\n"); case 0x41: + case 0x42: /* FT2 sets output freq with this, go figu= re */ s->freq =3D dsp_get_hilo (s); ldebug ("set freq %d\n", s->freq); break; diff --git a/hw/display/cg3.c b/hw/display/cg3.c index 6fff4852c5..1c199ab369 100644 --- a/hw/display/cg3.c +++ b/hw/display/cg3.c @@ -232,6 +232,7 @@ static void cg3_reg_write(void *opaque, hwaddr addr, ui= nt64_t val, s->b[s->dac_index] =3D regval; /* Index autoincrement */ s->dac_index =3D (s->dac_index + 1) & 0xff; + /* fall through */ default: s->dac_state =3D 0; break; diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index 7583b18c29..04c87c8e8d 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -1426,7 +1426,8 @@ static void cirrus_vga_write_sr(CirrusVGAState * s, u= int32_t val) s->vga.hw_cursor_y =3D (val << 3) | (s->vga.sr_index >> 5); break; case 0x07: // Extended Sequencer Mode - cirrus_update_memory_access(s); + cirrus_update_memory_access(s); + /* fall through */ case 0x08: // EEPROM Control case 0x09: // Scratch Register 0 case 0x0a: // Scratch Register 1 diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c index 5f8736cf10..91b18ba312 100644 --- a/hw/timer/sh_timer.c +++ b/hw/timer/sh_timer.c @@ -74,6 +74,7 @@ static uint32_t sh_timer_read(void *opaque, hwaddr offset) case OFFSET_TCPR: if (s->feat & TIMER_FEAT_CAPT) return s->tcpr; + /* fall through */ default: hw_error("sh_timer_read: Bad offset %x\n", (int)offset); return 0; diff --git a/target/arm/helper.c b/target/arm/helper.c index 66afb08ee0..12735ff089 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -12277,6 +12277,7 @@ int arm_rmode_to_sf(int rmode) /* FIXME: add support for TIEAWAY and ODD */ qemu_log_mask(LOG_UNIMP, "arm: unimplemented rounding mode: %d\n", rmode); + /* fall through for now */ case FPROUNDING_TIEEVEN: default: rmode =3D float_round_nearest_even; diff --git a/target/i386/translate.c b/target/i386/translate.c index 07d185e7b6..1f9d1d9b24 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4689,6 +4689,7 @@ static target_ulong disas_insn(DisasContext *s, CPUSt= ate *cpu) case 0x82: if (CODE64(s)) goto illegal_op; + /* fall through */ case 0x80: /* GRP1 */ case 0x81: case 0x83: @@ -8292,6 +8293,7 @@ static target_ulong disas_insn(DisasContext *s, CPUSt= ate *cpu) case 0x10e ... 0x10f: /* 3DNow! instructions, ignore prefixes */ s->prefix &=3D ~(PREFIX_REPZ | PREFIX_REPNZ | PREFIX_DATA); + /* fall through */ case 0x110 ... 0x117: case 0x128 ... 0x12f: case 0x138 ... 0x13a: diff --git a/target/mips/translate.c b/target/mips/translate.c index 20b43c0337..60408dcda3 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -19874,6 +19874,8 @@ static void decode_opc(CPUMIPSState *env, DisasCont= ext *ctx) case OPC_MTHC1: check_cp1_enabled(ctx); check_insn(ctx, ISA_MIPS32R2); + gen_cp1(ctx, op1, rt, rd); + break; case OPC_MFC1: case OPC_CFC1: case OPC_MTC1: --=20 2.17.1