From patchwork Thu Mar 3 10:04:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12767278 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7BDF9C433EF for ; Thu, 3 Mar 2022 10:05:08 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.282891.481729 (Exim 4.92) (envelope-from ) id 1nPiKN-0000jY-5n; Thu, 03 Mar 2022 10:04:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 282891.481729; Thu, 03 Mar 2022 10:04:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nPiKN-0000jR-2P; Thu, 03 Mar 2022 10:04:55 +0000 Received: by outflank-mailman (input) for mailman id 282891; Thu, 03 Mar 2022 10:04:54 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nPiKM-0000jF-0D for xen-devel@lists.xenproject.org; Thu, 03 Mar 2022 10:04:54 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5e7c470d-9ad9-11ec-8539-5f4723681683; Thu, 03 Mar 2022 11:04:52 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01lp2058.outbound.protection.outlook.com [104.47.0.58]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-38-gLdoUpSfN7SGC5FW8-VIYQ-1; Thu, 03 Mar 2022 11:04:51 +0100 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB3311.eurprd04.prod.outlook.com (2603:10a6:802:f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.25; Thu, 3 Mar 2022 10:04:49 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::d479:b728:345c:bd65]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::d479:b728:345c:bd65%6]) with mapi id 15.20.5038.014; Thu, 3 Mar 2022 10:04:49 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5e7c470d-9ad9-11ec-8539-5f4723681683 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1646301892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ScIjlcvytU8BXsKkAKsbjjW3FXOU4vzzSPWi7azT27I=; b=H/BzgMs0s60fsQdfPoItMZOqU+BCDol3tfI3qedUlT+pYHKpF/xXJSvNpuzApMBxb0CD4p UYtgVNAJTrS/tGurndyhmfQDV13td4AeyLCPIm8+WoVi721i91BSsMYgbbuBG080ErG1j7 oStce6gINVaTRnoh3f+D4jLgkfmX41I= X-MC-Unique: gLdoUpSfN7SGC5FW8-VIYQ-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jn0Q6+kkh5PWhepSgu+HS3lFWwfdWbwtG5QlDuvUoXbGqgEBESTMYF/+tkbNXiGP+Oq2ofqIkdC7ko2QuTY/N9sEThX9bghQxV8/ixf8waT9exduw78Neg7e6zOl3iB0Li9ZGygzQvFWKlQj5T1h4zcUxxFuCQBOsPLkwBmOrmtWTvrWI/I/TOativZCkzdnMUMFebNgVcy1i4nubcB8h2KXOtNICUeaOnpibPPqKbTmlia12Y8SJWEt//gimgCOpAcyl2JJZzfoOcB6QDZvXzco/Nwn15TK7kqSfFJSVoXLdwACl16MN9x4LuC9vCR7kB3rSlI3MTTYUAf14FRQpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ScIjlcvytU8BXsKkAKsbjjW3FXOU4vzzSPWi7azT27I=; b=aw+eaf66yAn9qWwR0ayJqyxim9wo36I3WODkuDYa5nnhQ4huSQx3mMIDOqJhu2pRrsVEJ3X5sTqfrzTIyi1/PCGXA6vs+5GX5MSwkYsBnQAI+JcwBHR7JYK6HjZpgWpnTXYe2NYeD1f00PCoZQCXqLnBkQgOtBruIhbRPbcHn+I8kPvLBFC2YJLJ/4VgZX+rAs0drY6XOO6If+evX4YkQWNre6G70GS1lXZWRrylriMW3iWNJcayghrS717JrwY6/EJJtPulL+PogfecCV/CFron6SW7HcICcpXiHjoAQ/zJq/iKjV62edPD4C4jSAniKAvTgqY86DILyc9aPzn14g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: Date: Thu, 3 Mar 2022 11:04:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: [PATCH v3 1/7] xz: add fall-through comments to a switch statement Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu References: In-Reply-To: X-ClientProxiedBy: AS8PR07CA0037.eurprd07.prod.outlook.com (2603:10a6:20b:459::9) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 428027f1-c2b1-447d-2ff1-08d9fcfd40aa X-MS-TrafficTypeDiagnostic: VI1PR04MB3311:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6hltHTVQI53Lvf0UqAoUtAhlVO29/IoRbSpgeqlo2IuZbumzdmPfKp0CUsj7VTVgQN5eVbPkVi9EBXH5DJ+oMQ9I3oVZFa7+RRxOZTGb9k0NujC2nwk72VacDEBMdXk0d65RNjEPvcC5bSoY0f3DMfz+ob2aVloXblmTZs/5teL8/l2/RMRlyDaIY5ORwr0oVB5sspvCi5tlms47GZ9bxsUR4RDKZzVr6vESXAFYVv5gywWiCl3mfB487z0LdQNsKh8tC8/0dlklSavZ4N7/wlN+tYIvJw5kr9VOilLocIIdpFTQEV9+j6sZyQ3f5UabVt5b3d+S0yHT/iu8oQgaznRSDDk9wLRXxSD6YtSWoxlhTFBSm+UdkdVrAT6fMhRNOeTgaWQFo0ZiBEae382XKQiuXmPntxVwwKSQ/5CdAnx3vtsC5dztFqcXz9wgt/H0Zb6mnpSkJG/AbO2mKeYraVLKC6/o4KSP9dbgxGp0hvI8RR/bpElmU376ZJsN3KLA2de1XdIYnbUmlxkOXjXh5knd8eqwHOPjUSeLfxg91OvXkbvu6bIcyh6Pqt1JAuLil4qzm75gvjUBESYaSbwTqOUYi4rVMJuV55yqTkJO1RFOc/HSe3qtYEBeS+ytQwc6TZxD2o8KWsqZ+FE9VetanG9C6RESjon6VD1RQviy4DkYYBbOmyxsD0CSXKr+cyQ4jsOKWe3buG07spWP/uSMK7p6kNAHTxCT1IyeHqPi/dPKeD+RRtwHCKGQzHtq0N6S X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(83380400001)(38100700002)(5660300002)(6916009)(54906003)(66556008)(8676002)(4326008)(66476007)(66946007)(8936002)(316002)(6486002)(2616005)(186003)(26005)(508600001)(2906002)(6512007)(6506007)(31686004)(31696002)(36756003)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?ghH2v8NgRGK1W7NRon0YWZBB/Du8?= =?utf-8?q?rRvlFBaQL47NLexD4XErOF2V5WYlnX6EGYFgU1YM27vEG2BSd7VWgE4DOD336Mxyn?= =?utf-8?q?40nWSqVve4G0tv9dkVC7xaRsQZWe0kS9+GVwKBKiPj4WW/O9ymqI3S7iAYy3WRdvo?= =?utf-8?q?ZxFi4835fSq5LkzmrVCReg6iASXXscf9J61DO5CeOcqu7WqKsWotWlPSD01szE9bm?= =?utf-8?q?zh5nZMT7Ep5kQuP8f+4j8gBL9iU0tZaQQ5dlcubS2UVq+y45/lIBtKfiu8sZAPymQ?= =?utf-8?q?0Nmp/5ljHeicq2yKQkGwoJjKEa+I0hcIEXVzc+HrLUzui0SWvQXv/UqnTBktNUjn4?= =?utf-8?q?xvuqL2JRa+NK5myq0+E7IAqqm0PRfQ0FKQAt8QfE00doGqQtmi9K5ygZlpFClIm8p?= =?utf-8?q?rZQCdlMWO10lZIQdlda2+6Z+Qnf15nJ8mnNlJgN0hnjJZHsywkkPGdPTnBR2Qz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cKIw89EUfeRp4m?= =?utf-8?q?R2/1mld4GmO4tDwcTRY9z1vbZskl5wXfnxlp0oE2tUfk4N+lTQBXzNXSDU8037ELZ?= =?utf-8?q?N5+2wyhsFo3wAZRxHqA877NjDiMpUEh/0LSKfQ+LI8liRZlzT2xVCtjSQIOZQpeWi?= =?utf-8?q?cQlRURHsOGXTxwwpO/mh2DpJRLGq1Donk6Lut5Zu4gvpMGQ7sws2s7mZN1eUhpQiq?= =?utf-8?q?137zXSMnYtL6XKV14BFUgjyjgNS8pxWzCctRWwN/JsaQ4T1TQRs5T6U=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 428027f1-c2b1-447d-2ff1-08d9fcfd40aa X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2022 10:04:49.3643 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WVgtC3j4Bm9DQSuNyLLd6HRNoBBJB4Q/oImdYbFNspCFb8Ee7uLxIrfs8ZwonqlLqpAWGg2SF5MMYPuDclIdkA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3311 From: Lasse Collin It's good style. I was also told that GCC 7 is more strict and might give a warning when such comments are missing. Suggested-by: Andrei Borzenkov Signed-off-by: Lasse Collin Signed-off-by: Jiri Kosina [Linux commit: 5a244f48ecbbd03a11eb84819c5c599db81823ee] Signed-off-by: Jan Beulich Reviewed-by: Luca Fancellu --- Linux has meanwhile further moved to using the "fallthrough" pseudo- keyword, but us doing so requires the tool stack to first make this available for use in at least stubdom builds. --- v2: Retain the other S-o-b, for lack of mailing list source of the original submission. --- a/xen/common/xz/dec_stream.c +++ b/xen/common/xz/dec_stream.c @@ -583,6 +583,8 @@ static enum xz_ret __init dec_main(struc if (ret != XZ_OK) return ret; + /* Fall through */ + case SEQ_BLOCK_START: /* We need one byte of input to continue. */ if (b->in_pos == b->in_size) @@ -606,6 +608,8 @@ static enum xz_ret __init dec_main(struc s->temp.pos = 0; s->sequence = SEQ_BLOCK_HEADER; + /* Fall through */ + case SEQ_BLOCK_HEADER: if (!fill_temp(s, b)) return XZ_OK; @@ -616,6 +620,8 @@ static enum xz_ret __init dec_main(struc s->sequence = SEQ_BLOCK_UNCOMPRESS; + /* Fall through */ + case SEQ_BLOCK_UNCOMPRESS: ret = dec_block(s, b); if (ret != XZ_STREAM_END) @@ -623,6 +629,8 @@ static enum xz_ret __init dec_main(struc s->sequence = SEQ_BLOCK_PADDING; + /* Fall through */ + case SEQ_BLOCK_PADDING: /* * Size of Compressed Data + Block Padding @@ -643,6 +651,8 @@ static enum xz_ret __init dec_main(struc s->sequence = SEQ_BLOCK_CHECK; + /* Fall through */ + case SEQ_BLOCK_CHECK: if (s->check_type == XZ_CHECK_CRC32) { ret = crc32_validate(s, b); @@ -665,6 +675,8 @@ static enum xz_ret __init dec_main(struc s->sequence = SEQ_INDEX_PADDING; + /* Fall through */ + case SEQ_INDEX_PADDING: while ((s->index.size + (b->in_pos - s->in_start)) & 3) { @@ -687,6 +699,8 @@ static enum xz_ret __init dec_main(struc s->sequence = SEQ_INDEX_CRC32; + /* Fall through */ + case SEQ_INDEX_CRC32: ret = crc32_validate(s, b); if (ret != XZ_STREAM_END) @@ -695,6 +709,8 @@ static enum xz_ret __init dec_main(struc s->temp.size = STREAM_HEADER_SIZE; s->sequence = SEQ_STREAM_FOOTER; + /* Fall through */ + case SEQ_STREAM_FOOTER: if (!fill_temp(s, b)) return XZ_OK;