aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl31
-rwxr-xr-xscripts/get_maintainer.pl66
-rw-r--r--scripts/mod/file2alias.c17
3 files changed, 104 insertions, 10 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a4d74344d805..bd88f11b0953 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1382,6 +1382,21 @@ sub process {
1382 ERROR("trailing whitespace\n" . $herevet); 1382 ERROR("trailing whitespace\n" . $herevet);
1383 } 1383 }
1384 1384
1385# check for Kconfig help text having a real description
1386 if ($realfile =~ /Kconfig/ &&
1387 $line =~ /\+?\s*(---)?help(---)?$/) {
1388 my $length = 0;
1389 for (my $l = $linenr; defined($lines[$l]); $l++) {
1390 my $f = $lines[$l];
1391 $f =~ s/#.*//;
1392 $f =~ s/^\s+//;
1393 next if ($f =~ /^$/);
1394 last if ($f =~ /^\s*config\s/);
1395 $length++;
1396 }
1397 WARN("please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($length < 4);
1398 }
1399
1385# check we are in a valid source file if not then ignore this hunk 1400# check we are in a valid source file if not then ignore this hunk
1386 next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/); 1401 next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
1387 1402
@@ -2586,6 +2601,11 @@ sub process {
2586 CHK("architecture specific defines should be avoided\n" . $herecurr); 2601 CHK("architecture specific defines should be avoided\n" . $herecurr);
2587 } 2602 }
2588 2603
2604# Check that the storage class is at the beginning of a declaration
2605 if ($line =~ /\b$Storage\b/ && $line !~ /^.\s*$Storage\b/) {
2606 WARN("storage class should be at the beginning of the declaration\n" . $herecurr)
2607 }
2608
2589# check the location of the inline attribute, that it is between 2609# check the location of the inline attribute, that it is between
2590# storage class and type. 2610# storage class and type.
2591 if ($line =~ /\b$Type\s+$Inline\b/ || 2611 if ($line =~ /\b$Type\s+$Inline\b/ ||
@@ -2656,6 +2676,7 @@ sub process {
2656# check for semaphores used as mutexes 2676# check for semaphores used as mutexes
2657 if ($line =~ /^.\s*init_MUTEX_LOCKED\s*\(/) { 2677 if ($line =~ /^.\s*init_MUTEX_LOCKED\s*\(/) {
2658 WARN("consider using a completion\n" . $herecurr); 2678 WARN("consider using a completion\n" . $herecurr);
2679
2659 } 2680 }
2660# recommend strict_strto* over simple_strto* 2681# recommend strict_strto* over simple_strto*
2661 if ($line =~ /\bsimple_(strto.*?)\s*\(/) { 2682 if ($line =~ /\bsimple_(strto.*?)\s*\(/) {
@@ -2740,6 +2761,16 @@ sub process {
2740 WARN("use of in_atomic() is incorrect outside core kernel code\n" . $herecurr); 2761 WARN("use of in_atomic() is incorrect outside core kernel code\n" . $herecurr);
2741 } 2762 }
2742 } 2763 }
2764
2765# check for lockdep_set_novalidate_class
2766 if ($line =~ /^.\s*lockdep_set_novalidate_class\s*\(/ ||
2767 $line =~ /__lockdep_no_validate__\s*\)/ ) {
2768 if ($realfile !~ m@^kernel/lockdep@ &&
2769 $realfile !~ m@^include/linux/lockdep@ &&
2770 $realfile !~ m@^drivers/base/core@) {
2771 ERROR("lockdep_no_validate class is reserved for device->mutex.\n" . $herecurr);
2772 }
2773 }
2743 } 2774 }
2744 2775
2745 # If we have no input at all, then there is nothing to report on 2776 # If we have no input at all, then there is nothing to report on
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 6f97a13bcee4..b2281982f52f 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -13,7 +13,7 @@
13use strict; 13use strict;
14 14
15my $P = $0; 15my $P = $0;
16my $V = '0.23'; 16my $V = '0.24';
17 17
18use Getopt::Long qw(:config no_auto_abbrev); 18use Getopt::Long qw(:config no_auto_abbrev);
19 19
@@ -25,6 +25,7 @@ my $email_list = 1;
25my $email_subscriber_list = 0; 25my $email_subscriber_list = 0;
26my $email_git_penguin_chiefs = 0; 26my $email_git_penguin_chiefs = 0;
27my $email_git = 1; 27my $email_git = 1;
28my $email_git_all_signature_types = 0;
28my $email_git_blame = 0; 29my $email_git_blame = 0;
29my $email_git_min_signatures = 1; 30my $email_git_min_signatures = 1;
30my $email_git_max_maintainers = 5; 31my $email_git_max_maintainers = 5;
@@ -51,9 +52,9 @@ my $help = 0;
51my $exit = 0; 52my $exit = 0;
52 53
53my @penguin_chief = (); 54my @penguin_chief = ();
54push(@penguin_chief,"Linus Torvalds:torvalds\@linux-foundation.org"); 55push(@penguin_chief, "Linus Torvalds:torvalds\@linux-foundation.org");
55#Andrew wants in on most everything - 2009/01/14 56#Andrew wants in on most everything - 2009/01/14
56#push(@penguin_chief,"Andrew Morton:akpm\@linux-foundation.org"); 57#push(@penguin_chief, "Andrew Morton:akpm\@linux-foundation.org");
57 58
58my @penguin_chief_names = (); 59my @penguin_chief_names = ();
59foreach my $chief (@penguin_chief) { 60foreach my $chief (@penguin_chief) {
@@ -63,7 +64,16 @@ foreach my $chief (@penguin_chief) {
63 push(@penguin_chief_names, $chief_name); 64 push(@penguin_chief_names, $chief_name);
64 } 65 }
65} 66}
66my $penguin_chiefs = "\(" . join("|",@penguin_chief_names) . "\)"; 67my $penguin_chiefs = "\(" . join("|", @penguin_chief_names) . "\)";
68
69# Signature types of people who are either
70# a) responsible for the code in question, or
71# b) familiar enough with it to give relevant feedback
72my @signature_tags = ();
73push(@signature_tags, "Signed-off-by:");
74push(@signature_tags, "Reviewed-by:");
75push(@signature_tags, "Acked-by:");
76my $signaturePattern = "\(" . join("|", @signature_tags) . "\)";
67 77
68# rfc822 email address - preloaded methods go here. 78# rfc822 email address - preloaded methods go here.
69my $rfc822_lwsp = "(?:(?:\\r\\n)?[ \\t])"; 79my $rfc822_lwsp = "(?:(?:\\r\\n)?[ \\t])";
@@ -97,9 +107,34 @@ my %VCS_cmds_hg = (
97 "blame_commit_pattern" => "^([0-9a-f]+):" 107 "blame_commit_pattern" => "^([0-9a-f]+):"
98); 108);
99 109
110if (-f "${lk_path}.get_maintainer.conf") {
111 my @conf_args;
112 open(my $conffile, '<', "${lk_path}.get_maintainer.conf")
113 or warn "$P: Can't open .get_maintainer.conf: $!\n";
114 while (<$conffile>) {
115 my $line = $_;
116
117 $line =~ s/\s*\n?$//g;
118 $line =~ s/^\s*//g;
119 $line =~ s/\s+/ /g;
120
121 next if ($line =~ m/^\s*#/);
122 next if ($line =~ m/^\s*$/);
123
124 my @words = split(" ", $line);
125 foreach my $word (@words) {
126 last if ($word =~ m/^#/);
127 push (@conf_args, $word);
128 }
129 }
130 close($conffile);
131 unshift(@ARGV, @conf_args) if @conf_args;
132}
133
100if (!GetOptions( 134if (!GetOptions(
101 'email!' => \$email, 135 'email!' => \$email,
102 'git!' => \$email_git, 136 'git!' => \$email_git,
137 'git-all-signature-types!' => \$email_git_all_signature_types,
103 'git-blame!' => \$email_git_blame, 138 'git-blame!' => \$email_git_blame,
104 'git-chief-penguins!' => \$email_git_penguin_chiefs, 139 'git-chief-penguins!' => \$email_git_penguin_chiefs,
105 'git-min-signatures=i' => \$email_git_min_signatures, 140 'git-min-signatures=i' => \$email_git_min_signatures,
@@ -180,6 +215,10 @@ if (!top_of_kernel_tree($lk_path)) {
180 . "a linux kernel source tree.\n"; 215 . "a linux kernel source tree.\n";
181} 216}
182 217
218if ($email_git_all_signature_types) {
219 $signaturePattern = "(.+?)[Bb][Yy]:";
220}
221
183## Read MAINTAINERS for type/value pairs 222## Read MAINTAINERS for type/value pairs
184 223
185my @typevalue = (); 224my @typevalue = ();
@@ -497,13 +536,15 @@ version: $V
497MAINTAINER field selection options: 536MAINTAINER field selection options:
498 --email => print email address(es) if any 537 --email => print email address(es) if any
499 --git => include recent git \*-by: signers 538 --git => include recent git \*-by: signers
539 --git-all-signature-types => include signers regardless of signature type
540 or use only ${signaturePattern} signers (default: $email_git_all_signature_types)
500 --git-chief-penguins => include ${penguin_chiefs} 541 --git-chief-penguins => include ${penguin_chiefs}
501 --git-min-signatures => number of signatures required (default: 1) 542 --git-min-signatures => number of signatures required (default: $email_git_min_signatures)
502 --git-max-maintainers => maximum maintainers to add (default: 5) 543 --git-max-maintainers => maximum maintainers to add (default: $email_git_max_maintainers)
503 --git-min-percent => minimum percentage of commits required (default: 5) 544 --git-min-percent => minimum percentage of commits required (default: $email_git_min_percent)
504 --git-blame => use git blame to find modified commits for patch or file 545 --git-blame => use git blame to find modified commits for patch or file
505 --git-since => git history to use (default: 1-year-ago) 546 --git-since => git history to use (default: $email_git_since)
506 --hg-since => hg history to use (default: -365) 547 --hg-since => hg history to use (default: $email_hg_since)
507 --m => include maintainer(s) if any 548 --m => include maintainer(s) if any
508 --n => include name 'Full Name <addr\@domain.tld>' 549 --n => include name 'Full Name <addr\@domain.tld>'
509 --l => include list(s) if any 550 --l => include list(s) if any
@@ -556,6 +597,11 @@ Notes:
556 --git-min-signatures, --git-max-maintainers, --git-min-percent, and 597 --git-min-signatures, --git-max-maintainers, --git-min-percent, and
557 --git-blame 598 --git-blame
558 Use --hg-since not --git-since to control date selection 599 Use --hg-since not --git-since to control date selection
600 File ".get_maintainer.conf", if it exists in the linux kernel source root
601 directory, can change whatever get_maintainer defaults are desired.
602 Entries in this file can be any command line argument.
603 This file is prepended to any additional command line arguments.
604 Multiple lines and # comments are allowed.
559EOT 605EOT
560} 606}
561 607
@@ -964,7 +1010,7 @@ sub vcs_find_signers {
964 1010
965 $commits = grep(/$pattern/, @lines); # of commits 1011 $commits = grep(/$pattern/, @lines); # of commits
966 1012
967 @lines = grep(/^[-_ a-z]+by:.*\@.*$/i, @lines); 1013 @lines = grep(/^[ \t]*${signaturePattern}.*\@.*$/, @lines);
968 if (!$email_git_penguin_chiefs) { 1014 if (!$email_git_penguin_chiefs) {
969 @lines = grep(!/${penguin_chiefs}/i, @lines); 1015 @lines = grep(!/${penguin_chiefs}/i, @lines);
970 } 1016 }
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 9cf2400580a7..5758aab0d8bb 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -828,6 +828,19 @@ static int do_zorro_entry(const char *filename, struct zorro_device_id *id,
828 return 1; 828 return 1;
829} 829}
830 830
831/* looks like: "pnp:dD" */
832static int do_isapnp_entry(const char *filename,
833 struct isapnp_device_id *id, char *alias)
834{
835 sprintf(alias, "pnp:d%c%c%c%x%x%x%x*",
836 'A' + ((id->vendor >> 2) & 0x3f) - 1,
837 'A' + (((id->vendor & 3) << 3) | ((id->vendor >> 13) & 7)) - 1,
838 'A' + ((id->vendor >> 8) & 0x1f) - 1,
839 (id->function >> 4) & 0x0f, id->function & 0x0f,
840 (id->function >> 12) & 0x0f, (id->function >> 8) & 0x0f);
841 return 1;
842}
843
831/* Ignore any prefix, eg. some architectures prepend _ */ 844/* Ignore any prefix, eg. some architectures prepend _ */
832static inline int sym_is(const char *symbol, const char *name) 845static inline int sym_is(const char *symbol, const char *name)
833{ 846{
@@ -983,6 +996,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
983 do_table(symval, sym->st_size, 996 do_table(symval, sym->st_size,
984 sizeof(struct zorro_device_id), "zorro", 997 sizeof(struct zorro_device_id), "zorro",
985 do_zorro_entry, mod); 998 do_zorro_entry, mod);
999 else if (sym_is(symname, "__mod_isapnp_device_table"))
1000 do_table(symval, sym->st_size,
1001 sizeof(struct isapnp_device_id), "isa",
1002 do_isapnp_entry, mod);
986 free(zeros); 1003 free(zeros);
987} 1004}
988 1005