Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1483514

[PATCH] checkpatch: Minimize checkpatch induced patches...

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject [PATCH] checkpatch: Minimize checkpatch induced patches...
Date 2016-09-14 20:00 +0200
Message-ID <shmDw-3Sa-13@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


checkpatch can be a useful tool for patches.

It can be a much more controversial tool when used on files with the
-f option for style and whitespace changes for code that is relatively
stable, obsolete, or for maintained by specific individuals.

o By default, allow checkpatch to be used with the -f|--file option
  for files in drivers/staging/
o Add an undocumented --force command line option to be used together
  with the -f|--file option to scan any file

Signed-off-by: Joe Perches <joe@perches.com>
cc: Greg KH <greg@kroah.com>
cc: Jonathan Corbet <corbet@lwn.net>
cc: Josh Triplett <josh@joshtriplett.org>
cc: Christian Borntraeger <borntraeger@de.ibm.com>
cc: Theodore Ts'o <tytso@mit.edu>
---
 scripts/checkpatch.pl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 0ef3d83..d998a61 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -27,6 +27,7 @@ my $emacs = 0;
 my $terse = 0;
 my $showfile = 0;
 my $file = 0;
+my $force = 0;
 my $git = 0;
 my %git_commits = ();
 my $check = 0;
@@ -188,6 +189,7 @@ GetOptions(
 	'terse!'	=> \$terse,
 	'showfile!'	=> \$showfile,
 	'f|file!'	=> \$file,
+	'force!'	=> \$force,
 	'g|git!'	=> \$git,
 	'subjective!'	=> \$check,
 	'strict!'	=> \$check,
@@ -893,6 +895,10 @@ if ($git) {
 my $vname;
 for my $filename (@ARGV) {
 	my $FILE;
+	if (!$force && $file && $filename !~ m@^drivers/staging/@) {
+		warn "$P: checking '$filename' is not supported\n";
+		next;
+	}
 	if ($git) {
 		open($FILE, '-|', "git format-patch -M --stdout -1 $filename") ||
 			die "$P: $filename: git format-patch failed - $!\n";
-- 
2.10.0.rc2.1.g053435c

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] checkpatch: Minimize checkpatch induced patches... Joe Perches <joe@perches.com> - 2016-09-14 20:00 +0200

csiph-web