]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - scripts/checkincludes.pl
clk: ti: mux: convert TI mux clock to use its internal data representation
[karo-tx-linux.git] / scripts / checkincludes.pl
index 97b2c6143fe4f9d61cbc181b316e812e82dc456e..381c018a461297881c4c704c0a71854bb87b65b4 100755 (executable)
@@ -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";
+}