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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EEB4C10F27 for ; Tue, 10 Mar 2020 11:12:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 480B62468D for ; Tue, 10 Mar 2020 11:12:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 480B62468D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D5D6F6B0005; Tue, 10 Mar 2020 07:12:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CE6A76B0006; Tue, 10 Mar 2020 07:12:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD6276B0007; Tue, 10 Mar 2020 07:12:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0239.hostedemail.com [216.40.44.239]) by kanga.kvack.org (Postfix) with ESMTP id A33CF6B0005 for ; Tue, 10 Mar 2020 07:12:13 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 8DCAE8248047 for ; Tue, 10 Mar 2020 11:12:13 +0000 (UTC) X-FDA: 76579188546.02.heat83_6ab6005d6a729 X-HE-Tag: heat83_6ab6005d6a729 X-Filterd-Recvd-Size: 4134 Received: from smtprelay.hostedemail.com (smtprelay0045.hostedemail.com [216.40.44.45]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Mar 2020 11:12:13 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id E15B6837F24D; Tue, 10 Mar 2020 11:12:12 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: worm72_6a6262640771f X-Filterd-Recvd-Size: 2949 Received: from XPS-9350.home (unknown [47.151.143.254]) (Authenticated sender: joe@perches.com) by omf06.hostedemail.com (Postfix) with ESMTPA; Tue, 10 Mar 2020 11:12:10 +0000 (UTC) Message-ID: <7e2471ed71a42d74c0dbd9f2197034f5163d0eda.camel@perches.com> Subject: Re: [PATCH] mm: Use fallthrough; From: Joe Perches To: Sergey Senozhatsky Cc: Sergey Senozhatsky , Andrew Morton , Johannes Weiner , Michal Hocko , Vladimir Davydov , Hugh Dickins , Minchan Kim , Nitin Gupta , linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Date: Tue, 10 Mar 2020 04:10:29 -0700 In-Reply-To: <20200309064806.GB46830@google.com> References: <20200308031825.GB1125@jagdpanzerIV.localdomain> <5f297e8995b22c9ccf06d4d0a04f7d9a37d3cd77.camel@perches.com> <20200309041551.GA1765@jagdpanzerIV.localdomain> <84f3c9891d4e89909d5537f34ea9d75de339c415.camel@perches.com> <20200309062046.GA46830@google.com> <20200309064806.GB46830@google.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, 2020-03-09 at 15:48 +0900, Sergey Senozhatsky wrote: > On (20/03/09 15:20), Sergey Senozhatsky wrote: > [..] > > > I've no real opinion about that necessity. > > > > > > fallthrough commments are relatively rarely used as a > > > separating element between case labels. > > > > > > It's by far most common to just have consecutive case labels > > > without any other content. > > > > > > It's somewhere between 500:1 to 1000:1 in the kernel. > > > > I thought that those labels were used by some static code analysis > > tools, so that the removal of some labels raised questions. But I > > don't think I have opinions otherwise. > > ... I guess GCC counts as a static code analysis tool :) > > Looking at previous commits, people wanted to have proper 'fall through' > > > Replace "fallthru" with a proper "fall through" annotation. > This fix is part of the ongoing efforts to enabling > -Wimplicit-fallthrough > > --- > > - case ZPOOL_MM_RW: /* fallthru */ > + case ZPOOL_MM_RW: /* fall through */ That conversion was unnecessary. (there are still 6 /* fallthru */ comments in today's kernel) There are tens of thousands of consecutive case labels without interleaving fallthrough comments in the kernel like: switch (foo) { case BAR: case BAZ: do_something(); break; default: something_else(); break; } So gcc and clang handle consecutive cases without fallthrough without uselessly emitting warnings just fine.