From nobody Wed Dec 17 09:17:00 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=1697184397; cv=none; d=zohomail.com; s=zohoarc; b=TTvn5uTpbwbq+8YKSqlSaTkNqpZYB2TU1xXHxfJLo/OsF9g1cIwYFnCbar6iPnIY9PAaAGFyCjYCTORuCyHn7RaZ7E407vWCxVGi7XaKJbzSYvYx9arZkp1KFQVlmf4TCz2ExA+jPUEoWBjKqgNaIe7OrASzT579UX0YUVvKXO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697184397; 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=TgVJaEUfo38wurBGn+D3UK3JXthAmJ84+zCqcU6HvLo=; b=k2anZ+3IdoDVXqb8UsL+gYcBrc6qCb9PNAbd0Ql/C9JNG2Skxyelcybu6dM4LPSKC8WMP6fedNUz/urzphD3WKnM1UcSSacgtIjU7qOg5dsVm1e8n66nPyGJXZ2XZFNe3PrytprTvLSfBvEb/TcLCI1WOFQfKtoC1/ZaZVOu7YY= 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 169718439790817.186271211985627; Fri, 13 Oct 2023 01:06:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrD59-00062t-Oi; Fri, 13 Oct 2023 03:59:39 -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 1qrD55-0005Gp-ET for qemu-devel@nongnu.org; Fri, 13 Oct 2023 03:59:35 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrD53-0007EL-CM for qemu-devel@nongnu.org; Fri, 13 Oct 2023 03:59:35 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40651a72807so18845975e9.1 for ; Fri, 13 Oct 2023 00:59:32 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 00:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697183971; x=1697788771; 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=TgVJaEUfo38wurBGn+D3UK3JXthAmJ84+zCqcU6HvLo=; b=iY7uy/36mhcTothe3w+judS62EWMyoSuOiPhTWrecb6WwV2r9XtPDKbjaAQRyBVioo GdX5AdxIW676VvYPbngMGHm1vO9O0Twzb5t67sy+vEa5qoRSZ1AzkGhQuLW2XspshFSK ArEW20HrWtA9N0agQp48HzFgNs13vZLCCvoBVSnu76ciInRYcBgoyiaYTAkVe4/oWstX HI5xf15gAjChqkusSbIwOBNbO9yaoT6Ciu/qmWuX5aM+ixBer2TFBfKXr8sAjGCEDnJV n/L3NItRz0dvbl7OWzzw3gn/G/0p/daKkWw1RxWksqFt/+DGVJzAjaC0zX60GNldyQ62 7GEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697183971; x=1697788771; 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=TgVJaEUfo38wurBGn+D3UK3JXthAmJ84+zCqcU6HvLo=; b=jsr9UNc3GOi4Ywd5WYp+zODL+8v82fRS6NybGfuD0u2FuW2yi8PQFXMuu7umeWBgI1 Y1dYoxcArZ8d7XCiWqQvzfj981KpkmIliTqwVVLiv3IrtJReanCF+jPsJfBWa1lC3u9J TICdEffxCgbwm426dISq6Nh6h3Y0VhvexTGR6fQcmRNJKNhiMwt2avYgASWnvU/e/tQd v4novtiaCEzPfMSjO1iNksJd6HGfjNbECcXqvbj0ta2IajVYovALDCNb9ucEW8bYfQ2p xSjuU6FqowwRveH2hT7dtxEfxRYu2k3+Gr8u0Hx2pUHAeKJsLkEkvrD735dVXeESUjZE bYTg== X-Gm-Message-State: AOJu0Yz7BW3gStt0yrU6AYZ9Myl/04M6jtUX/woF6GLwrSnB3QLZQFgM A7Bo/cBccXqEZElLH5EusI6H4t7YAOexCxnvZ+U= X-Google-Smtp-Source: AGHT+IFrSjd/IF5PUsL6BbARcFWKBru3hbVCAHtOrQClFjbCkDvMDO/31/Xjj00xB8iaZK0panpzJg== X-Received: by 2002:a05:600c:2113:b0:401:73b2:f043 with SMTP id u19-20020a05600c211300b0040173b2f043mr24211583wml.1.1697183971468; Fri, 13 Oct 2023 00:59:31 -0700 (PDT) From: Emmanouil Pitsidianakis To: qemu-devel@nongnu.org Cc: Emmanouil Pitsidianakis , Peter Maydell , qemu-arm@nongnu.org (open list:nSeries) Subject: [RFC PATCH v2 56/78] hw/input: add fallthrough pseudo-keyword Date: Fri, 13 Oct 2023 10:57:23 +0300 Message-Id: <7f9ab65c5376669408c00fa27d187aef66f2d26e.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::336; envelope-from=manos.pitsidianakis@linaro.org; helo=mail-wm1-x336.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: 1697184399436100006 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/input/hid.c | 3 ++- hw/input/tsc2005.c | 4 ++-- hw/input/tsc210x.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/input/hid.c b/hw/input/hid.c index a9c7dd1ce1..15fffc5dfb 100644 --- a/hw/input/hid.c +++ b/hw/input/hid.c @@ -250,88 +250,89 @@ static void hid_keyboard_event(DeviceState *dev, Qemu= Console *src, static void hid_keyboard_process_keycode(HIDState *hs) { uint8_t hid_code, index, key; int i, keycode, slot; =20 if (hs->n =3D=3D 0) { return; } slot =3D hs->head & QUEUE_MASK; QUEUE_INCR(hs->head); hs->n--; keycode =3D hs->kbd.keycodes[slot]; =20 if (!hs->n) { trace_hid_kbd_queue_empty(); } =20 key =3D keycode & 0x7f; index =3D key | ((hs->kbd.modifiers & (1 << 8)) >> 1); hid_code =3D hid_usage_keys[index]; hs->kbd.modifiers &=3D ~(1 << 8); =20 switch (hid_code) { case 0x00: return; =20 case 0xe0: assert(key =3D=3D 0x1d); if (hs->kbd.modifiers & (1 << 9)) { /* The hid_codes for the 0xe1/0x1d scancode sequence are 0xe9/= 0xe0. * Here we're processing the second hid_code. By dropping bit= 9 * and setting bit 8, the scancode after 0x1d will access the * second half of the table. */ hs->kbd.modifiers ^=3D (1 << 8) | (1 << 9); return; } /* fall through to process Ctrl_L */ + fallthrough; case 0xe1 ... 0xe7: /* Ctrl_L/Ctrl_R, Shift_L/Shift_R, Alt_L/Alt_R, Win_L/Win_R. * Handle releases here, or fall through to process presses. */ if (keycode & (1 << 7)) { hs->kbd.modifiers &=3D ~(1 << (hid_code & 0x0f)); return; } - /* fall through */ + fallthrough; case 0xe8 ... 0xe9: /* USB modifiers are just 1 byte long. Bits 8 and 9 of * hs->kbd.modifiers implement a state machine that detects the * 0xe0 and 0xe1/0x1d sequences. These bits do not follow the * usual rules where bit 7 marks released keys; they are cleared * elsewhere in the function as the state machine dictates. */ hs->kbd.modifiers |=3D 1 << (hid_code & 0x0f); return; =20 case 0xea ... 0xef: abort(); =20 default: break; } =20 if (keycode & (1 << 7)) { for (i =3D hs->kbd.keys - 1; i >=3D 0; i--) { if (hs->kbd.key[i] =3D=3D hid_code) { hs->kbd.key[i] =3D hs->kbd.key[-- hs->kbd.keys]; hs->kbd.key[hs->kbd.keys] =3D 0x00; break; } } if (i < 0) { return; } } else { for (i =3D hs->kbd.keys - 1; i >=3D 0; i--) { if (hs->kbd.key[i] =3D=3D hid_code) { break; } } if (i < 0) { if (hs->kbd.keys < sizeof(hs->kbd.key)) { hs->kbd.key[hs->kbd.keys++] =3D hid_code; } } else { return; } } } diff --git a/hw/input/tsc2005.c b/hw/input/tsc2005.c index db2b80e35f..4f3f1d9d12 100644 --- a/hw/input/tsc2005.c +++ b/hw/input/tsc2005.c @@ -234,70 +234,70 @@ static void tsc2005_write(TSC2005State *s, int reg, u= int16_t data) /* This handles most of the chip's logic. */ static void tsc2005_pin_update(TSC2005State *s) { int64_t expires; bool pin_state; =20 switch (s->pin_func) { case 0: pin_state =3D !s->pressure && !!s->dav; break; case 1: case 3: default: pin_state =3D !s->dav; break; case 2: pin_state =3D !s->pressure; } =20 if (pin_state !=3D s->irq) { s->irq =3D pin_state; qemu_set_irq(s->pint, s->irq); } =20 switch (s->nextfunction) { case TSC_MODE_XYZ_SCAN: case TSC_MODE_XY_SCAN: if (!s->host_mode && s->dav) s->enabled =3D false; if (!s->pressure) return; - /* Fall through */ + fallthrough; case TSC_MODE_AUX_SCAN: break; =20 case TSC_MODE_X: case TSC_MODE_Y: case TSC_MODE_Z: if (!s->pressure) return; - /* Fall through */ + fallthrough; case TSC_MODE_AUX: case TSC_MODE_TEMP1: case TSC_MODE_TEMP2: case TSC_MODE_X_TEST: case TSC_MODE_Y_TEST: case TSC_MODE_TS_TEST: if (s->dav) s->enabled =3D false; break; =20 case TSC_MODE_RESERVED: case TSC_MODE_XX_DRV: case TSC_MODE_YY_DRV: case TSC_MODE_YX_DRV: default: return; } =20 if (!s->enabled || s->busy) return; =20 s->busy =3D true; s->precision =3D s->nextprecision; s->function =3D s->nextfunction; s->pdst =3D !s->pnd0; /* Synchronised on internal clock */ expires =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + (NANOSECONDS_PER_SECOND >> 7); timer_mod(s->timer, expires); } diff --git a/hw/input/tsc210x.c b/hw/input/tsc210x.c index 950506fb38..9ae426e1a6 100644 --- a/hw/input/tsc210x.c +++ b/hw/input/tsc210x.c @@ -774,70 +774,70 @@ static void tsc2102_audio_register_write( /* This handles most of the chip logic. */ static void tsc210x_pin_update(TSC210xState *s) { int64_t expires; bool pin_state; =20 switch (s->pin_func) { case 0: pin_state =3D s->pressure; break; case 1: pin_state =3D !!s->dav; break; case 2: default: pin_state =3D s->pressure && !s->dav; } =20 if (!s->enabled) pin_state =3D false; =20 if (pin_state !=3D s->irq) { s->irq =3D pin_state; qemu_set_irq(s->pint, !s->irq); } =20 switch (s->nextfunction) { case TSC_MODE_XY_SCAN: case TSC_MODE_XYZ_SCAN: if (!s->pressure) return; break; =20 case TSC_MODE_X: case TSC_MODE_Y: case TSC_MODE_Z: if (!s->pressure) return; - /* Fall through */ + fallthrough; case TSC_MODE_BAT1: case TSC_MODE_BAT2: case TSC_MODE_AUX: case TSC_MODE_TEMP1: case TSC_MODE_TEMP2: if (s->dav) s->enabled =3D false; break; =20 case TSC_MODE_AUX_SCAN: case TSC_MODE_PORT_SCAN: break; =20 case TSC_MODE_NO_SCAN: case TSC_MODE_XX_DRV: case TSC_MODE_YY_DRV: case TSC_MODE_YX_DRV: default: return; } =20 if (!s->enabled || s->busy || s->dav) return; =20 s->busy =3D true; s->precision =3D s->nextprecision; s->function =3D s->nextfunction; expires =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + (NANOSECONDS_PER_SECOND >> 10); timer_mod(s->timer, expires); } --=20 2.39.2