Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2318638ybp; Sat, 5 Oct 2019 09:47:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdVqGSOxFw/ZDVSBj6m8rOVJWQDNVVrEqigSZUByqmC2rcMbxbG6uwjDkdcl5KGpnNdTUn X-Received: by 2002:a17:906:3746:: with SMTP id e6mr16676027ejc.238.1570294046564; Sat, 05 Oct 2019 09:47:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570294046; cv=none; d=google.com; s=arc-20160816; b=dB5OlkVr8AGhxltwA0VaP6sPr2xmGC10htPmtQLrNQSIFG8sD2c43trvl7Ymc5FSjR RbncqY09qwq7DFh0cVbiPyLA0wxT60agFC7d6iK55AP80bJzKL/jgTGT3qJDwbxDcoPU Z+Dgbbd9Aboad8s2MXGCyULj9P6zT+QrW8YPLUgtTEJmdflYgBgxqF9VAlklf0u7YyhY BYpzc8dgcqewCGPxBbx9SauO1pXUqZYCd60bLb4JoZaecqHSRTpD3BlVdk5c34Du1IMF AA8raogznAR2SnaXrwXmIff7ADuQ7FJRYBctyWwG2EFyHzQFeDwJIRWZx6zSecWs56zh SE2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=GzCGpUKqJSbn2Z3KutWD6ZF6sUxZESiYS0anMuTGgV4=; b=hEWAb3JK45oGa/nTJOND5/QMseAer6c2DYycBeBppUPCXfI/SyuJq3pM4sXq8IF6IV 3NSZ6cL2d1gLwkinDju1XYl4gttOsLzWd27wL1uahNhBktw0e4q4dwG0VNWQW7tgYTVg 2V6EwsD+5tCt3vYFn6hSCF37v9pGmkeCtEflPGlB8gCVb/0HUX1GJh2IXX0M4XO9llJh W1IFUox1hW8OOAo+cojaLnOcXaQcOXmxP8M22BzGG8dYIDeCvGYPug9Qfmctkozv/N04 CXdIEnocf37Y2vI/+Nazw2NNtI8q8ghTxIR2UvN/iw6Dhosk6Aj5wx8ksJFlpB8lvLz4 U+8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y26si5103696edu.176.2019.10.05.09.47.02; Sat, 05 Oct 2019 09:47:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729267AbfJEQqw (ORCPT + 99 others); Sat, 5 Oct 2019 12:46:52 -0400 Received: from smtprelay0230.hostedemail.com ([216.40.44.230]:42293 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725826AbfJEQqw (ORCPT ); Sat, 5 Oct 2019 12:46:52 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 51AC0181D33FB; Sat, 5 Oct 2019 16:46:50 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::::::::::::::::::::::::::::::::,RULES_HIT:41:355:379:541:960:973:982:988:989:1260:1345:1437:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3353:3865:3866:3867:3870:4605:5007:6119:6261:6742:6743:7903:9036:9389:9592:10004:10848:11026:11657:11658:11914:12043:12291:12296:12297:12438:12555:12679:12683:12895:13069:13161:13229:13311:13357:13972:14096:14181:14384:14394:14721:21080:21433:21451:21627:30054,0,RBL:47.151.152.152:@perches.com:.lbl8.mailshell.net-62.14.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: swim99_ee203254c55 X-Filterd-Recvd-Size: 3433 Received: from joe-laptop.perches.com (unknown [47.151.152.152]) (Authenticated sender: joe@perches.com) by omf15.hostedemail.com (Postfix) with ESMTPA; Sat, 5 Oct 2019 16:46:46 +0000 (UTC) From: Joe Perches To: Linus Torvalds , linux-sctp@vger.kernel.org Cc: Miguel Ojeda , Kees Cook , Borislav Petkov , "H . Peter Anvin" , Thomas Gleixner , Pavel Machek , "Gustavo A . R . Silva" , Arnaldo Carvalho de Melo , Kan Liang , Namhyung Kim , Jiri Olsa , Alexander Shishkin , Shawn Landden , x86@kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Andrew Morton , David Miller , clang-built-linux@googlegroups.com, Jonathan Corbet , Vlad Yasevich , Neil Horman , Marcelo Ricardo Leitner , linux-doc@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 0/4] treewide: Add 'fallthrough' pseudo-keyword Date: Sat, 5 Oct 2019 09:46:40 -0700 Message-Id: X-Mailer: git-send-email 2.15.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add 'fallthrough' pseudo-keyword to enable the removal of comments like '/* fallthrough */'. Add a script to convert the fallthrough comments. The script can be run over any single file or treewide. For instance, a treewide conversion can be done using: $ git ls-files -- '*.[ch]' | \ xargs scripts/cvt_style.pl -o --convert=fallthrough This currently produces: $ git diff --shortstat 1839 files changed, 4377 insertions(+), 4698 deletions(-) Example fallthrough conversion produced by the script: $ scripts/cvt_style.pl -o --convert=fallthrough arch/arm/mm/alignment.c a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c @@ -695,8 +695,7 @@ thumb2arm(u16 tinstr) return subset[(L<<1) | ((tinstr & (1<<8)) >> 8)] | (tinstr & 255); /* register_list */ } - /* Else, fall through - for illegal instruction case */ - + fallthrough; /* for illegal instruction case */ default: return BAD_INSTR; } @@ -751,8 +750,7 @@ do_alignment_t32_to_handler(unsigned long *pinstr, struct pt_regs *regs, case 0xe8e0: case 0xe9e0: poffset->un = (tinst2 & 0xff) << 2; - /* Fall through */ - + fallthrough; case 0xe940: case 0xe9c0: return do_alignment_ldrdstrd; Joe Perches (4): net: sctp: Rename fallthrough label to unhandled compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use Documentation/process: Add fallthrough pseudo-keyword scripts/cvt_style.pl: Tool to reformat sources in various ways Documentation/process/coding-style.rst | 2 +- Documentation/process/deprecated.rst | 33 +- include/linux/compiler_attributes.h | 17 + net/sctp/sm_make_chunk.c | 12 +- scripts/cvt_style.pl | 808 +++++++++++++++++++++++++++++++++ 5 files changed, 855 insertions(+), 17 deletions(-) create mode 100755 scripts/cvt_style.pl -- 2.15.0