aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl14
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e44ff91e811d..93fa145671a0 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1315,7 +1315,11 @@ sub process {
1315 $here = "#$realline: " if ($file); 1315 $here = "#$realline: " if ($file);
1316 1316
1317 # extract the filename as it passes 1317 # extract the filename as it passes
1318 if ($line=~/^\+\+\+\s+(\S+)/) { 1318 if ($line =~ /^diff --git.*?(\S+)$/) {
1319 $realfile = $1;
1320 $realfile =~ s@^([^/]*)/@@;
1321
1322 } elsif ($line =~ /^\+\+\+\s+(\S+)/) {
1319 $realfile = $1; 1323 $realfile = $1;
1320 $realfile =~ s@^([^/]*)/@@; 1324 $realfile =~ s@^([^/]*)/@@;
1321 1325
@@ -1339,6 +1343,14 @@ sub process {
1339 1343
1340 $cnt_lines++ if ($realcnt != 0); 1344 $cnt_lines++ if ($realcnt != 0);
1341 1345
1346# Check for incorrect file permissions
1347 if ($line =~ /^new (file )?mode.*[7531]\d{0,2}$/) {
1348 my $permhere = $here . "FILE: $realfile\n";
1349 if ($realfile =~ /(Makefile|Kconfig|\.c|\.h|\.S|\.tmpl)$/) {
1350 ERROR("do not set execute permissions for source files\n" . $permhere);
1351 }
1352 }
1353
1342#check the patch for a signoff: 1354#check the patch for a signoff:
1343 if ($line =~ /^\s*signed-off-by:/i) { 1355 if ($line =~ /^\s*signed-off-by:/i) {
1344 # This is a signoff, if ugly, so do not double report. 1356 # This is a signoff, if ugly, so do not double report.