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=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 8D724C433E2 for ; Fri, 11 Sep 2020 04:21:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 40F05221E5 for ; Fri, 11 Sep 2020 04:21:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cNLZBRQv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40F05221E5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Date:To:From: Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1u/oR72ugWvu7eJuTeV+o2//AkRmrIcvPFAoxDDg8aM=; b=cNLZBRQvhvdBYWuFILaAl9yS6 iZxWCMBKCgzO3nbYMpH/wxSj9cpbpoe4q/OcekLBmVoaq8P4my5n8/M+eExkR31D7feZbJUtJYmHx BtZdpDc58VWT5A/KPOysE0yhFtkBOHaCDeGKkWuBhd7cFPf6TCr+iRHIcyNt0yPMBn3Eb4btS40dn 7QyHPwEsDWAjwsjGunzqNa+PmiO/mbiGF3qttGX+mJJul60o68dm/Fet0yXyIOmuAaiZ/7Lud6k2V 576574MrQlwi89bvNdAwQh/0OZg3WTIILaVSr51KjAZL44EpauA1ZtjqJr+yvX3d1tFzTgVRuKT42 VIzsgxh4A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGaXM-0002BR-8f; Fri, 11 Sep 2020 04:19:48 +0000 Received: from smtprelay0152.hostedemail.com ([216.40.44.152] helo=smtprelay.hostedemail.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGaXJ-0002Au-R3; Fri, 11 Sep 2020 04:19:46 +0000 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id 12942837F24A; Fri, 11 Sep 2020 04:19:43 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: seat91_4d0f80d270eb X-Filterd-Recvd-Size: 4376 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf19.hostedemail.com (Postfix) with ESMTPA; Fri, 11 Sep 2020 04:19:36 +0000 (UTC) Message-ID: Subject: Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break; From: Joe Perches To: Robin Murphy , LKML , Jiri Kosina Date: Thu, 10 Sep 2020 21:19:35 -0700 In-Reply-To: <9372456a-8dcf-2735-57a4-e126aa5df3a6@arm.com> References: <9372456a-8dcf-2735-57a4-e126aa5df3a6@arm.com> User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200911_001945_927230_A0E3ECAF X-CRM114-Status: GOOD ( 17.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, oss-drivers@netronome.com, nouveau@lists.freedesktop.org, alsa-devel , dri-devel@lists.freedesktop.org, linux-mips@vger.kernel.org, linux-ide@vger.kernel.org, dm-devel@redhat.com, linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, sparclinux@vger.kernel.org, Will Deacon , linux-afs@lists.infradead.org, linux-rtc@vger.kernel.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, dccp@vger.kernel.org, linux-rdma@vger.kernel.org, linux-atm-general@lists.sourceforge.net, kvmarm@lists.cs.columbia.edu, coreteam@netfilter.org, intel-wired-lan@lists.osuosl.org, linux-serial@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, Kees Cook , linux-media@vger.kernel.org, linux-pm@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-nvme@lists.infradead.org, storagedev@microchip.com, ceph-devel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nick Desaulniers , linux-nfs@vger.kernel.org, linux-parisc@vger.kernel.org, netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-wireless@vger.kernel.org, linux-sctp@vger.kernel.org, iommu@lists.linux-foundation.org, netfilter-devel@vger.kernel.org, linux-crypto@vger.kernel.org, bpf@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 2020-09-10 at 15:21 +0100, Robin Murphy wrote: > On 2020-09-09 21:06, Joe Perches wrote: > > fallthrough to a separate case/default label break; isn't very readable. > > > > Convert pseudo-keyword fallthrough; statements to a simple break; when > > the next label is case or default and the only statement in the next > > label block is break; > > > > Found using: > > > > $ grep-2.5.4 -rP --include=*.[ch] -n "fallthrough;(\s*(case\s+\w+|default)\s*:\s*){1,7}break;" * > > > > Miscellanea: > > > > o Move or coalesce a couple label blocks above a default: block. > > > > Signed-off-by: Joe Perches > > --- > > > > Compiled allyesconfig x86-64 only. > > A few files for other arches were not compiled. > > > > [...] > > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > > index c192544e874b..743db1abec40 100644 > > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > > @@ -3777,7 +3777,7 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu) > > switch (FIELD_GET(IDR0_TTF, reg)) { > > case IDR0_TTF_AARCH32_64: > > smmu->ias = 40; > > - fallthrough; > > + break; > > case IDR0_TTF_AARCH64: > > break; > > default: > > I have to say I don't really agree with the readability argument for > this one - a fallthrough is semantically correct here, since the first > case is a superset of the second. It just happens that anything we would > do for the common subset is implicitly assumed (there are other > potential cases we simply haven't added support for at the moment), thus > the second case is currently empty. > This change actively obfuscates that distinction. Then perhaps comments should be added to usefully describe the mechanisms. case IDR0_TTF_AARCH32_64: smmu->ias = 40; fallthrough; /* and still do the 64 bit processing */ case IDR0_TTF_AARCH64: /* Nothing specific yet */ break; > Robin. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel