From nobody Wed Dec 17 09:18:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697185310; cv=none; d=zohomail.com; s=zohoarc; b=kaJC6Bzd5aKnXgS5rJV7egf6uDQPu14gLIuwKGTnRzacMCbuTueGSsojZ+7xF4qfsXXoTmPIIIDUFxEtbtL10OLfwrjEVHRbnAknz9JFnIohy++gW2Z9am0gnFovLLO6i4swotO6v99YageX+IS3gysYPD+S/D/JItymL458M2w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697185310; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NCHgvH6STgJj0iPCirxO1TTUh7Ds/wMgB/10h6d6px4=; b=QcSRxKlt4CO7K8VRhJLAEDqKPS3mLBvBS2H8f8sLvY5UYH+AIEAgZlE6xY07De0MZ3z4uqnKPz8EzoA5NZ4WC0SGxDTfrftUWdBockUpfr4iyCnlsUQcFVh2eHFI0DoVynFfYe9eXK3aKK47tDFx5P7E2LMZrtr1Mu6WAzuGl1k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697185310646877.6941138587588; Fri, 13 Oct 2023 01:21:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrD52-0004uX-9s; Fri, 13 Oct 2023 03:59:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrD4r-0003Ju-9v for qemu-devel@nongnu.org; Fri, 13 Oct 2023 03:59:21 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrD4n-000757-Sv for qemu-devel@nongnu.org; Fri, 13 Oct 2023 03:59:20 -0400 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2c5071165d5so5412691fa.0 for ; Fri, 13 Oct 2023 00:59:16 -0700 (PDT) Received: from localhost.localdomain (adsl-26.37.6.0.tellas.gr. [37.6.0.26]) by smtp.gmail.com with ESMTPSA id a10-20020a05600c224a00b003fe23b10fdfsm1798183wmm.36.2023.10.13.00.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 00:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697183954; x=1697788754; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NCHgvH6STgJj0iPCirxO1TTUh7Ds/wMgB/10h6d6px4=; b=LwzTBcByWyiNJ09Mu+fAfOFbQJZGgKF2QFR1yW1yV++cIjPWJ6D1xnj0z4nbfAqMsu D8ihRyBIVarF4HrCbokfgjKbs7pUtxUidalM0Leh4BopUlBcmywpfBy8TdtGnZtVF9KD XvDi75zbQfSsVlCXlMsbu0dbwGpmyOslFGnmBsWOSxe4+NwzGdMTQmrzH1CBaVeD7NwE cc8B6RJTUEG2DwoJyCGtXdHyGd1i6C6KAZLCIdp8rmBHNZjddA4nJaPifYVdWIUYsO0W w1sH3/IV5izXdwcrjT+wW0xxaCuk1hTJe0U1qIbklyrCvWgErvrX2tEblAja7SzC22Uz UUug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697183954; x=1697788754; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NCHgvH6STgJj0iPCirxO1TTUh7Ds/wMgB/10h6d6px4=; b=QA98g0evYUmwOVrvOrSXFgNxvKAPa12Ji8rV9ONSV7u9lK10IecWkqggTSFAo22y6Z Ff5WCYbZLzF6UtEhFKylKUSG4TLNGOu2arXUoBpTIiOaQCyPpAJwDpGqPXHiZ3gofPzH 9/rJ5u5XXL58Xscx4TA6/2aezqaeczmRjsRU8XfthyPhNCqT91eDPeC6GhwRIxKU67ZC hcgv6cw4lo5gRvjto5RghrIdcQwamBsW81MtRZfTGdMei+qHoGd7W/NLpZ2m8l3rrCxP RWo1r+zFk7ZicRXjrnlNZ9yxGjOCgiHMQmibuowTTDsK+3TiCgfTjSrPTA7jTD/5NXUs s2Wg== X-Gm-Message-State: AOJu0YyVCV9hqvrW2WF5G0Tx72M8n3i6iBv+h7xwB4ADgrHVIcvbPq3F 6tjUErVU357RzAqiVbrgozzPLHMzvveoB96CFWA= X-Google-Smtp-Source: AGHT+IEnF4OOJvjJfjoJKfjS/hNd8znCcluvWrKOqes8ldEBvQCwklNkUYEf+Q0WP/zyx81PDDVBEg== X-Received: by 2002:a2e:a1c3:0:b0:2b9:3684:165 with SMTP id c3-20020a2ea1c3000000b002b936840165mr18768912ljm.8.1697183954145; Fri, 13 Oct 2023 00:59:14 -0700 (PDT) From: Emmanouil Pitsidianakis To: qemu-devel@nongnu.org Cc: Emmanouil Pitsidianakis , Peter Maydell , Mark Cave-Ayland , qemu-arm@nongnu.org (open list:OMAP) Subject: [RFC PATCH v2 45/78] hw/dma: add fallthrough pseudo-keyword Date: Fri, 13 Oct 2023 10:57:12 +0300 Message-Id: <5070e9550acf207f28bf4ef19cb3ee1fd38e5344.1697183699.git.manos.pitsidianakis@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=manos.pitsidianakis@linaro.org; helo=mail-lj1-x235.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697185312458100003 Content-Type: text/plain; charset="utf-8" In preparation of raising -Wimplicit-fallthrough to 5, replace all fall-through comments with the fallthrough attribute pseudo-keyword. Signed-off-by: Emmanouil Pitsidianakis --- hw/dma/omap_dma.c | 32 ++++++++++++++++---------------- hw/dma/pxa2xx_dma.c | 4 ++-- hw/dma/sparc32_dma.c | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c index 77797a67b5..dd43dbf3d2 100644 --- a/hw/dma/omap_dma.c +++ b/hw/dma/omap_dma.c @@ -1457,46 +1457,46 @@ static int omap_dma_sys_read(struct omap_dma_s *s, = int offset, static uint64_t omap_dma_read(void *opaque, hwaddr addr, unsigned size) { struct omap_dma_s *s =3D opaque; int reg, ch; uint16_t ret; =20 if (size !=3D 2) { return omap_badwidth_read16(opaque, addr); } =20 switch (addr) { case 0x300 ... 0x3fe: if (s->model <=3D omap_dma_3_1 || !s->omap_3_1_mapping_disabled) { if (omap_dma_3_1_lcd_read(&s->lcd_ch, addr, &ret)) break; return ret; } - /* Fall through. */ + fallthrough; case 0x000 ... 0x2fe: reg =3D addr & 0x3f; ch =3D (addr >> 6) & 0x0f; if (omap_dma_ch_reg_read(s, &s->ch[ch], reg, &ret)) break; return ret; =20 case 0x404 ... 0x4fe: if (s->model <=3D omap_dma_3_1) break; - /* Fall through. */ + fallthrough; case 0x400: if (omap_dma_sys_read(s, addr, &ret)) break; return ret; =20 case 0xb00 ... 0xbfe: if (s->model =3D=3D omap_dma_3_2 && s->omap_3_1_mapping_disabled) { if (omap_dma_3_2_lcd_read(&s->lcd_ch, addr, &ret)) break; return ret; } break; } =20 OMAP_BAD_REG(addr); return 0; } @@ -1504,46 +1504,46 @@ static uint64_t omap_dma_read(void *opaque, hwaddr = addr, unsigned size) static void omap_dma_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { struct omap_dma_s *s =3D opaque; int reg, ch; =20 if (size !=3D 2) { omap_badwidth_write16(opaque, addr, value); return; } =20 switch (addr) { case 0x300 ... 0x3fe: if (s->model <=3D omap_dma_3_1 || !s->omap_3_1_mapping_disabled) { if (omap_dma_3_1_lcd_write(&s->lcd_ch, addr, value)) break; return; } - /* Fall through. */ + fallthrough; case 0x000 ... 0x2fe: reg =3D addr & 0x3f; ch =3D (addr >> 6) & 0x0f; if (omap_dma_ch_reg_write(s, &s->ch[ch], reg, value)) break; return; =20 case 0x404 ... 0x4fe: if (s->model <=3D omap_dma_3_1) break; - /* fall through */ + fallthrough; case 0x400: if (omap_dma_sys_write(s, addr, value)) break; return; =20 case 0xb00 ... 0xbfe: if (s->model =3D=3D omap_dma_3_2 && s->omap_3_1_mapping_disabled) { if (omap_dma_3_2_lcd_write(&s->lcd_ch, addr, value)) break; return; } break; } =20 OMAP_BAD_REG(addr); } @@ -1702,155 +1702,155 @@ static void omap_dma_interrupts_4_update(struct o= map_dma_s *s) static uint64_t omap_dma4_read(void *opaque, hwaddr addr, unsigned size) { struct omap_dma_s *s =3D opaque; int irqn =3D 0, chnum; struct omap_dma_channel_s *ch; =20 if (size =3D=3D 1) { return omap_badwidth_read16(opaque, addr); } =20 switch (addr) { case 0x00: /* DMA4_REVISION */ return 0x40; =20 case 0x14: /* DMA4_IRQSTATUS_L3 */ irqn ++; - /* fall through */ + fallthrough; case 0x10: /* DMA4_IRQSTATUS_L2 */ irqn ++; - /* fall through */ + fallthrough; case 0x0c: /* DMA4_IRQSTATUS_L1 */ irqn ++; - /* fall through */ + fallthrough; case 0x08: /* DMA4_IRQSTATUS_L0 */ return s->irqstat[irqn]; =20 case 0x24: /* DMA4_IRQENABLE_L3 */ irqn ++; - /* fall through */ + fallthrough; case 0x20: /* DMA4_IRQENABLE_L2 */ irqn ++; - /* fall through */ + fallthrough; case 0x1c: /* DMA4_IRQENABLE_L1 */ irqn ++; - /* fall through */ + fallthrough; case 0x18: /* DMA4_IRQENABLE_L0 */ return s->irqen[irqn]; =20 case 0x28: /* DMA4_SYSSTATUS */ return 1; /* RESETDONE */ =20 case 0x2c: /* DMA4_OCP_SYSCONFIG */ return s->ocp; =20 case 0x64: /* DMA4_CAPS_0 */ return s->caps[0]; case 0x6c: /* DMA4_CAPS_2 */ return s->caps[2]; case 0x70: /* DMA4_CAPS_3 */ return s->caps[3]; case 0x74: /* DMA4_CAPS_4 */ return s->caps[4]; =20 case 0x78: /* DMA4_GCR */ return s->gcr; =20 case 0x80 ... 0xfff: addr -=3D 0x80; chnum =3D addr / 0x60; ch =3D s->ch + chnum; addr -=3D chnum * 0x60; break; =20 default: OMAP_BAD_REG(addr); return 0; } =20 /* Per-channel registers */ switch (addr) { case 0x00: /* DMA4_CCR */ return (ch->buf_disable << 25) | (ch->src_sync << 24) | (ch->prefetch << 23) | ((ch->sync & 0x60) << 14) | (ch->bs << 18) | (ch->transparent_copy << 17) | (ch->constant_fill << 16) | (ch->mode[1] << 14) | (ch->mode[0] << 12) | (0 << 10) | (0 << 9) | (ch->suspend << 8) | (ch->enable << 7) | (ch->priority << 6) | (ch->fs << 5) | (ch->sync & 0x1f); =20 case 0x04: /* DMA4_CLNK_CTRL */ return (ch->link_enabled << 15) | ch->link_next_ch; =20 case 0x08: /* DMA4_CICR */ return ch->interrupts; =20 case 0x0c: /* DMA4_CSR */ return ch->cstatus; =20 case 0x10: /* DMA4_CSDP */ return (ch->endian[0] << 21) | (ch->endian_lock[0] << 20) | (ch->endian[1] << 19) | (ch->endian_lock[1] << 18) | (ch->write_mode << 16) | (ch->burst[1] << 14) | (ch->pack[1] << 13) | (ch->translate[1] << 9) | (ch->burst[0] << 7) | (ch->pack[0] << 6) | (ch->translate[0] << 2) | (ch->data_type >> 1); =20 case 0x14: /* DMA4_CEN */ return ch->elements; =20 case 0x18: /* DMA4_CFN */ return ch->frames; =20 case 0x1c: /* DMA4_CSSA */ return ch->addr[0]; =20 case 0x20: /* DMA4_CDSA */ return ch->addr[1]; =20 case 0x24: /* DMA4_CSEI */ return ch->element_index[0]; =20 case 0x28: /* DMA4_CSFI */ return ch->frame_index[0]; =20 case 0x2c: /* DMA4_CDEI */ return ch->element_index[1]; =20 case 0x30: /* DMA4_CDFI */ return ch->frame_index[1]; =20 case 0x34: /* DMA4_CSAC */ return ch->active_set.src & 0xffff; =20 case 0x38: /* DMA4_CDAC */ return ch->active_set.dest & 0xffff; =20 case 0x3c: /* DMA4_CCEN */ return ch->active_set.element; =20 case 0x40: /* DMA4_CCFN */ return ch->active_set.frame; =20 case 0x44: /* DMA4_COLOR */ /* XXX only in sDMA */ return ch->color; =20 default: OMAP_BAD_REG(addr); return 0; } } @@ -1858,213 +1858,213 @@ static uint64_t omap_dma4_read(void *opaque, hwad= dr addr, static void omap_dma4_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { struct omap_dma_s *s =3D opaque; int chnum, irqn =3D 0; struct omap_dma_channel_s *ch; =20 if (size =3D=3D 1) { omap_badwidth_write16(opaque, addr, value); return; } =20 switch (addr) { case 0x14: /* DMA4_IRQSTATUS_L3 */ irqn ++; - /* fall through */ + fallthrough; case 0x10: /* DMA4_IRQSTATUS_L2 */ irqn ++; - /* fall through */ + fallthrough; case 0x0c: /* DMA4_IRQSTATUS_L1 */ irqn ++; - /* fall through */ + fallthrough; case 0x08: /* DMA4_IRQSTATUS_L0 */ s->irqstat[irqn] &=3D ~value; if (!s->irqstat[irqn]) qemu_irq_lower(s->irq[irqn]); return; =20 case 0x24: /* DMA4_IRQENABLE_L3 */ irqn ++; - /* fall through */ + fallthrough; case 0x20: /* DMA4_IRQENABLE_L2 */ irqn ++; - /* fall through */ + fallthrough; case 0x1c: /* DMA4_IRQENABLE_L1 */ irqn ++; - /* fall through */ + fallthrough; case 0x18: /* DMA4_IRQENABLE_L0 */ s->irqen[irqn] =3D value; return; =20 case 0x2c: /* DMA4_OCP_SYSCONFIG */ if (value & 2) /* SOFTRESET */ omap_dma_reset(s->dma); s->ocp =3D value & 0x3321; if (((s->ocp >> 12) & 3) =3D=3D 3) { /* MIDLEMODE */ qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid DMA power mode\n", __func__); } return; =20 case 0x78: /* DMA4_GCR */ s->gcr =3D value & 0x00ff00ff; if ((value & 0xff) =3D=3D 0x00) { /* MAX_CHANNEL_FIFO_DEPTH */ qemu_log_mask(LOG_GUEST_ERROR, "%s: wrong FIFO depth in GCR\n", __func__); } return; =20 case 0x80 ... 0xfff: addr -=3D 0x80; chnum =3D addr / 0x60; ch =3D s->ch + chnum; addr -=3D chnum * 0x60; break; =20 case 0x00: /* DMA4_REVISION */ case 0x28: /* DMA4_SYSSTATUS */ case 0x64: /* DMA4_CAPS_0 */ case 0x6c: /* DMA4_CAPS_2 */ case 0x70: /* DMA4_CAPS_3 */ case 0x74: /* DMA4_CAPS_4 */ OMAP_RO_REG(addr); return; =20 default: OMAP_BAD_REG(addr); return; } =20 /* Per-channel registers */ switch (addr) { case 0x00: /* DMA4_CCR */ ch->buf_disable =3D (value >> 25) & 1; ch->src_sync =3D (value >> 24) & 1; /* XXX For CamDMA must be 1 */ if (ch->buf_disable && !ch->src_sync) { qemu_log_mask(LOG_GUEST_ERROR, "%s: Buffering disable is not allowed in " "destination synchronised mode\n", __func__); } ch->prefetch =3D (value >> 23) & 1; ch->bs =3D (value >> 18) & 1; ch->transparent_copy =3D (value >> 17) & 1; ch->constant_fill =3D (value >> 16) & 1; ch->mode[1] =3D (omap_dma_addressing_t) ((value & 0xc000) >> 14); ch->mode[0] =3D (omap_dma_addressing_t) ((value & 0x3000) >> 12); ch->suspend =3D (value & 0x0100) >> 8; ch->priority =3D (value & 0x0040) >> 6; ch->fs =3D (value & 0x0020) >> 5; if (ch->fs && ch->bs && ch->mode[0] && ch->mode[1]) { qemu_log_mask(LOG_GUEST_ERROR, "%s: For a packet transfer at least one port " "must be constant-addressed\n", __func__); } ch->sync =3D (value & 0x001f) | ((value >> 14) & 0x0060); /* XXX must be 0x01 for CamDMA */ =20 if (value & 0x0080) omap_dma_enable_channel(s, ch); else omap_dma_disable_channel(s, ch); =20 break; =20 case 0x04: /* DMA4_CLNK_CTRL */ ch->link_enabled =3D (value >> 15) & 0x1; ch->link_next_ch =3D value & 0x1f; break; =20 case 0x08: /* DMA4_CICR */ ch->interrupts =3D value & 0x09be; break; =20 case 0x0c: /* DMA4_CSR */ ch->cstatus &=3D ~value; break; =20 case 0x10: /* DMA4_CSDP */ ch->endian[0] =3D(value >> 21) & 1; ch->endian_lock[0] =3D(value >> 20) & 1; ch->endian[1] =3D(value >> 19) & 1; ch->endian_lock[1] =3D(value >> 18) & 1; if (ch->endian[0] !=3D ch->endian[1]) { qemu_log_mask(LOG_GUEST_ERROR, "%s: DMA endianness conversion enable attempt\n", __func__); } ch->write_mode =3D (value >> 16) & 3; ch->burst[1] =3D (value & 0xc000) >> 14; ch->pack[1] =3D (value & 0x2000) >> 13; ch->translate[1] =3D (value & 0x1e00) >> 9; ch->burst[0] =3D (value & 0x0180) >> 7; ch->pack[0] =3D (value & 0x0040) >> 6; ch->translate[0] =3D (value & 0x003c) >> 2; if (ch->translate[0] | ch->translate[1]) { qemu_log_mask(LOG_GUEST_ERROR, "%s: bad MReqAddressTranslate sideband signal\n", __func__); } ch->data_type =3D 1 << (value & 3); if ((value & 3) =3D=3D 3) { qemu_log_mask(LOG_GUEST_ERROR, "%s: bad data_type for DMA channel\n", __func__); ch->data_type >>=3D 1; } break; =20 case 0x14: /* DMA4_CEN */ ch->set_update =3D 1; ch->elements =3D value & 0xffffff; break; =20 case 0x18: /* DMA4_CFN */ ch->frames =3D value & 0xffff; ch->set_update =3D 1; break; =20 case 0x1c: /* DMA4_CSSA */ ch->addr[0] =3D (hwaddr) (uint32_t) value; ch->set_update =3D 1; break; =20 case 0x20: /* DMA4_CDSA */ ch->addr[1] =3D (hwaddr) (uint32_t) value; ch->set_update =3D 1; break; =20 case 0x24: /* DMA4_CSEI */ ch->element_index[0] =3D (int16_t) value; ch->set_update =3D 1; break; =20 case 0x28: /* DMA4_CSFI */ ch->frame_index[0] =3D (int32_t) value; ch->set_update =3D 1; break; =20 case 0x2c: /* DMA4_CDEI */ ch->element_index[1] =3D (int16_t) value; ch->set_update =3D 1; break; =20 case 0x30: /* DMA4_CDFI */ ch->frame_index[1] =3D (int32_t) value; ch->set_update =3D 1; break; =20 case 0x44: /* DMA4_COLOR */ /* XXX only in sDMA */ ch->color =3D value; break; =20 case 0x34: /* DMA4_CSAC */ case 0x38: /* DMA4_CDAC */ case 0x3c: /* DMA4_CCEN */ case 0x40: /* DMA4_CCFN */ OMAP_RO_REG(addr); break; =20 default: OMAP_BAD_REG(addr); } } diff --git a/hw/dma/pxa2xx_dma.c b/hw/dma/pxa2xx_dma.c index fa896f7edf..ac47256572 100644 --- a/hw/dma/pxa2xx_dma.c +++ b/hw/dma/pxa2xx_dma.c @@ -266,59 +266,59 @@ static void pxa2xx_dma_run(PXA2xxDMAState *s) static uint64_t pxa2xx_dma_read(void *opaque, hwaddr offset, unsigned size) { PXA2xxDMAState *s =3D (PXA2xxDMAState *) opaque; unsigned int channel; =20 if (size !=3D 4) { qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad access width %u\n", __func__, size); return 5; } =20 switch (offset) { case DRCMR64 ... DRCMR74: offset -=3D DRCMR64 - DRCMR0 - (64 << 2); - /* Fall through */ + fallthrough; case DRCMR0 ... DRCMR63: channel =3D (offset - DRCMR0) >> 2; return s->req[channel]; =20 case DRQSR0: case DRQSR1: case DRQSR2: return 0; =20 case DCSR0 ... DCSR31: channel =3D offset >> 2; if (s->chan[channel].request) return s->chan[channel].state | DCSR_REQPEND; return s->chan[channel].state; =20 case DINT: return s->stopintr | s->eorintr | s->rasintr | s->startintr | s->endintr; =20 case DALGN: return s->align; =20 case DPCSR: return s->pio; } =20 if (offset >=3D D_CH0 && offset < D_CH0 + (s->channels << 4)) { channel =3D (offset - D_CH0) >> 4; switch ((offset & 0x0f) >> 2) { case DDADR: return s->chan[channel].descr; case DSADR: return s->chan[channel].src; case DTADR: return s->chan[channel].dest; case DCMD: return s->chan[channel].cmd; } } qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", __func__, offset); return 7; } @@ -326,105 +326,105 @@ static uint64_t pxa2xx_dma_read(void *opaque, hwadd= r offset, static void pxa2xx_dma_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { PXA2xxDMAState *s =3D (PXA2xxDMAState *) opaque; unsigned int channel; =20 if (size !=3D 4) { qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad access width %u\n", __func__, size); return; } =20 switch (offset) { case DRCMR64 ... DRCMR74: offset -=3D DRCMR64 - DRCMR0 - (64 << 2); - /* Fall through */ + fallthrough; case DRCMR0 ... DRCMR63: channel =3D (offset - DRCMR0) >> 2; =20 if (value & DRCMR_MAPVLD) if ((value & DRCMR_CHLNUM) > s->channels) hw_error("%s: Bad DMA channel %i\n", __func__, (unsigned)value & DRCMR_CHLNUM); =20 s->req[channel] =3D value; break; =20 case DRQSR0: case DRQSR1: case DRQSR2: /* Nothing to do */ break; =20 case DCSR0 ... DCSR31: channel =3D offset >> 2; s->chan[channel].state &=3D 0x0000071f & ~(value & (DCSR_EORINT | DCSR_ENDINTR | DCSR_STARTINTR | DCSR_BUSERRINTR)); s->chan[channel].state |=3D value & 0xfc800000; =20 if (s->chan[channel].state & DCSR_STOPIRQEN) s->chan[channel].state &=3D ~DCSR_STOPINTR; =20 if (value & DCSR_NODESCFETCH) { /* No-descriptor-fetch mode */ if (value & DCSR_RUN) { s->chan[channel].state &=3D ~DCSR_STOPINTR; pxa2xx_dma_run(s); } } else { /* Descriptor-fetch mode */ if (value & DCSR_RUN) { s->chan[channel].state &=3D ~DCSR_STOPINTR; pxa2xx_dma_descriptor_fetch(s, channel); pxa2xx_dma_run(s); } } =20 /* Shouldn't matter as our DMA is synchronous. */ if (!(value & (DCSR_RUN | DCSR_MASKRUN))) s->chan[channel].state |=3D DCSR_STOPINTR; =20 if (value & DCSR_CLRCMPST) s->chan[channel].state &=3D ~DCSR_CMPST; if (value & DCSR_SETCMPST) s->chan[channel].state |=3D DCSR_CMPST; =20 pxa2xx_dma_update(s, channel); break; =20 case DALGN: s->align =3D value; break; =20 case DPCSR: s->pio =3D value & 0x80000001; break; =20 default: if (offset >=3D D_CH0 && offset < D_CH0 + (s->channels << 4)) { channel =3D (offset - D_CH0) >> 4; switch ((offset & 0x0f) >> 2) { case DDADR: s->chan[channel].descr =3D value; break; case DSADR: s->chan[channel].src =3D value; break; case DTADR: s->chan[channel].dest =3D value; break; case DCMD: s->chan[channel].cmd =3D value; break; default: goto fail; } =20 break; } fail: qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\= n", __func__, offset); } } diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c index 0ef13c5e9a..c68e068cc9 100644 --- a/hw/dma/sparc32_dma.c +++ b/hw/dma/sparc32_dma.c @@ -180,49 +180,49 @@ static uint64_t dma_mem_read(void *opaque, hwaddr add= r, static void dma_mem_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { DMADeviceState *s =3D opaque; uint32_t saddr; =20 saddr =3D (addr & DMA_MASK) >> 2; trace_sparc32_dma_mem_writel(addr, s->dmaregs[saddr], val); switch (saddr) { case 0: if (val & DMA_INTREN) { if (s->dmaregs[0] & DMA_INTR) { trace_sparc32_dma_set_irq_raise(); qemu_irq_raise(s->irq); } } else { if (s->dmaregs[0] & (DMA_INTR | DMA_INTREN)) { trace_sparc32_dma_set_irq_lower(); qemu_irq_lower(s->irq); } } if (val & DMA_RESET) { qemu_irq_raise(s->gpio[GPIO_RESET]); qemu_irq_lower(s->gpio[GPIO_RESET]); } else if (val & DMA_DRAIN_FIFO) { val &=3D ~DMA_DRAIN_FIFO; } else if (val =3D=3D 0) val =3D DMA_DRAIN_FIFO; =20 if (val & DMA_EN && !(s->dmaregs[0] & DMA_EN)) { trace_sparc32_dma_enable_raise(); qemu_irq_raise(s->gpio[GPIO_DMA]); } else if (!(val & DMA_EN) && !!(s->dmaregs[0] & DMA_EN)) { trace_sparc32_dma_enable_lower(); qemu_irq_lower(s->gpio[GPIO_DMA]); } =20 val &=3D ~DMA_CSR_RO_MASK; val |=3D DMA_VER; s->dmaregs[0] =3D (s->dmaregs[0] & DMA_CSR_RO_MASK) | val; break; case 1: s->dmaregs[0] |=3D DMA_LOADED; - /* fall through */ + fallthrough; default: s->dmaregs[saddr] =3D val; break; } } --=20 2.39.2