From mboxrd@z Thu Jan 1 00:00:00 1970 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 88A41C433F5 for ; Thu, 25 Nov 2021 16:54:27 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.231694.401083 (Exim 4.92) (envelope-from ) id 1mqI0i-00058J-JC; Thu, 25 Nov 2021 16:54:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 231694.401083; Thu, 25 Nov 2021 16:54:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mqI0i-00058C-GK; Thu, 25 Nov 2021 16:54:12 +0000 Received: by outflank-mailman (input) for mailman id 231694; Thu, 25 Nov 2021 16:54:11 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mqI0h-000586-As for xen-devel@lists.xenproject.org; Thu, 25 Nov 2021 16:54:11 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mqI0f-0007eD-Tf; Thu, 25 Nov 2021 16:54:09 +0000 Received: from 54-240-197-227.amazon.com ([54.240.197.227] helo=[192.168.27.59]) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mqI0f-0007xK-NS; Thu, 25 Nov 2021 16:54:09 +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" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: References:Cc:To:From:Subject:MIME-Version:Date:Message-ID; bh=QRXxjgMMRkvebRBsbWUbO88ows4kPijIYOeShacw/Wk=; b=du2FM1BTfNoGb2O88CIO8ZLqqw 2WSWBd/Htu/YzRFSeL487fkf0a7vX7i39xMrO9QTTrUqTlR493pkdLfsXDT05UiGGb2vO3jM0cH0e 5su383n1UZ+w19UjZCwLTk6wP5HA4rjllxAUc5gkdPn9SvahF/DfrgCwH6nUyRaBI4AI=; Message-ID: Date: Thu, 25 Nov 2021 16:54:07 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH 1/7] xz: add fall-through comments to a switch statement From: Julien Grall To: Jan Beulich , "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Ian Jackson , Stefano Stabellini , Wei Liu References: <0ed245fa-58a7-a5f6-b82e-48f9ed0b6970@suse.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 25/11/2021 16:49, Julien Grall wrote: > On 19/11/2021 10:21, Jan Beulich wrote: >> 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 Actually, any reason why there are some signed-off-by missing? >> [Linux commit: 5a244f48ecbbd03a11eb84819c5c599db81823ee] >> Signed-off-by: Jan Beulich > > Acked-by: Julien Grall > > Cheers, > >> --- >> 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. >> >> --- 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; >> > -- Julien Grall