From patchwork Wed Mar 11 04:51:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 11432189 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8C18F1392 for ; Wed, 11 Mar 2020 16:25:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 25BBE206F7 for ; Wed, 11 Mar 2020 16:25:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cbSCH5a2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 25BBE206F7 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-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=c9yhbCCpsPBL+qbQ/5i2uUWofxIEctDJe9QZAj7iq5c=; b=cbSCH5a2FASE6p bWOSc0e8fKcA0EUJt6VqJkOWJ18Joh8d++6PuYpPJRmSmbAIXZ9YT9FKiK4vKwzmkP+pTUcBSVsp/ GRbPOmC8sCAfA/j3t4LXPDgKfpQkrOCU9WgRkLtTazi1G+M6O7pDK+FJHannyVFurpZ3t54zN6khi kX3bUuMTLpQ10rLLOYzNxt+MklXDwfHTa/x+ajMTgnNFAQeHeImS/070EaHPS8Ll/peZaEBQdn93Q 5/E5ewfvyVoFpNoQXIZh9A5POEN04C4oBf1rZV4Qms1lwIsRse2l4YlF4lTon/5rERsn0H+gkWXE8 2wnW3YvyW3YT0rfPh0sA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jC4An-0006Zu-9b; Wed, 11 Mar 2020 16:25:33 +0000 Received: from smtprelay0184.hostedemail.com ([216.40.44.184] helo=smtprelay.hostedemail.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jBtZq-0006zE-BT; Wed, 11 Mar 2020 05:06:46 +0000 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 34C948418; Wed, 11 Mar 2020 05:06:39 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 10, 1, 0, , d41d8cd98f00b204, joe@perches.com, , RULES_HIT:230:355:379:541:857:960:966:967:973:982:988:989:1042:1260:1311:1314:1345:1437:1515:1605:1730:1747:1777:1792:1801:2194:2196:2197:2198:2199:2200:2201:2202:2393:2525:2561:2564:2682:2685:2734:2859:2894:2896:2901:2902:2904:2914:2915:2924:2925:2926:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3165:3302:3865:3866:3867:3868:3870:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4225:4250:4321:4384:4385:4395:4559:4605:5007:6261:6299:6630:6737:6738:6742:6743:7688:7875:7903:7974:8549:8568:8784:8957:9025:9038:9149:10004:10394:11026:11657:11914:12043:12048:12295:12296:12297:12438:12555:12679:12688:12690:12697:12702:12712:12713:12723:12726:12731:12737:12740:12895:12903:12986:13160:13161:13184:13229:13894:14096:14394:14877:21060:21080:21221:21324:21325:21433:21451:21611:21627:21740:21771:21772:21773:21774:21789:21795:21796:21811:21939:21965:21990:30009:30010:30012:30036:30054:30055:30065:3007 X-HE-Tag: oven06_19d681dffdc56 X-Filterd-Recvd-Size: 138927 Received: from joe-laptop.perches.com (unknown [47.151.143.254]) (Authenticated sender: joe@perches.com) by omf16.hostedemail.com (Postfix) with ESMTPA; Wed, 11 Mar 2020 05:06:17 +0000 (UTC) From: Joe Perches To: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-tegra@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-csky@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, oprofile-list@lists.sf.net, kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-edac@vger.kernel.org, linux-block@vger.kernel.org, linux-crypto@vger.kernel.org, linux-acpi@vger.kernel.org, devel@acpica.org, linux-ide@vger.kernel.org, linux-atm-general@lists.sourceforge.net, drbd-dev@lists.linbit.com, ceph-devel@vger.kernel.org, xen-devel@lists.xenproject.org, linux-bluetooth@vger.kernel.org, openipmi-developer@lists.sourceforge.net, linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@axis.com, dmaengine@vger.kernel.org, linux1394-devel@lists.sourceforge.net, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-stm32@st-md-mailman.stormreply.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-amlogic@lists.infradead.org, nouveau@lists.freedesktop.org, greybus-dev@lists.linaro.org, linux-input@vger.kernel.org, linux-usb@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-i2c@vger.kernel.org, openbmc@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-rdma@vger.kernel.org, target-devel@vger.kernel.org, patches@opensource.cirrus.com, iommu@lists.linux-foundation.org, virtualization@lists.linux-foundation.org, linux-bcache@vger.kernel.org, dm-devel@redhat.com, linux-raid@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-can@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-acenic@sunsite.dk, bcm-kernel-feedback-list@broadcom.com, linux-parisc@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-hams@vger.kernel.org, ath10k@lists.infradead.org, ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, wcn36xx@lists.infradead.org, b43-dev@lists.infradead.org, linux-nfc@lists.01.org, linux-ntb@googlegroups.com, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, linux-rockchip@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-remoteproc@vger.kernel.org, linux-rtc@vger.kernel.org, linux-s390@vger.kernel.org, esc.storagedev@microsemi.com, open-iscsi@googlegroups.com, megaraidlinux.pdl@broadcom.com, linux-spi@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-serial@vger.kernel.org, linux-unisoc@lists.infradead.org, sparclinux@vger.kernel.org, accessrunner-general@lists.sourceforge.net, usb-storage@lists.one-eyed-alien.net, linux-fbdev@vger.kernel.org, linux-watchdog@vger.kernel.org, v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org, linux-aio@kvack.org, linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-nvdimm@lists.01.org, cluster-devel@redhat.com, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, io-uring@vger.kernel.org, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-mm@kvack.org, linux-audit@redhat.com, linux-security-module@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net, cgroups@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, dccp@vger.kernel.org, linux-decnet-user@lists.sourceforge.net, mptcp@lists.01.org, lvs-devel@vger.kernel.org, dev@openvswitch.org, rds-devel@oss.oracle.com, cake@lists.bufferbloat.net, linux-sctp@vger.kernel.org, tipc-discussion@lists.sourceforge.net, linux-x25@vger.kernel.org, linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, selinux@vger.kernel.org, alsa-devel@alsa-project.org, clang-built-linux@googlegroups.com Subject: [PATCH -next 000/491] treewide: use fallthrough; Date: Tue, 10 Mar 2020 21:51:14 -0700 Message-Id: X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 X-Spam-Note: CRM114 run bypassed due to message size (137554 bytes) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [216.40.44.184 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [216.40.44.184 listed in wl.mailspike.net] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Mailman-Approved-At: Wed, 11 Mar 2020 09:25:32 -0700 X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: uclinux-h8-devel@lists.sourceforge.jp, linux-xtensa@linux-xtensa.org, brcm80211-dev-list.pdl@broadcom.com, devel@driverdev.osuosl.org, linux-ia64@vger.kernel.org, linux-c6x-dev@linux-c6x.org, linux-sh@vger.kernel.org, oss-drivers@netronome.com, linux-hexagon@vger.kernel.org, bridge@lists.linux-foundation.org, linux-um@lists.infradead.org, qat-linux@intel.com, brcm80211-dev-list@cypress.com, linux-wpan@vger.kernel.org, openrisc@lists.librecores.org, linux-alpha@vger.kernel.org, linux-i3c@lists.infradead.org, linux-snps-arc@lists.infradead.org, freedreno@lists.freedesktop.org, linux-clk@vger.kernel.org, ocfs2-devel@oss.oracle.com Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org There is a new fallthrough pseudo-keyword macro that can be used to replace the various /* fallthrough */ style comments that are used to indicate a case label code block is intended to fallthrough to the next case label block. See commit 294f69e662d1 ("compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use") These patches are intended to allow clang to detect missing switch/case fallthrough uses. Do a depth-first pass on the MAINTAINERS file and find the various F: pattern files and convert the fallthrough comments to fallthrough; for all files matched by all F: patterns in in each section. Done via the perl script below and the previously posted cvt_fallthrough.pl script. Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe.com/ These patches are based on next-20200310 and are available in git://repo.or.cz/linux-2.6/trivial-mods.git in branch 20200310_fallthrough_2 $ cat commit_fallthrough.pl #!/usr/bin/env perl use sort 'stable'; # # Reorder a sorted array so file entries are before directory entries # depends on a trailing / for directories # so: # foo/ # foo/bar.c # becomes # foo/bar.c # foo/ # sub file_before_directory { my ($array_ref) = (@_); my $count = scalar(@$array_ref); for (my $i = 1; $i < $count; $i++) { if (substr(@$array_ref[$i - 1], -1) eq '/' && substr(@$array_ref[$i], 0, length(@$array_ref[$i - 1])) eq @$array_ref[$i - 1]) { my $string = @$array_ref[$i - 1]; @$array_ref[$i - 1] = @$array_ref[$i]; @$array_ref[$i] = $string; } } } sub uniq { my (@parms) = @_; my %saw; @parms = grep(!$saw{$_}++, @parms); return @parms; } # Get all the F: file patterns in MAINTAINERS that could be a .[ch] file my $maintainer_patterns = `grep -P '^F:\\s+' MAINTAINERS`; my @patterns = split('\n', $maintainer_patterns); s/^F:\s*// for @patterns; @patterns = grep(!/^(?:Documentation|tools|scripts)\//, @patterns); @patterns = grep(!/\.(?:dtsi?|rst|config)$/, @patterns); @patterns = sort @patterns; @patterns = sort { $b =~ tr/\//\// cmp $a =~ tr/\//\// } @patterns; file_before_directory(\@patterns); my %sections_done; foreach my $pattern (@patterns) { # Find the files the pattern matches my $pattern_files = `git ls-files -- $pattern`; my @new_patterns = split('\n', $pattern_files); $pattern_files = join(' ', @new_patterns); next if ($pattern_files =~ /^\s*$/); # Find the section the first file matches my $pattern_file = @new_patterns[0]; my $section_output = `./scripts/get_maintainer.pl --nogit --nogit-fallback --sections --pattern-depth=1 $pattern_file`; my @section = split('\n', $section_output); my $section_header = @section[0]; print("Section: <$section_header>\n"); # Skip the section if it's already done print("Already done '$section_header'\n") if ($sections_done{$section_header}); next if ($sections_done{$section_header}++); # Find all the .[ch] files in all F: lines in that section my @new_section; foreach my $line (@section) { last if ($line =~ /^\s*$/); push(@new_section, $line); } @section = grep(/^F:/, @new_section); s/^F:\s*// for @section; @section = grep(!/^(?:Documentation|tools|scripts)\//, @section); @section = grep(!/\.(?:dtsi?|rst|config)$/, @section); @section = sort @section; @section = uniq(@section); my $section_files = join(' ', @section); print("section_files: <$section_files>\n"); next if ($section_files =~ /^\s*$/); my $cvt_files = `git ls-files -- $section_files`; my @files = split('\n', $cvt_files); @files = grep(!/^(?:Documentation|tools|scripts)\//, @files); @files = grep(!/\.(?:dtsi?|rst|config)$/, @files); @files = grep(/\.[ch]$/, @files); @files = sort @files; @files = uniq(@files); $cvt_files = join(' ', @files); print("files: <$cvt_files>\n"); next if (scalar(@files) < 1); # Convert fallthroughs for all [.ch] files in the section print("doing cvt_fallthrough.pl -- $cvt_files\n"); `cvt_fallthrough.pl -- $cvt_files`; # If nothing changed, nothing to commit `git diff-index --quiet HEAD --`; next if (!$?); # Commit the changes my $fh; open($fh, "+>", "cvt_fallthrough.commit_msg") or die "$0: can't create temporary file: $!\n"; print $fh <