From mboxrd@z Thu Jan 1 00:00:00 1970 From: akpm@linux-foundation.org Subject: - checkpatch-report-any-absolute-references-to-kernel-source-files.patch removed from -mm tree Date: Sat, 18 Oct 2008 16:13:28 -0700 Message-ID: <200810182313.m9INDSpS028197@imap1.linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:46757 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751359AbYJRXNg (ORCPT ); Sat, 18 Oct 2008 19:13:36 -0400 Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: apw@shadowen.org, mm-commits@vger.kernel.org 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 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 Signed-off-by: Andrew Morton --- 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