From patchwork Thu Dec 21 07:01:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82641 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 68AD138582BD for ; Thu, 21 Dec 2023 07:02:02 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 99DC0386188F for ; Thu, 21 Dec 2023 07:01:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 99DC0386188F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 99DC0386188F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142094; cv=none; b=mn61SQX8FUkcwwqjJN2vhPQD8J0DVVgAzlq7DJdiGTvSoIJqJJRlHTBFg8P1NbZ5R7N5u8BIDYTmwxAl38k/KKlZZfXai56Nz/nRrgZzwuB+SY4IYV+1KzzmwUgPYyc4Vu63hWcxLciZqSTMmQCZWN3sSpqEnr7zJbY3EMPB/Zg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703142094; c=relaxed/simple; bh=pHLVo75Jr4CfeGSfZkunJXNErIso1Hi8Z4op/PIMVd8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=vsxxfPYTlcHEz4yKT0w2SANeVgGLEXPq3fsx/m+3Fi31ZRjgRWrnswUZfoJLnSMRmqbvrWl6+fMraNnwdmR9eDmK8zgszfPZUmt/+rdoOHteHHUauEzwVqB1A9mSzACbnEVdXZKf1r/XHPjBXLgVu3rnpQrxe2sDspUm3v6CnbI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 3867C340943; Thu, 21 Dec 2023 07:01:33 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed 03/20] sim: common: fix -Wimplicit-fallthrough warnings Date: Thu, 21 Dec 2023 02:01:10 -0500 Message-ID: <20231221070127.19142-3-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221070127.19142-1-vapier@gentoo.org> References: <20231221070127.19142-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Replace some fall through comments with the attribute. --- sim/common/dv-cfi.c | 6 ++++-- sim/common/hw-properties.c | 2 +- sim/common/sim-memopt.c | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sim/common/dv-cfi.c b/sim/common/dv-cfi.c index 95498d7a2f40..b9c9acdb6820 100644 --- a/sim/common/dv-cfi.c +++ b/sim/common/dv-cfi.c @@ -210,7 +210,7 @@ cfi_unshift_addr (struct cfi *cfi, unsigned addr) { switch (cfi->width) { - case 4: addr >>= 1; /* fallthrough. */ + case 4: addr >>= 1; ATTRIBUTE_FALLTHROUGH; case 2: addr >>= 1; } return addr; @@ -414,7 +414,7 @@ cfi_io_write_buffer (struct hw *me, const void *source, int space, goto done; } - /* Fall through. */ + ATTRIBUTE_FALLTHROUGH; default: if (!cfi->cmdset->write (me, cfi, source, offset, value, nr_bytes)) @@ -490,6 +490,8 @@ cfi_io_read_buffer (struct hw *me, void *dest, int space, break; } + ATTRIBUTE_FALLTHROUGH; + default: if (!cfi->cmdset->read (me, cfi, dest, offset, shifted_offset, nr_bytes)) HW_TRACE ((me, "unhandled state %s", state_names[cfi->state])); diff --git a/sim/common/hw-properties.c b/sim/common/hw-properties.c index f1d7a77ec50d..42b4d3a7426d 100644 --- a/sim/common/hw-properties.c +++ b/sim/common/hw-properties.c @@ -829,7 +829,7 @@ hw_find_string_array_property (struct hw *me, if (node->sizeof_array == 0 || ((char*)node->array)[node->sizeof_array - 1] != '\0') hw_abort (me, "property \"%s\" invalid for string array", property); - /* FALL THROUGH */ + ATTRIBUTE_FALLTHROUGH; case string_array_property: ASSERT (node->sizeof_array > 0); ASSERT (((char*)node->array)[node->sizeof_array - 1] == '\0'); diff --git a/sim/common/sim-memopt.c b/sim/common/sim-memopt.c index 7d46a864afc5..c179d6ab8109 100644 --- a/sim/common/sim-memopt.c +++ b/sim/common/sim-memopt.c @@ -300,10 +300,10 @@ parse_size (char *chp, break; case 'g': case 'G': /* Gigabyte suffix. */ *nr_bytes <<= 10; - /* Fall through. */ + ATTRIBUTE_FALLTHROUGH; case 'm': case 'M': /* Megabyte suffix. */ *nr_bytes <<= 10; - /* Fall through. */ + ATTRIBUTE_FALLTHROUGH; case 'k': case 'K': /* Kilobyte suffix. */ *nr_bytes <<= 10; /* Check for a modulo specifier after the suffix. */