]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
checkpatch: Complain about executable files
authorJoe Perches <joe@perches.com>
Tue, 26 Mar 2013 23:25:06 +0000 (10:25 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 4 Apr 2013 06:12:29 +0000 (17:12 +1100)
Complain about files with an executable bit set that are not in a scripts/
directory and are not type .pl, .py, .awk, or .sh

Based on an initial patch from Stephen.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
scripts/checkpatch.pl

index 3540bcf1cd22b3692c3f0b567da32b7f230702c7..3fb6d8674b2a744617f3bea3655bbe05c9d9db13 100755 (executable)
@@ -1583,7 +1583,8 @@ sub process {
 # Check for incorrect file permissions
                if ($line =~ /^new (file )?mode.*[7531]\d{0,2}$/) {
                        my $permhere = $here . "FILE: $realfile\n";
-                       if ($realfile =~ /(Makefile|Kconfig|\.c|\.h|\.S|\.tmpl)$/) {
+                       if ($realfile !~ m@scripts/@ &&
+                           $realfile !~ /\.(py|pl|awk|sh)$/) {
                                ERROR("EXECUTE_PERMISSIONS",
                                      "do not set execute permissions for source files\n" . $permhere);
                        }