summaryrefslogtreecommitdiff
path: root/scripts/checkincludes.pl
diff options
context:
space:
mode:
authorCheah Kok Cheong <thrust73@gmail.com>2017-02-22 15:40:26 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-22 16:41:26 -0800
commit8087a5609dbf73553a226f1ce0b3a14954adab34 (patch)
tree7a4f87279f8c77e2fb76fe4cbbd4041b0da6785d /scripts/checkincludes.pl
parent0e5a47a8d346c798bbb1801c7c5852b652155b72 (diff)
scripts/checkincludes.pl: add exit message for no duplicates found
If no duplicates found, inform user. Link: http://lkml.kernel.org/r/1486391275-2843-1-git-send-email-thrust73@gmail.com Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkincludes.pl')
-rwxr-xr-xscripts/checkincludes.pl8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/checkincludes.pl b/scripts/checkincludes.pl
index 97b2c6143fe4..381c018a4612 100755
--- a/scripts/checkincludes.pl
+++ b/scripts/checkincludes.pl
@@ -37,6 +37,8 @@ if ($#ARGV >= 1) {
}
}
+my $dup_counter = 0;
+
foreach my $file (@ARGV) {
open(my $f, '<', $file)
or die "Cannot open $file: $!.\n";
@@ -57,6 +59,7 @@ foreach my $file (@ARGV) {
foreach my $filename (keys %includedfiles) {
if ($includedfiles{$filename} > 1) {
print "$file: $filename is included more than once.\n";
+ ++$dup_counter;
}
}
next;
@@ -73,6 +76,7 @@ foreach my $file (@ARGV) {
if ($includedfiles{$filename} > 1) {
$includedfiles{$filename}--;
$dups++;
+ ++$dup_counter;
} else {
print {$f} $_;
}
@@ -87,3 +91,7 @@ foreach my $file (@ARGV) {
}
close($f);
}
+
+if ($dup_counter == 0) {
+ print "No duplicate includes found.\n";
+}