All of lore.kernel.org
 help / color / mirror / Atom feed
* - checkpatch-report-any-absolute-references-to-kernel-source-files.patch removed from -mm tree
@ 2008-10-18 23:13 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2008-10-18 23:13 UTC (permalink / raw)
  To: apw, mm-commits


The patch titled
     checkpatch: report any absolute references to kernel source files
has been removed from the -mm tree.  Its filename was
     checkpatch-report-any-absolute-references-to-kernel-source-files.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: checkpatch: report any absolute references to kernel source files
From: Andy Whitcroft <apw@shadowen.org>

Absolute references to kernel source files are generally only useful
locally to the originator of the patch.  Check for any such references and
report them.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 scripts/checkpatch.pl |   41 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff -puN scripts/checkpatch.pl~checkpatch-report-any-absolute-references-to-kernel-source-files scripts/checkpatch.pl
--- a/scripts/checkpatch.pl~checkpatch-report-any-absolute-references-to-kernel-source-files
+++ a/scripts/checkpatch.pl
@@ -958,6 +958,33 @@ sub CHK {
 	}
 }
 
+sub check_absolute_file {
+	my ($absolute, $herecurr) = @_;
+	my $file = $absolute;
+
+	##print "absolute<$absolute>\n";
+
+	# See if any suffix of this path is a path within the tree.
+	while ($file =~ s@^[^/]*/@@) {
+		if (-f "$root/$file") {
+			##print "file<$file>\n";
+			last;
+		}
+	}
+	if (! -f _)  {
+		return 0;
+	}
+
+	# It is, so see if the prefix is acceptable.
+	my $prefix = $absolute;
+	substr($prefix, -length($file)) = '';
+
+	##print "prefix<$prefix>\n";
+	if ($prefix ne ".../") {
+		WARN("use relative pathname instead of absolute in changelog text\n" . $herecurr);
+	}
+}
+
 sub process {
 	my $filename = shift;
 
@@ -1168,6 +1195,20 @@ sub process {
 				$herecurr) if (!$emitted_corrupt++);
 		}
 
+# Check for absolute kernel paths.
+		if ($tree) {
+			while ($line =~ m{(?:^|\s)(/\S*)}g) {
+				my $file = $1;
+
+				if ($file =~ m{^(.*?)(?::\d+)+:?$} &&
+				    check_absolute_file($1, $herecurr)) {
+					#
+				} else {
+					check_absolute_file($file, $herecurr);
+				}
+			}
+		}
+
 # UTF-8 regex found at http://www.w3.org/International/questions/qa-forms-utf-8.en.php
 		if (($realfile =~ /^$/ || $line =~ /^\+/) &&
 		    $rawline !~ m/^$UTF8*$/) {
_

Patches currently in -mm which might be from apw@shadowen.org are

origin.patch
mm-hugetlbc-make-functions-static-use-null-rather-than-0.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-18 23:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-18 23:13 - checkpatch-report-any-absolute-references-to-kernel-source-files.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.