aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Kbuild.include4
-rw-r--r--scripts/Makefile.lib40
-rw-r--r--scripts/Makefile.modpost2
-rw-r--r--scripts/bootgraph.pl2
-rwxr-xr-xscripts/checkpatch.pl656
-rwxr-xr-xscripts/depmod.sh10
-rw-r--r--scripts/docproc.c17
-rw-r--r--scripts/dtc/Makefile28
-rw-r--r--scripts/dtc/dtc-lexer.lex.c_shipped59
-rw-r--r--scripts/dtc/dtc-parser.tab.c_shipped116
-rw-r--r--scripts/dtc/dtc-parser.tab.h_shipped11
-rw-r--r--scripts/gcc-goto.sh2
-rw-r--r--scripts/genksyms/.gitignore7
-rw-r--r--scripts/genksyms/Makefile48
-rw-r--r--scripts/genksyms/genksyms.c2
-rw-r--r--scripts/genksyms/keywords.gperf3
-rw-r--r--scripts/genksyms/keywords.hash.c_shipped (renamed from scripts/genksyms/keywords.c_shipped)96
-rw-r--r--scripts/genksyms/lex.l4
-rw-r--r--scripts/genksyms/lex.lex.c_shipped (renamed from scripts/genksyms/lex.c_shipped)359
-rw-r--r--scripts/genksyms/parse.tab.c_shipped (renamed from scripts/genksyms/parse.c_shipped)198
-rw-r--r--scripts/genksyms/parse.tab.h_shipped (renamed from scripts/genksyms/parse.h_shipped)7
-rwxr-xr-xscripts/get_maintainer.pl9
-rw-r--r--scripts/headers_install.pl1
-rw-r--r--scripts/kconfig/.gitignore2
-rw-r--r--scripts/kconfig/Makefile34
-rw-r--r--scripts/kconfig/lkc.h2
-rw-r--r--scripts/kconfig/zconf.gperf2
-rw-r--r--scripts/kconfig/zconf.hash.c_shipped273
-rw-r--r--scripts/kconfig/zconf.l8
-rw-r--r--scripts/kconfig/zconf.lex.c_shipped (renamed from scripts/kconfig/lex.zconf.c_shipped)26
-rw-r--r--scripts/kconfig/zconf.tab.c_shipped68
-rw-r--r--scripts/kconfig/zconf.y18
-rw-r--r--scripts/mkmakefile9
-rw-r--r--scripts/mod/modpost.c29
-rw-r--r--scripts/package/Makefile8
35 files changed, 940 insertions, 1220 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index be39cd1c74cf..d897278b1f97 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -21,6 +21,10 @@ depfile = $(subst $(comma),_,$(dot-target).d)
21basetarget = $(basename $(notdir $@)) 21basetarget = $(basename $(notdir $@))
22 22
23### 23###
24# filename of first prerequisite with directory and extension stripped
25baseprereq = $(basename $(notdir $<))
26
27###
24# Escape single quote for use in echo statements 28# Escape single quote for use in echo statements
25escsq = $(subst $(squote),'\$(squote)',$1) 29escsq = $(subst $(squote),'\$(squote)',$1)
26 30
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 93b2b5938a2e..aeea84a24836 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -160,13 +160,51 @@ ld_flags = $(LDFLAGS) $(ldflags-y)
160modname-multi = $(sort $(foreach m,$(multi-used),\ 160modname-multi = $(sort $(foreach m,$(multi-used),\
161 $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=)))) 161 $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=))))
162 162
163ifdef REGENERATE_PARSERS
164
165# GPERF
166# ---------------------------------------------------------------------------
167quiet_cmd_gperf = GPERF $@
168 cmd_gperf = gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<
169
170$(src)/%.hash.c_shipped: $(src)/%.gperf
171 $(call cmd,gperf)
172
173# LEX
174# ---------------------------------------------------------------------------
175LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy)
176
177quiet_cmd_flex = LEX $@
178 cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $<
179
180$(src)/%.lex.c_shipped: $(src)/%.l
181 $(call cmd,flex)
182
183# YACC
184# ---------------------------------------------------------------------------
185YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy)
186
187quiet_cmd_bison = YACC $@
188 cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $<
189
190$(src)/%.tab.c_shipped: $(src)/%.y
191 $(call cmd,bison)
192
193quiet_cmd_bison_h = YACC $@
194 cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $<
195
196$(src)/%.tab.h_shipped: $(src)/%.y
197 $(call cmd,bison_h)
198
199endif
200
163# Shipped files 201# Shipped files
164# =========================================================================== 202# ===========================================================================
165 203
166quiet_cmd_shipped = SHIPPED $@ 204quiet_cmd_shipped = SHIPPED $@
167cmd_shipped = cat $< > $@ 205cmd_shipped = cat $< > $@
168 206
169$(obj)/%:: $(src)/%_shipped 207$(obj)/%: $(src)/%_shipped
170 $(call cmd,shipped) 208 $(call cmd,shipped)
171 209
172# Commands useful for building a boot image 210# Commands useful for building a boot image
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 56dfafc73c1a..08dce14f2dc8 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -18,7 +18,7 @@
18 18
19# Step 3 is used to place certain information in the module's ELF 19# Step 3 is used to place certain information in the module's ELF
20# section, including information such as: 20# section, including information such as:
21# Version magic (see include/vermagic.h for full details) 21# Version magic (see include/linux/vermagic.h for full details)
22# - Kernel release 22# - Kernel release
23# - SMP is CONFIG_SMP 23# - SMP is CONFIG_SMP
24# - PREEMPT is CONFIG_PREEMPT 24# - PREEMPT is CONFIG_PREEMPT
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl
index 12caa822a232..b78fca994a15 100644
--- a/scripts/bootgraph.pl
+++ b/scripts/bootgraph.pl
@@ -44,7 +44,7 @@ my %end;
44my %type; 44my %type;
45my $done = 0; 45my $done = 0;
46my $maxtime = 0; 46my $maxtime = 0;
47my $firsttime = 100; 47my $firsttime = 99999;
48my $count = 0; 48my $count = 0;
49my %pids; 49my %pids;
50my %pidctr; 50my %pidctr;
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b0aa2c680593..9d761c95eca2 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -10,7 +10,7 @@ use strict;
10my $P = $0; 10my $P = $0;
11$P =~ s@.*/@@g; 11$P =~ s@.*/@@g;
12 12
13my $V = '0.31'; 13my $V = '0.32';
14 14
15use Getopt::Long qw(:config no_auto_abbrev); 15use Getopt::Long qw(:config no_auto_abbrev);
16 16
@@ -26,9 +26,13 @@ my $check = 0;
26my $summary = 1; 26my $summary = 1;
27my $mailback = 0; 27my $mailback = 0;
28my $summary_file = 0; 28my $summary_file = 0;
29my $show_types = 0;
29my $root; 30my $root;
30my %debug; 31my %debug;
32my %ignore_type = ();
33my @ignore = ();
31my $help = 0; 34my $help = 0;
35my $configuration_file = ".checkpatch.conf";
32 36
33sub help { 37sub help {
34 my ($exitcode) = @_; 38 my ($exitcode) = @_;
@@ -46,6 +50,8 @@ Options:
46 --terse one line per report 50 --terse one line per report
47 -f, --file treat FILE as regular source file 51 -f, --file treat FILE as regular source file
48 --subjective, --strict enable more subjective tests 52 --subjective, --strict enable more subjective tests
53 --ignore TYPE(,TYPE2...) ignore various comma separated message types
54 --show-types show the message "types" in the output
49 --root=PATH PATH to the kernel tree root 55 --root=PATH PATH to the kernel tree root
50 --no-summary suppress the per-file summary 56 --no-summary suppress the per-file summary
51 --mailback only produce a report in case of warnings/errors 57 --mailback only produce a report in case of warnings/errors
@@ -63,6 +69,32 @@ EOM
63 exit($exitcode); 69 exit($exitcode);
64} 70}
65 71
72my $conf = which_conf($configuration_file);
73if (-f $conf) {
74 my @conf_args;
75 open(my $conffile, '<', "$conf")
76 or warn "$P: Can't find a readable $configuration_file file $!\n";
77
78 while (<$conffile>) {
79 my $line = $_;
80
81 $line =~ s/\s*\n?$//g;
82 $line =~ s/^\s*//g;
83 $line =~ s/\s+/ /g;
84
85 next if ($line =~ m/^\s*#/);
86 next if ($line =~ m/^\s*$/);
87
88 my @words = split(" ", $line);
89 foreach my $word (@words) {
90 last if ($word =~ m/^#/);
91 push (@conf_args, $word);
92 }
93 }
94 close($conffile);
95 unshift(@ARGV, @conf_args) if @conf_args;
96}
97
66GetOptions( 98GetOptions(
67 'q|quiet+' => \$quiet, 99 'q|quiet+' => \$quiet,
68 'tree!' => \$tree, 100 'tree!' => \$tree,
@@ -73,6 +105,8 @@ GetOptions(
73 'f|file!' => \$file, 105 'f|file!' => \$file,
74 'subjective!' => \$check, 106 'subjective!' => \$check,
75 'strict!' => \$check, 107 'strict!' => \$check,
108 'ignore=s' => \@ignore,
109 'show-types!' => \$show_types,
76 'root=s' => \$root, 110 'root=s' => \$root,
77 'summary!' => \$summary, 111 'summary!' => \$summary,
78 'mailback!' => \$mailback, 112 'mailback!' => \$mailback,
@@ -93,6 +127,19 @@ if ($#ARGV < 0) {
93 exit(1); 127 exit(1);
94} 128}
95 129
130@ignore = split(/,/, join(',',@ignore));
131foreach my $word (@ignore) {
132 $word =~ s/\s*\n?$//g;
133 $word =~ s/^\s*//g;
134 $word =~ s/\s+/ /g;
135 $word =~ tr/[a-z]/[A-Z]/;
136
137 next if ($word =~ m/^\s*#/);
138 next if ($word =~ m/^\s*$/);
139
140 $ignore_type{$word}++;
141}
142
96my $dbg_values = 0; 143my $dbg_values = 0;
97my $dbg_possible = 0; 144my $dbg_possible = 0;
98my $dbg_type = 0; 145my $dbg_type = 0;
@@ -145,7 +192,8 @@ our $Sparse = qr{
145 __must_check| 192 __must_check|
146 __init_refok| 193 __init_refok|
147 __kprobes| 194 __kprobes|
148 __ref 195 __ref|
196 __rcu
149 }x; 197 }x;
150 198
151# Notes to $Attribute: 199# Notes to $Attribute:
@@ -209,13 +257,23 @@ our $typeTypedefs = qr{(?x:
209)}; 257)};
210 258
211our $logFunctions = qr{(?x: 259our $logFunctions = qr{(?x:
212 printk| 260 printk(?:_ratelimited|_once|)|
213 [a-z]+_(emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)| 261 [a-z0-9]+_(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)|
214 WARN| 262 WARN(?:_RATELIMIT|_ONCE|)|
215 panic| 263 panic|
216 MODULE_[A-Z_]+ 264 MODULE_[A-Z_]+
217)}; 265)};
218 266
267our $signature_tags = qr{(?xi:
268 Signed-off-by:|
269 Acked-by:|
270 Tested-by:|
271 Reviewed-by:|
272 Reported-by:|
273 To:|
274 Cc:
275)};
276
219our @typeList = ( 277our @typeList = (
220 qr{void}, 278 qr{void},
221 qr{(?:unsigned\s+)?char}, 279 qr{(?:unsigned\s+)?char},
@@ -268,6 +326,20 @@ sub build_types {
268} 326}
269build_types(); 327build_types();
270 328
329our $match_balanced_parentheses = qr/(\((?:[^\(\)]+|(-1))*\))/;
330
331our $Typecast = qr{\s*(\(\s*$NonptrType\s*\)){0,1}\s*};
332our $LvalOrFunc = qr{($Lval)\s*($match_balanced_parentheses{0,1})\s*};
333
334sub deparenthesize {
335 my ($string) = @_;
336 return "" if (!defined($string));
337 $string =~ s@^\s*\(\s*@@g;
338 $string =~ s@\s*\)\s*$@@g;
339 $string =~ s@\s+@ @g;
340 return $string;
341}
342
271$chk_signoff = 0 if ($file); 343$chk_signoff = 0 if ($file);
272 344
273my @dep_includes = (); 345my @dep_includes = ();
@@ -339,6 +411,88 @@ sub top_of_kernel_tree {
339 } 411 }
340 } 412 }
341 return 1; 413 return 1;
414 }
415
416sub parse_email {
417 my ($formatted_email) = @_;
418
419 my $name = "";
420 my $address = "";
421 my $comment = "";
422
423 if ($formatted_email =~ /^(.*)<(\S+\@\S+)>(.*)$/) {
424 $name = $1;
425 $address = $2;
426 $comment = $3 if defined $3;
427 } elsif ($formatted_email =~ /^\s*<(\S+\@\S+)>(.*)$/) {
428 $address = $1;
429 $comment = $2 if defined $2;
430 } elsif ($formatted_email =~ /(\S+\@\S+)(.*)$/) {
431 $address = $1;
432 $comment = $2 if defined $2;
433 $formatted_email =~ s/$address.*$//;
434 $name = $formatted_email;
435 $name =~ s/^\s+|\s+$//g;
436 $name =~ s/^\"|\"$//g;
437 # If there's a name left after stripping spaces and
438 # leading quotes, and the address doesn't have both
439 # leading and trailing angle brackets, the address
440 # is invalid. ie:
441 # "joe smith joe@smith.com" bad
442 # "joe smith <joe@smith.com" bad
443 if ($name ne "" && $address !~ /^<[^>]+>$/) {
444 $name = "";
445 $address = "";
446 $comment = "";
447 }
448 }
449
450 $name =~ s/^\s+|\s+$//g;
451 $name =~ s/^\"|\"$//g;
452 $address =~ s/^\s+|\s+$//g;
453 $address =~ s/^\<|\>$//g;
454
455 if ($name =~ /[^\w \-]/i) { ##has "must quote" chars
456 $name =~ s/(?<!\\)"/\\"/g; ##escape quotes
457 $name = "\"$name\"";
458 }
459
460 return ($name, $address, $comment);
461}
462
463sub format_email {
464 my ($name, $address) = @_;
465
466 my $formatted_email;
467
468 $name =~ s/^\s+|\s+$//g;
469 $name =~ s/^\"|\"$//g;
470 $address =~ s/^\s+|\s+$//g;
471
472 if ($name =~ /[^\w \-]/i) { ##has "must quote" chars
473 $name =~ s/(?<!\\)"/\\"/g; ##escape quotes
474 $name = "\"$name\"";
475 }
476
477 if ("$name" eq "") {
478 $formatted_email = "$address";
479 } else {
480 $formatted_email = "$name <$address>";
481 }
482
483 return $formatted_email;
484}
485
486sub which_conf {
487 my ($conf) = @_;
488
489 foreach my $path (split(/:/, ".:$ENV{HOME}:.scripts")) {
490 if (-e "$path/$conf") {
491 return "$path/$conf";
492 }
493 }
494
495 return "";
342} 496}
343 497
344sub expand_tabs { 498sub expand_tabs {
@@ -1086,12 +1240,21 @@ sub possible {
1086 1240
1087my $prefix = ''; 1241my $prefix = '';
1088 1242
1243sub show_type {
1244 return !defined $ignore_type{$_[0]};
1245}
1246
1089sub report { 1247sub report {
1090 if (defined $tst_only && $_[0] !~ /\Q$tst_only\E/) { 1248 if (!show_type($_[1]) ||
1249 (defined $tst_only && $_[2] !~ /\Q$tst_only\E/)) {
1091 return 0; 1250 return 0;
1092 } 1251 }
1093 my $line = $prefix . $_[0]; 1252 my $line;
1094 1253 if ($show_types) {
1254 $line = "$prefix$_[0]:$_[1]: $_[2]\n";
1255 } else {
1256 $line = "$prefix$_[0]: $_[2]\n";
1257 }
1095 $line = (split('\n', $line))[0] . "\n" if ($terse); 1258 $line = (split('\n', $line))[0] . "\n" if ($terse);
1096 1259
1097 push(our @report, $line); 1260 push(our @report, $line);
@@ -1101,20 +1264,21 @@ sub report {
1101sub report_dump { 1264sub report_dump {
1102 our @report; 1265 our @report;
1103} 1266}
1267
1104sub ERROR { 1268sub ERROR {
1105 if (report("ERROR: $_[0]\n")) { 1269 if (report("ERROR", $_[0], $_[1])) {
1106 our $clean = 0; 1270 our $clean = 0;
1107 our $cnt_error++; 1271 our $cnt_error++;
1108 } 1272 }
1109} 1273}
1110sub WARN { 1274sub WARN {
1111 if (report("WARNING: $_[0]\n")) { 1275 if (report("WARNING", $_[0], $_[1])) {
1112 our $clean = 0; 1276 our $clean = 0;
1113 our $cnt_warn++; 1277 our $cnt_warn++;
1114 } 1278 }
1115} 1279}
1116sub CHK { 1280sub CHK {
1117 if ($check && report("CHECK: $_[0]\n")) { 1281 if ($check && report("CHECK", $_[0], $_[1])) {
1118 our $clean = 0; 1282 our $clean = 0;
1119 our $cnt_chk++; 1283 our $cnt_chk++;
1120 } 1284 }
@@ -1143,7 +1307,8 @@ sub check_absolute_file {
1143 1307
1144 ##print "prefix<$prefix>\n"; 1308 ##print "prefix<$prefix>\n";
1145 if ($prefix ne ".../") { 1309 if ($prefix ne ".../") {
1146 WARN("use relative pathname instead of absolute in changelog text\n" . $herecurr); 1310 WARN("USE_RELATIVE_PATH",
1311 "use relative pathname instead of absolute in changelog text\n" . $herecurr);
1147 } 1312 }
1148} 1313}
1149 1314
@@ -1340,11 +1505,13 @@ sub process {
1340 $p1_prefix = $1; 1505 $p1_prefix = $1;
1341 if (!$file && $tree && $p1_prefix ne '' && 1506 if (!$file && $tree && $p1_prefix ne '' &&
1342 -e "$root/$p1_prefix") { 1507 -e "$root/$p1_prefix") {
1343 WARN("patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n"); 1508 WARN("PATCH_PREFIX",
1509 "patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n");
1344 } 1510 }
1345 1511
1346 if ($realfile =~ m@^include/asm/@) { 1512 if ($realfile =~ m@^include/asm/@) {
1347 ERROR("do not modify files in include/asm, change architecture specific files in include/asm-<architecture>\n" . "$here$rawline\n"); 1513 ERROR("MODIFIED_INCLUDE_ASM",
1514 "do not modify files in include/asm, change architecture specific files in include/asm-<architecture>\n" . "$here$rawline\n");
1348 } 1515 }
1349 next; 1516 next;
1350 } 1517 }
@@ -1361,27 +1528,61 @@ sub process {
1361 if ($line =~ /^new (file )?mode.*[7531]\d{0,2}$/) { 1528 if ($line =~ /^new (file )?mode.*[7531]\d{0,2}$/) {
1362 my $permhere = $here . "FILE: $realfile\n"; 1529 my $permhere = $here . "FILE: $realfile\n";
1363 if ($realfile =~ /(Makefile|Kconfig|\.c|\.h|\.S|\.tmpl)$/) { 1530 if ($realfile =~ /(Makefile|Kconfig|\.c|\.h|\.S|\.tmpl)$/) {
1364 ERROR("do not set execute permissions for source files\n" . $permhere); 1531 ERROR("EXECUTE_PERMISSIONS",
1532 "do not set execute permissions for source files\n" . $permhere);
1365 } 1533 }
1366 } 1534 }
1367 1535
1368#check the patch for a signoff: 1536# Check the patch for a signoff:
1369 if ($line =~ /^\s*signed-off-by:/i) { 1537 if ($line =~ /^\s*signed-off-by:/i) {
1370 # This is a signoff, if ugly, so do not double report.
1371 $signoff++; 1538 $signoff++;
1372 if (!($line =~ /^\s*Signed-off-by:/)) { 1539 }
1373 WARN("Signed-off-by: is the preferred form\n" . 1540
1374 $herecurr); 1541# Check signature styles
1542 if ($line =~ /^(\s*)($signature_tags)(\s*)(.*)/) {
1543 my $space_before = $1;
1544 my $sign_off = $2;
1545 my $space_after = $3;
1546 my $email = $4;
1547 my $ucfirst_sign_off = ucfirst(lc($sign_off));
1548
1549 if (defined $space_before && $space_before ne "") {
1550 WARN("BAD_SIGN_OFF",
1551 "Do not use whitespace before $ucfirst_sign_off\n" . $herecurr);
1375 } 1552 }
1376 if ($line =~ /^\s*signed-off-by:\S/i) { 1553 if ($sign_off =~ /-by:$/i && $sign_off ne $ucfirst_sign_off) {
1377 WARN("space required after Signed-off-by:\n" . 1554 WARN("BAD_SIGN_OFF",
1378 $herecurr); 1555 "'$ucfirst_sign_off' is the preferred signature form\n" . $herecurr);
1556 }
1557 if (!defined $space_after || $space_after ne " ") {
1558 WARN("BAD_SIGN_OFF",
1559 "Use a single space after $ucfirst_sign_off\n" . $herecurr);
1560 }
1561
1562 my ($email_name, $email_address, $comment) = parse_email($email);
1563 my $suggested_email = format_email(($email_name, $email_address));
1564 if ($suggested_email eq "") {
1565 ERROR("BAD_SIGN_OFF",
1566 "Unrecognized email address: '$email'\n" . $herecurr);
1567 } else {
1568 my $dequoted = $suggested_email;
1569 $dequoted =~ s/^"//;
1570 $dequoted =~ s/" </ </;
1571 # Don't force email to have quotes
1572 # Allow just an angle bracketed address
1573 if ("$dequoted$comment" ne $email &&
1574 "<$email_address>$comment" ne $email &&
1575 "$suggested_email$comment" ne $email) {
1576 WARN("BAD_SIGN_OFF",
1577 "email address '$email' might be better as '$suggested_email$comment'\n" . $herecurr);
1578 }
1379 } 1579 }
1380 } 1580 }
1381 1581
1382# Check for wrappage within a valid hunk of the file 1582# Check for wrappage within a valid hunk of the file
1383 if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) { 1583 if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) {
1384 ERROR("patch seems to be corrupt (line wrapped?)\n" . 1584 ERROR("CORRUPTED_PATCH",
1585 "patch seems to be corrupt (line wrapped?)\n" .
1385 $herecurr) if (!$emitted_corrupt++); 1586 $herecurr) if (!$emitted_corrupt++);
1386 } 1587 }
1387 1588
@@ -1408,7 +1609,8 @@ sub process {
1408 my $ptr = substr($blank, 0, length($utf8_prefix)) . "^"; 1609 my $ptr = substr($blank, 0, length($utf8_prefix)) . "^";
1409 my $hereptr = "$hereline$ptr\n"; 1610 my $hereptr = "$hereline$ptr\n";
1410 1611
1411 ERROR("Invalid UTF-8, patch and commit message should be encoded in UTF-8\n" . $hereptr); 1612 CHK("INVALID_UTF8",
1613 "Invalid UTF-8, patch and commit message should be encoded in UTF-8\n" . $hereptr);
1412 } 1614 }
1413 1615
1414# ignore non-hunk lines and lines being removed 1616# ignore non-hunk lines and lines being removed
@@ -1417,11 +1619,13 @@ sub process {
1417#trailing whitespace 1619#trailing whitespace
1418 if ($line =~ /^\+.*\015/) { 1620 if ($line =~ /^\+.*\015/) {
1419 my $herevet = "$here\n" . cat_vet($rawline) . "\n"; 1621 my $herevet = "$here\n" . cat_vet($rawline) . "\n";
1420 ERROR("DOS line endings\n" . $herevet); 1622 ERROR("DOS_LINE_ENDINGS",
1623 "DOS line endings\n" . $herevet);
1421 1624
1422 } elsif ($rawline =~ /^\+.*\S\s+$/ || $rawline =~ /^\+\s+$/) { 1625 } elsif ($rawline =~ /^\+.*\S\s+$/ || $rawline =~ /^\+\s+$/) {
1423 my $herevet = "$here\n" . cat_vet($rawline) . "\n"; 1626 my $herevet = "$here\n" . cat_vet($rawline) . "\n";
1424 ERROR("trailing whitespace\n" . $herevet); 1627 ERROR("TRAILING_WHITESPACE",
1628 "trailing whitespace\n" . $herevet);
1425 $rpt_cleaners = 1; 1629 $rpt_cleaners = 1;
1426 } 1630 }
1427 1631
@@ -1452,7 +1656,8 @@ sub process {
1452 } 1656 }
1453 $length++; 1657 $length++;
1454 } 1658 }
1455 WARN("please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($is_end && $length < 4); 1659 WARN("CONFIG_DESCRIPTION",
1660 "please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($is_end && $length < 4);
1456 #print "is_end<$is_end> length<$length>\n"; 1661 #print "is_end<$is_end> length<$length>\n";
1457 } 1662 }
1458 1663
@@ -1466,28 +1671,33 @@ sub process {
1466 $line =~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) && 1671 $line =~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) &&
1467 $length > 80) 1672 $length > 80)
1468 { 1673 {
1469 WARN("line over 80 characters\n" . $herecurr); 1674 WARN("LONG_LINE",
1675 "line over 80 characters\n" . $herecurr);
1470 } 1676 }
1471 1677
1472# check for spaces before a quoted newline 1678# check for spaces before a quoted newline
1473 if ($rawline =~ /^.*\".*\s\\n/) { 1679 if ($rawline =~ /^.*\".*\s\\n/) {
1474 WARN("unnecessary whitespace before a quoted newline\n" . $herecurr); 1680 WARN("QUOTED_WHITESPACE_BEFORE_NEWLINE",
1681 "unnecessary whitespace before a quoted newline\n" . $herecurr);
1475 } 1682 }
1476 1683
1477# check for adding lines without a newline. 1684# check for adding lines without a newline.
1478 if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) { 1685 if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
1479 WARN("adding a line without newline at end of file\n" . $herecurr); 1686 WARN("MISSING_EOF_NEWLINE",
1687 "adding a line without newline at end of file\n" . $herecurr);
1480 } 1688 }
1481 1689
1482# Blackfin: use hi/lo macros 1690# Blackfin: use hi/lo macros
1483 if ($realfile =~ m@arch/blackfin/.*\.S$@) { 1691 if ($realfile =~ m@arch/blackfin/.*\.S$@) {
1484 if ($line =~ /\.[lL][[:space:]]*=.*&[[:space:]]*0x[fF][fF][fF][fF]/) { 1692 if ($line =~ /\.[lL][[:space:]]*=.*&[[:space:]]*0x[fF][fF][fF][fF]/) {
1485 my $herevet = "$here\n" . cat_vet($line) . "\n"; 1693 my $herevet = "$here\n" . cat_vet($line) . "\n";
1486 ERROR("use the LO() macro, not (... & 0xFFFF)\n" . $herevet); 1694 ERROR("LO_MACRO",
1695 "use the LO() macro, not (... & 0xFFFF)\n" . $herevet);
1487 } 1696 }
1488 if ($line =~ /\.[hH][[:space:]]*=.*>>[[:space:]]*16/) { 1697 if ($line =~ /\.[hH][[:space:]]*=.*>>[[:space:]]*16/) {
1489 my $herevet = "$here\n" . cat_vet($line) . "\n"; 1698 my $herevet = "$here\n" . cat_vet($line) . "\n";
1490 ERROR("use the HI() macro, not (... >> 16)\n" . $herevet); 1699 ERROR("HI_MACRO",
1700 "use the HI() macro, not (... >> 16)\n" . $herevet);
1491 } 1701 }
1492 } 1702 }
1493 1703
@@ -1499,14 +1709,16 @@ sub process {
1499 if ($rawline =~ /^\+\s* \t\s*\S/ || 1709 if ($rawline =~ /^\+\s* \t\s*\S/ ||
1500 $rawline =~ /^\+\s* \s*/) { 1710 $rawline =~ /^\+\s* \s*/) {
1501 my $herevet = "$here\n" . cat_vet($rawline) . "\n"; 1711 my $herevet = "$here\n" . cat_vet($rawline) . "\n";
1502 ERROR("code indent should use tabs where possible\n" . $herevet); 1712 ERROR("CODE_INDENT",
1713 "code indent should use tabs where possible\n" . $herevet);
1503 $rpt_cleaners = 1; 1714 $rpt_cleaners = 1;
1504 } 1715 }
1505 1716
1506# check for space before tabs. 1717# check for space before tabs.
1507 if ($rawline =~ /^\+/ && $rawline =~ / \t/) { 1718 if ($rawline =~ /^\+/ && $rawline =~ / \t/) {
1508 my $herevet = "$here\n" . cat_vet($rawline) . "\n"; 1719 my $herevet = "$here\n" . cat_vet($rawline) . "\n";
1509 WARN("please, no space before tabs\n" . $herevet); 1720 WARN("SPACE_BEFORE_TAB",
1721 "please, no space before tabs\n" . $herevet);
1510 } 1722 }
1511 1723
1512# check for spaces at the beginning of a line. 1724# check for spaces at the beginning of a line.
@@ -1516,7 +1728,8 @@ sub process {
1516# 3) hanging labels 1728# 3) hanging labels
1517 if ($rawline =~ /^\+ / && $line !~ /\+ *(?:$;|#|$Ident:)/) { 1729 if ($rawline =~ /^\+ / && $line !~ /\+ *(?:$;|#|$Ident:)/) {
1518 my $herevet = "$here\n" . cat_vet($rawline) . "\n"; 1730 my $herevet = "$here\n" . cat_vet($rawline) . "\n";
1519 WARN("please, no spaces at the start of a line\n" . $herevet); 1731 WARN("LEADING_SPACE",
1732 "please, no spaces at the start of a line\n" . $herevet);
1520 } 1733 }
1521 1734
1522# check we are in a valid C source file if not then ignore this hunk 1735# check we are in a valid C source file if not then ignore this hunk
@@ -1524,17 +1737,20 @@ sub process {
1524 1737
1525# check for RCS/CVS revision markers 1738# check for RCS/CVS revision markers
1526 if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) { 1739 if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) {
1527 WARN("CVS style keyword markers, these will _not_ be updated\n". $herecurr); 1740 WARN("CVS_KEYWORD",
1741 "CVS style keyword markers, these will _not_ be updated\n". $herecurr);
1528 } 1742 }
1529 1743
1530# Blackfin: don't use __builtin_bfin_[cs]sync 1744# Blackfin: don't use __builtin_bfin_[cs]sync
1531 if ($line =~ /__builtin_bfin_csync/) { 1745 if ($line =~ /__builtin_bfin_csync/) {
1532 my $herevet = "$here\n" . cat_vet($line) . "\n"; 1746 my $herevet = "$here\n" . cat_vet($line) . "\n";
1533 ERROR("use the CSYNC() macro in asm/blackfin.h\n" . $herevet); 1747 ERROR("CSYNC",
1748 "use the CSYNC() macro in asm/blackfin.h\n" . $herevet);
1534 } 1749 }
1535 if ($line =~ /__builtin_bfin_ssync/) { 1750 if ($line =~ /__builtin_bfin_ssync/) {
1536 my $herevet = "$here\n" . cat_vet($line) . "\n"; 1751 my $herevet = "$here\n" . cat_vet($line) . "\n";
1537 ERROR("use the SSYNC() macro in asm/blackfin.h\n" . $herevet); 1752 ERROR("SSYNC",
1753 "use the SSYNC() macro in asm/blackfin.h\n" . $herevet);
1538 } 1754 }
1539 1755
1540# Check for potential 'bare' types 1756# Check for potential 'bare' types
@@ -1623,7 +1839,8 @@ sub process {
1623 } 1839 }
1624 } 1840 }
1625 if ($err ne '') { 1841 if ($err ne '') {
1626 ERROR("switch and case should be at the same indent\n$hereline$err"); 1842 ERROR("SWITCH_CASE_INDENT_LEVEL",
1843 "switch and case should be at the same indent\n$hereline$err");
1627 } 1844 }
1628 } 1845 }
1629 1846
@@ -1651,7 +1868,8 @@ sub process {
1651 #print "pre<$pre_ctx>\nline<$line>\nctx<$ctx>\nnext<$lines[$ctx_ln - 1]>\n"; 1868 #print "pre<$pre_ctx>\nline<$line>\nctx<$ctx>\nnext<$lines[$ctx_ln - 1]>\n";
1652 1869
1653 if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln -1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/) { 1870 if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln -1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/) {
1654 ERROR("that open brace { should be on the previous line\n" . 1871 ERROR("OPEN_BRACE",
1872 "that open brace { should be on the previous line\n" .
1655 "$here\n$ctx\n$rawlines[$ctx_ln - 1]\n"); 1873 "$here\n$ctx\n$rawlines[$ctx_ln - 1]\n");
1656 } 1874 }
1657 if ($level == 0 && $pre_ctx !~ /}\s*while\s*\($/ && 1875 if ($level == 0 && $pre_ctx !~ /}\s*while\s*\($/ &&
@@ -1660,7 +1878,8 @@ sub process {
1660 { 1878 {
1661 my ($nlength, $nindent) = line_stats($lines[$ctx_ln - 1]); 1879 my ($nlength, $nindent) = line_stats($lines[$ctx_ln - 1]);
1662 if ($nindent > $indent) { 1880 if ($nindent > $indent) {
1663 WARN("trailing semicolon indicates no statements, indent implies otherwise\n" . 1881 WARN("TRAILING_SEMICOLON",
1882 "trailing semicolon indicates no statements, indent implies otherwise\n" .
1664 "$here\n$ctx\n$rawlines[$ctx_ln - 1]\n"); 1883 "$here\n$ctx\n$rawlines[$ctx_ln - 1]\n");
1665 } 1884 }
1666 } 1885 }
@@ -1748,7 +1967,8 @@ sub process {
1748 1967
1749 if ($check && (($sindent % 8) != 0 || 1968 if ($check && (($sindent % 8) != 0 ||
1750 ($sindent <= $indent && $s ne ''))) { 1969 ($sindent <= $indent && $s ne ''))) {
1751 WARN("suspect code indent for conditional statements ($indent, $sindent)\n" . $herecurr . "$stat_real\n"); 1970 WARN("SUSPECT_CODE_INDENT",
1971 "suspect code indent for conditional statements ($indent, $sindent)\n" . $herecurr . "$stat_real\n");
1752 } 1972 }
1753 } 1973 }
1754 1974
@@ -1771,18 +1991,22 @@ sub process {
1771# TEST: allow direct testing of the type matcher. 1991# TEST: allow direct testing of the type matcher.
1772 if ($dbg_type) { 1992 if ($dbg_type) {
1773 if ($line =~ /^.\s*$Declare\s*$/) { 1993 if ($line =~ /^.\s*$Declare\s*$/) {
1774 ERROR("TEST: is type\n" . $herecurr); 1994 ERROR("TEST_TYPE",
1995 "TEST: is type\n" . $herecurr);
1775 } elsif ($dbg_type > 1 && $line =~ /^.+($Declare)/) { 1996 } elsif ($dbg_type > 1 && $line =~ /^.+($Declare)/) {
1776 ERROR("TEST: is not type ($1 is)\n". $herecurr); 1997 ERROR("TEST_NOT_TYPE",
1998 "TEST: is not type ($1 is)\n". $herecurr);
1777 } 1999 }
1778 next; 2000 next;
1779 } 2001 }
1780# TEST: allow direct testing of the attribute matcher. 2002# TEST: allow direct testing of the attribute matcher.
1781 if ($dbg_attr) { 2003 if ($dbg_attr) {
1782 if ($line =~ /^.\s*$Modifier\s*$/) { 2004 if ($line =~ /^.\s*$Modifier\s*$/) {
1783 ERROR("TEST: is attr\n" . $herecurr); 2005 ERROR("TEST_ATTR",
2006 "TEST: is attr\n" . $herecurr);
1784 } elsif ($dbg_attr > 1 && $line =~ /^.+($Modifier)/) { 2007 } elsif ($dbg_attr > 1 && $line =~ /^.+($Modifier)/) {
1785 ERROR("TEST: is not attr ($1 is)\n". $herecurr); 2008 ERROR("TEST_NOT_ATTR",
2009 "TEST: is not attr ($1 is)\n". $herecurr);
1786 } 2010 }
1787 next; 2011 next;
1788 } 2012 }
@@ -1790,7 +2014,8 @@ sub process {
1790# check for initialisation to aggregates open brace on the next line 2014# check for initialisation to aggregates open brace on the next line
1791 if ($line =~ /^.\s*{/ && 2015 if ($line =~ /^.\s*{/ &&
1792 $prevline =~ /(?:^|[^=])=\s*$/) { 2016 $prevline =~ /(?:^|[^=])=\s*$/) {
1793 ERROR("that open brace { should be on the previous line\n" . $hereprev); 2017 ERROR("OPEN_BRACE",
2018 "that open brace { should be on the previous line\n" . $hereprev);
1794 } 2019 }
1795 2020
1796# 2021#
@@ -1801,14 +2026,16 @@ sub process {
1801 if ($rawline =~ m{^.\s*\#\s*include\s+[<"](.*)[">]}) { 2026 if ($rawline =~ m{^.\s*\#\s*include\s+[<"](.*)[">]}) {
1802 my $path = $1; 2027 my $path = $1;
1803 if ($path =~ m{//}) { 2028 if ($path =~ m{//}) {
1804 ERROR("malformed #include filename\n" . 2029 ERROR("MALFORMED_INCLUDE",
2030 "malformed #include filename\n" .
1805 $herecurr); 2031 $herecurr);
1806 } 2032 }
1807 } 2033 }
1808 2034
1809# no C99 // comments 2035# no C99 // comments
1810 if ($line =~ m{//}) { 2036 if ($line =~ m{//}) {
1811 ERROR("do not use C99 // comments\n" . $herecurr); 2037 ERROR("C99_COMMENTS",
2038 "do not use C99 // comments\n" . $herecurr);
1812 } 2039 }
1813 # Remove C99 comments. 2040 # Remove C99 comments.
1814 $line =~ s@//.*@@; 2041 $line =~ s@//.*@@;
@@ -1855,35 +2082,41 @@ sub process {
1855 } 2082 }
1856 if (defined $suppress_export{$linenr} && 2083 if (defined $suppress_export{$linenr} &&
1857 $suppress_export{$linenr} == 2) { 2084 $suppress_export{$linenr} == 2) {
1858 WARN("EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" . $herecurr); 2085 WARN("EXPORT_SYMBOL",
2086 "EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" . $herecurr);
1859 } 2087 }
1860 2088
1861# check for global initialisers. 2089# check for global initialisers.
1862 if ($line =~ /^.$Type\s*$Ident\s*(?:\s+$Modifier)*\s*=\s*(0|NULL|false)\s*;/) { 2090 if ($line =~ /^.$Type\s*$Ident\s*(?:\s+$Modifier)*\s*=\s*(0|NULL|false)\s*;/) {
1863 ERROR("do not initialise globals to 0 or NULL\n" . 2091 ERROR("GLOBAL_INITIALISERS",
2092 "do not initialise globals to 0 or NULL\n" .
1864 $herecurr); 2093 $herecurr);
1865 } 2094 }
1866# check for static initialisers. 2095# check for static initialisers.
1867 if ($line =~ /\bstatic\s.*=\s*(0|NULL|false)\s*;/) { 2096 if ($line =~ /\bstatic\s.*=\s*(0|NULL|false)\s*;/) {
1868 ERROR("do not initialise statics to 0 or NULL\n" . 2097 ERROR("INITIALISED_STATIC",
2098 "do not initialise statics to 0 or NULL\n" .
1869 $herecurr); 2099 $herecurr);
1870 } 2100 }
1871 2101
1872# check for static const char * arrays. 2102# check for static const char * arrays.
1873 if ($line =~ /\bstatic\s+const\s+char\s*\*\s*(\w+)\s*\[\s*\]\s*=\s*/) { 2103 if ($line =~ /\bstatic\s+const\s+char\s*\*\s*(\w+)\s*\[\s*\]\s*=\s*/) {
1874 WARN("static const char * array should probably be static const char * const\n" . 2104 WARN("STATIC_CONST_CHAR_ARRAY",
2105 "static const char * array should probably be static const char * const\n" .
1875 $herecurr); 2106 $herecurr);
1876 } 2107 }
1877 2108
1878# check for static char foo[] = "bar" declarations. 2109# check for static char foo[] = "bar" declarations.
1879 if ($line =~ /\bstatic\s+char\s+(\w+)\s*\[\s*\]\s*=\s*"/) { 2110 if ($line =~ /\bstatic\s+char\s+(\w+)\s*\[\s*\]\s*=\s*"/) {
1880 WARN("static char array declaration should probably be static const char\n" . 2111 WARN("STATIC_CONST_CHAR_ARRAY",
2112 "static char array declaration should probably be static const char\n" .
1881 $herecurr); 2113 $herecurr);
1882 } 2114 }
1883 2115
1884# check for declarations of struct pci_device_id 2116# check for declarations of struct pci_device_id
1885 if ($line =~ /\bstruct\s+pci_device_id\s+\w+\s*\[\s*\]\s*\=\s*\{/) { 2117 if ($line =~ /\bstruct\s+pci_device_id\s+\w+\s*\[\s*\]\s*\=\s*\{/) {
1886 WARN("Use DEFINE_PCI_DEVICE_TABLE for struct pci_device_id\n" . $herecurr); 2118 WARN("DEFINE_PCI_DEVICE_TABLE",
2119 "Use DEFINE_PCI_DEVICE_TABLE for struct pci_device_id\n" . $herecurr);
1887 } 2120 }
1888 2121
1889# check for new typedefs, only function parameters and sparse annotations 2122# check for new typedefs, only function parameters and sparse annotations
@@ -1893,7 +2126,8 @@ sub process {
1893 $line !~ /\btypedef\s+$Type\s+$Ident\s*\(/ && 2126 $line !~ /\btypedef\s+$Type\s+$Ident\s*\(/ &&
1894 $line !~ /\b$typeTypedefs\b/ && 2127 $line !~ /\b$typeTypedefs\b/ &&
1895 $line !~ /\b__bitwise(?:__|)\b/) { 2128 $line !~ /\b__bitwise(?:__|)\b/) {
1896 WARN("do not add new typedefs\n" . $herecurr); 2129 WARN("NEW_TYPEDEFS",
2130 "do not add new typedefs\n" . $herecurr);
1897 } 2131 }
1898 2132
1899# * goes on variable not on type 2133# * goes on variable not on type
@@ -1911,7 +2145,8 @@ sub process {
1911 2145
1912 #print "from<$from> to<$to>\n"; 2146 #print "from<$from> to<$to>\n";
1913 if ($from ne $to) { 2147 if ($from ne $to) {
1914 ERROR("\"(foo$from)\" should be \"(foo$to)\"\n" . $herecurr); 2148 ERROR("POINTER_LOCATION",
2149 "\"(foo$from)\" should be \"(foo$to)\"\n" . $herecurr);
1915 } 2150 }
1916 } elsif ($line =~ m{\b$NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)($Ident)}) { 2151 } elsif ($line =~ m{\b$NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)($Ident)}) {
1917 my ($from, $to, $ident) = ($1, $1, $2); 2152 my ($from, $to, $ident) = ($1, $1, $2);
@@ -1928,7 +2163,8 @@ sub process {
1928 2163
1929 #print "from<$from> to<$to> ident<$ident>\n"; 2164 #print "from<$from> to<$to> ident<$ident>\n";
1930 if ($from ne $to && $ident !~ /^$Modifier$/) { 2165 if ($from ne $to && $ident !~ /^$Modifier$/) {
1931 ERROR("\"foo${from}bar\" should be \"foo${to}bar\"\n" . $herecurr); 2166 ERROR("POINTER_LOCATION",
2167 "\"foo${from}bar\" should be \"foo${to}bar\"\n" . $herecurr);
1932 } 2168 }
1933 } 2169 }
1934 2170
@@ -1940,12 +2176,14 @@ sub process {
1940# } 2176# }
1941 2177
1942 if ($line =~ /\bLINUX_VERSION_CODE\b/) { 2178 if ($line =~ /\bLINUX_VERSION_CODE\b/) {
1943 WARN("LINUX_VERSION_CODE should be avoided, code should be for the version to which it is merged\n" . $herecurr); 2179 WARN("LINUX_VERSION_CODE",
2180 "LINUX_VERSION_CODE should be avoided, code should be for the version to which it is merged\n" . $herecurr);
1944 } 2181 }
1945 2182
1946# check for uses of printk_ratelimit 2183# check for uses of printk_ratelimit
1947 if ($line =~ /\bprintk_ratelimit\s*\(/) { 2184 if ($line =~ /\bprintk_ratelimit\s*\(/) {
1948 WARN("Prefer printk_ratelimited or pr_<level>_ratelimited to printk_ratelimit\n" . $herecurr); 2185 WARN("PRINTK_RATELIMITED",
2186"Prefer printk_ratelimited or pr_<level>_ratelimited to printk_ratelimit\n" . $herecurr);
1949 } 2187 }
1950 2188
1951# printk should use KERN_* levels. Note that follow on printk's on the 2189# printk should use KERN_* levels. Note that follow on printk's on the
@@ -1967,7 +2205,8 @@ sub process {
1967 } 2205 }
1968 } 2206 }
1969 if ($ok == 0) { 2207 if ($ok == 0) {
1970 WARN("printk() should include KERN_ facility level\n" . $herecurr); 2208 WARN("PRINTK_WITHOUT_KERN_LEVEL",
2209 "printk() should include KERN_ facility level\n" . $herecurr);
1971 } 2210 }
1972 } 2211 }
1973 2212
@@ -1975,18 +2214,21 @@ sub process {
1975# or if closed on same line 2214# or if closed on same line
1976 if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and 2215 if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and
1977 !($line=~/\#\s*define.*do\s{/) and !($line=~/}/)) { 2216 !($line=~/\#\s*define.*do\s{/) and !($line=~/}/)) {
1978 ERROR("open brace '{' following function declarations go on the next line\n" . $herecurr); 2217 ERROR("OPEN_BRACE",
2218 "open brace '{' following function declarations go on the next line\n" . $herecurr);
1979 } 2219 }
1980 2220
1981# open braces for enum, union and struct go on the same line. 2221# open braces for enum, union and struct go on the same line.
1982 if ($line =~ /^.\s*{/ && 2222 if ($line =~ /^.\s*{/ &&
1983 $prevline =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?\s*$/) { 2223 $prevline =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?\s*$/) {
1984 ERROR("open brace '{' following $1 go on the same line\n" . $hereprev); 2224 ERROR("OPEN_BRACE",
2225 "open brace '{' following $1 go on the same line\n" . $hereprev);
1985 } 2226 }
1986 2227
1987# missing space after union, struct or enum definition 2228# missing space after union, struct or enum definition
1988 if ($line =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?(?:\s+$Ident)?[=\{]/) { 2229 if ($line =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?(?:\s+$Ident)?[=\{]/) {
1989 WARN("missing space after $1 definition\n" . $herecurr); 2230 WARN("SPACING",
2231 "missing space after $1 definition\n" . $herecurr);
1990 } 2232 }
1991 2233
1992# check for spacing round square brackets; allowed: 2234# check for spacing round square brackets; allowed:
@@ -1998,7 +2240,8 @@ sub process {
1998 if ($prefix !~ /$Type\s+$/ && 2240 if ($prefix !~ /$Type\s+$/ &&
1999 ($where != 0 || $prefix !~ /^.\s+$/) && 2241 ($where != 0 || $prefix !~ /^.\s+$/) &&
2000 $prefix !~ /{\s+$/) { 2242 $prefix !~ /{\s+$/) {
2001 ERROR("space prohibited before open square bracket '['\n" . $herecurr); 2243 ERROR("BRACKET_SPACE",
2244 "space prohibited before open square bracket '['\n" . $herecurr);
2002 } 2245 }
2003 } 2246 }
2004 2247
@@ -2029,7 +2272,8 @@ sub process {
2029 } elsif ($ctx =~ /$Type$/) { 2272 } elsif ($ctx =~ /$Type$/) {
2030 2273
2031 } else { 2274 } else {
2032 WARN("space prohibited between function name and open parenthesis '('\n" . $herecurr); 2275 WARN("SPACING",
2276 "space prohibited between function name and open parenthesis '('\n" . $herecurr);
2033 } 2277 }
2034 } 2278 }
2035# Check operator spacing. 2279# Check operator spacing.
@@ -2103,7 +2347,8 @@ sub process {
2103 } elsif ($op eq ';') { 2347 } elsif ($op eq ';') {
2104 if ($ctx !~ /.x[WEBC]/ && 2348 if ($ctx !~ /.x[WEBC]/ &&
2105 $cc !~ /^\\/ && $cc !~ /^;/) { 2349 $cc !~ /^\\/ && $cc !~ /^;/) {
2106 ERROR("space required after that '$op' $at\n" . $hereptr); 2350 ERROR("SPACING",
2351 "space required after that '$op' $at\n" . $hereptr);
2107 } 2352 }
2108 2353
2109 # // is a comment 2354 # // is a comment
@@ -2114,13 +2359,15 @@ sub process {
2114 # : when part of a bitfield 2359 # : when part of a bitfield
2115 } elsif ($op eq '->' || $opv eq ':B') { 2360 } elsif ($op eq '->' || $opv eq ':B') {
2116 if ($ctx =~ /Wx.|.xW/) { 2361 if ($ctx =~ /Wx.|.xW/) {
2117 ERROR("spaces prohibited around that '$op' $at\n" . $hereptr); 2362 ERROR("SPACING",
2363 "spaces prohibited around that '$op' $at\n" . $hereptr);
2118 } 2364 }
2119 2365
2120 # , must have a space on the right. 2366 # , must have a space on the right.
2121 } elsif ($op eq ',') { 2367 } elsif ($op eq ',') {
2122 if ($ctx !~ /.x[WEC]/ && $cc !~ /^}/) { 2368 if ($ctx !~ /.x[WEC]/ && $cc !~ /^}/) {
2123 ERROR("space required after that '$op' $at\n" . $hereptr); 2369 ERROR("SPACING",
2370 "space required after that '$op' $at\n" . $hereptr);
2124 } 2371 }
2125 2372
2126 # '*' as part of a type definition -- reported already. 2373 # '*' as part of a type definition -- reported already.
@@ -2134,26 +2381,31 @@ sub process {
2134 $opv eq '*U' || $opv eq '-U' || 2381 $opv eq '*U' || $opv eq '-U' ||
2135 $opv eq '&U' || $opv eq '&&U') { 2382 $opv eq '&U' || $opv eq '&&U') {
2136 if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) { 2383 if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) {
2137 ERROR("space required before that '$op' $at\n" . $hereptr); 2384 ERROR("SPACING",
2385 "space required before that '$op' $at\n" . $hereptr);
2138 } 2386 }
2139 if ($op eq '*' && $cc =~/\s*$Modifier\b/) { 2387 if ($op eq '*' && $cc =~/\s*$Modifier\b/) {
2140 # A unary '*' may be const 2388 # A unary '*' may be const
2141 2389
2142 } elsif ($ctx =~ /.xW/) { 2390 } elsif ($ctx =~ /.xW/) {
2143 ERROR("space prohibited after that '$op' $at\n" . $hereptr); 2391 ERROR("SPACING",
2392 "space prohibited after that '$op' $at\n" . $hereptr);
2144 } 2393 }
2145 2394
2146 # unary ++ and unary -- are allowed no space on one side. 2395 # unary ++ and unary -- are allowed no space on one side.
2147 } elsif ($op eq '++' or $op eq '--') { 2396 } elsif ($op eq '++' or $op eq '--') {
2148 if ($ctx !~ /[WEOBC]x[^W]/ && $ctx !~ /[^W]x[WOBEC]/) { 2397 if ($ctx !~ /[WEOBC]x[^W]/ && $ctx !~ /[^W]x[WOBEC]/) {
2149 ERROR("space required one side of that '$op' $at\n" . $hereptr); 2398 ERROR("SPACING",
2399 "space required one side of that '$op' $at\n" . $hereptr);
2150 } 2400 }
2151 if ($ctx =~ /Wx[BE]/ || 2401 if ($ctx =~ /Wx[BE]/ ||
2152 ($ctx =~ /Wx./ && $cc =~ /^;/)) { 2402 ($ctx =~ /Wx./ && $cc =~ /^;/)) {
2153 ERROR("space prohibited before that '$op' $at\n" . $hereptr); 2403 ERROR("SPACING",
2404 "space prohibited before that '$op' $at\n" . $hereptr);
2154 } 2405 }
2155 if ($ctx =~ /ExW/) { 2406 if ($ctx =~ /ExW/) {
2156 ERROR("space prohibited after that '$op' $at\n" . $hereptr); 2407 ERROR("SPACING",
2408 "space prohibited after that '$op' $at\n" . $hereptr);
2157 } 2409 }
2158 2410
2159 2411
@@ -2165,7 +2417,8 @@ sub process {
2165 $op eq '%') 2417 $op eq '%')
2166 { 2418 {
2167 if ($ctx =~ /Wx[^WCE]|[^WCE]xW/) { 2419 if ($ctx =~ /Wx[^WCE]|[^WCE]xW/) {
2168 ERROR("need consistent spacing around '$op' $at\n" . 2420 ERROR("SPACING",
2421 "need consistent spacing around '$op' $at\n" .
2169 $hereptr); 2422 $hereptr);
2170 } 2423 }
2171 2424
@@ -2173,7 +2426,8 @@ sub process {
2173 # terminating a case value or a label. 2426 # terminating a case value or a label.
2174 } elsif ($opv eq ':C' || $opv eq ':L') { 2427 } elsif ($opv eq ':C' || $opv eq ':L') {
2175 if ($ctx =~ /Wx./) { 2428 if ($ctx =~ /Wx./) {
2176 ERROR("space prohibited before that '$op' $at\n" . $hereptr); 2429 ERROR("SPACING",
2430 "space prohibited before that '$op' $at\n" . $hereptr);
2177 } 2431 }
2178 2432
2179 # All the others need spaces both sides. 2433 # All the others need spaces both sides.
@@ -2196,7 +2450,8 @@ sub process {
2196 } 2450 }
2197 2451
2198 if ($ok == 0) { 2452 if ($ok == 0) {
2199 ERROR("spaces required around that '$op' $at\n" . $hereptr); 2453 ERROR("SPACING",
2454 "spaces required around that '$op' $at\n" . $hereptr);
2200 } 2455 }
2201 } 2456 }
2202 $off += length($elements[$n + 1]); 2457 $off += length($elements[$n + 1]);
@@ -2205,7 +2460,8 @@ sub process {
2205 2460
2206# check for multiple assignments 2461# check for multiple assignments
2207 if ($line =~ /^.\s*$Lval\s*=\s*$Lval\s*=(?!=)/) { 2462 if ($line =~ /^.\s*$Lval\s*=\s*$Lval\s*=(?!=)/) {
2208 CHK("multiple assignments should be avoided\n" . $herecurr); 2463 CHK("MULTIPLE_ASSIGNMENTS",
2464 "multiple assignments should be avoided\n" . $herecurr);
2209 } 2465 }
2210 2466
2211## # check for multiple declarations, allowing for a function declaration 2467## # check for multiple declarations, allowing for a function declaration
@@ -2219,45 +2475,53 @@ sub process {
2219## while ($ln =~ s/\([^\(\)]*\)//g) { 2475## while ($ln =~ s/\([^\(\)]*\)//g) {
2220## } 2476## }
2221## if ($ln =~ /,/) { 2477## if ($ln =~ /,/) {
2222## WARN("declaring multiple variables together should be avoided\n" . $herecurr); 2478## WARN("MULTIPLE_DECLARATION",
2479## "declaring multiple variables together should be avoided\n" . $herecurr);
2223## } 2480## }
2224## } 2481## }
2225 2482
2226#need space before brace following if, while, etc 2483#need space before brace following if, while, etc
2227 if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) || 2484 if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) ||
2228 $line =~ /do{/) { 2485 $line =~ /do{/) {
2229 ERROR("space required before the open brace '{'\n" . $herecurr); 2486 ERROR("SPACING",
2487 "space required before the open brace '{'\n" . $herecurr);
2230 } 2488 }
2231 2489
2232# closing brace should have a space following it when it has anything 2490# closing brace should have a space following it when it has anything
2233# on the line 2491# on the line
2234 if ($line =~ /}(?!(?:,|;|\)))\S/) { 2492 if ($line =~ /}(?!(?:,|;|\)))\S/) {
2235 ERROR("space required after that close brace '}'\n" . $herecurr); 2493 ERROR("SPACING",
2494 "space required after that close brace '}'\n" . $herecurr);
2236 } 2495 }
2237 2496
2238# check spacing on square brackets 2497# check spacing on square brackets
2239 if ($line =~ /\[\s/ && $line !~ /\[\s*$/) { 2498 if ($line =~ /\[\s/ && $line !~ /\[\s*$/) {
2240 ERROR("space prohibited after that open square bracket '['\n" . $herecurr); 2499 ERROR("SPACING",
2500 "space prohibited after that open square bracket '['\n" . $herecurr);
2241 } 2501 }
2242 if ($line =~ /\s\]/) { 2502 if ($line =~ /\s\]/) {
2243 ERROR("space prohibited before that close square bracket ']'\n" . $herecurr); 2503 ERROR("SPACING",
2504 "space prohibited before that close square bracket ']'\n" . $herecurr);
2244 } 2505 }
2245 2506
2246# check spacing on parentheses 2507# check spacing on parentheses
2247 if ($line =~ /\(\s/ && $line !~ /\(\s*(?:\\)?$/ && 2508 if ($line =~ /\(\s/ && $line !~ /\(\s*(?:\\)?$/ &&
2248 $line !~ /for\s*\(\s+;/) { 2509 $line !~ /for\s*\(\s+;/) {
2249 ERROR("space prohibited after that open parenthesis '('\n" . $herecurr); 2510 ERROR("SPACING",
2511 "space prohibited after that open parenthesis '('\n" . $herecurr);
2250 } 2512 }
2251 if ($line =~ /(\s+)\)/ && $line !~ /^.\s*\)/ && 2513 if ($line =~ /(\s+)\)/ && $line !~ /^.\s*\)/ &&
2252 $line !~ /for\s*\(.*;\s+\)/ && 2514 $line !~ /for\s*\(.*;\s+\)/ &&
2253 $line !~ /:\s+\)/) { 2515 $line !~ /:\s+\)/) {
2254 ERROR("space prohibited before that close parenthesis ')'\n" . $herecurr); 2516 ERROR("SPACING",
2517 "space prohibited before that close parenthesis ')'\n" . $herecurr);
2255 } 2518 }
2256 2519
2257#goto labels aren't indented, allow a single space however 2520#goto labels aren't indented, allow a single space however
2258 if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and 2521 if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and
2259 !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) { 2522 !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) {
2260 WARN("labels should not be indented\n" . $herecurr); 2523 WARN("INDENTED_LABEL",
2524 "labels should not be indented\n" . $herecurr);
2261 } 2525 }
2262 2526
2263# Return is not a function. 2527# Return is not a function.
@@ -2276,23 +2540,47 @@ sub process {
2276 } 2540 }
2277#print "value<$value>\n"; 2541#print "value<$value>\n";
2278 if ($value =~ /^\s*(?:$Ident|-?$Constant)\s*$/) { 2542 if ($value =~ /^\s*(?:$Ident|-?$Constant)\s*$/) {
2279 ERROR("return is not a function, parentheses are not required\n" . $herecurr); 2543 ERROR("RETURN_PARENTHESES",
2544 "return is not a function, parentheses are not required\n" . $herecurr);
2280 2545
2281 } elsif ($spacing !~ /\s+/) { 2546 } elsif ($spacing !~ /\s+/) {
2282 ERROR("space required before the open parenthesis '('\n" . $herecurr); 2547 ERROR("SPACING",
2548 "space required before the open parenthesis '('\n" . $herecurr);
2283 } 2549 }
2284 } 2550 }
2285# Return of what appears to be an errno should normally be -'ve 2551# Return of what appears to be an errno should normally be -'ve
2286 if ($line =~ /^.\s*return\s*(E[A-Z]*)\s*;/) { 2552 if ($line =~ /^.\s*return\s*(E[A-Z]*)\s*;/) {
2287 my $name = $1; 2553 my $name = $1;
2288 if ($name ne 'EOF' && $name ne 'ERROR') { 2554 if ($name ne 'EOF' && $name ne 'ERROR') {
2289 WARN("return of an errno should typically be -ve (return -$1)\n" . $herecurr); 2555 WARN("USE_NEGATIVE_ERRNO",
2556 "return of an errno should typically be -ve (return -$1)\n" . $herecurr);
2557 }
2558 }
2559
2560# typecasts on min/max could be min_t/max_t
2561 if ($line =~ /^\+(?:.*?)\b(min|max)\s*\($Typecast{0,1}($LvalOrFunc)\s*,\s*$Typecast{0,1}($LvalOrFunc)\s*\)/) {
2562 if (defined $2 || defined $8) {
2563 my $call = $1;
2564 my $cast1 = deparenthesize($2);
2565 my $arg1 = $3;
2566 my $cast2 = deparenthesize($8);
2567 my $arg2 = $9;
2568 my $cast;
2569
2570 if ($cast1 ne "" && $cast2 ne "") {
2571 $cast = "$cast1 or $cast2";
2572 } elsif ($cast1 ne "") {
2573 $cast = $cast1;
2574 } else {
2575 $cast = $cast2;
2576 }
2577 WARN("$call() should probably be ${call}_t($cast, $arg1, $arg2)\n" . $herecurr);
2290 } 2578 }
2291 } 2579 }
2292 2580
2293# Need a space before open parenthesis after if, while etc 2581# Need a space before open parenthesis after if, while etc
2294 if ($line=~/\b(if|while|for|switch)\(/) { 2582 if ($line=~/\b(if|while|for|switch)\(/) {
2295 ERROR("space required before the open parenthesis '('\n" . $herecurr); 2583 ERROR("SPACING", "space required before the open parenthesis '('\n" . $herecurr);
2296 } 2584 }
2297 2585
2298# Check for illegal assignment in if conditional -- and check for trailing 2586# Check for illegal assignment in if conditional -- and check for trailing
@@ -2320,7 +2608,8 @@ sub process {
2320 my ($s, $c) = ($stat, $cond); 2608 my ($s, $c) = ($stat, $cond);
2321 2609
2322 if ($c =~ /\bif\s*\(.*[^<>!=]=[^=].*/s) { 2610 if ($c =~ /\bif\s*\(.*[^<>!=]=[^=].*/s) {
2323 ERROR("do not use assignment in if condition\n" . $herecurr); 2611 ERROR("ASSIGN_IN_IF",
2612 "do not use assignment in if condition\n" . $herecurr);
2324 } 2613 }
2325 2614
2326 # Find out what is on the end of the line after the 2615 # Find out what is on the end of the line after the
@@ -2342,7 +2631,8 @@ sub process {
2342 $stat_real = "[...]\n$stat_real"; 2631 $stat_real = "[...]\n$stat_real";
2343 } 2632 }
2344 2633
2345 ERROR("trailing statements should be on next line\n" . $herecurr . $stat_real); 2634 ERROR("TRAILING_STATEMENTS",
2635 "trailing statements should be on next line\n" . $herecurr . $stat_real);
2346 } 2636 }
2347 } 2637 }
2348 2638
@@ -2358,7 +2648,8 @@ sub process {
2358 (?:\&\&|\|\||\)|\]) 2648 (?:\&\&|\|\||\)|\])
2359 )/x) 2649 )/x)
2360 { 2650 {
2361 WARN("boolean test with hexadecimal, perhaps just 1 \& or \|?\n" . $herecurr); 2651 WARN("HEXADECIMAL_BOOLEAN_TEST",
2652 "boolean test with hexadecimal, perhaps just 1 \& or \|?\n" . $herecurr);
2362 } 2653 }
2363 2654
2364# if and else should not have general statements after it 2655# if and else should not have general statements after it
@@ -2366,12 +2657,14 @@ sub process {
2366 my $s = $1; 2657 my $s = $1;
2367 $s =~ s/$;//g; # Remove any comments 2658 $s =~ s/$;//g; # Remove any comments
2368 if ($s !~ /^\s*(?:\sif|(?:{|)\s*\\?\s*$)/) { 2659 if ($s !~ /^\s*(?:\sif|(?:{|)\s*\\?\s*$)/) {
2369 ERROR("trailing statements should be on next line\n" . $herecurr); 2660 ERROR("TRAILING_STATEMENTS",
2661 "trailing statements should be on next line\n" . $herecurr);
2370 } 2662 }
2371 } 2663 }
2372# if should not continue a brace 2664# if should not continue a brace
2373 if ($line =~ /}\s*if\b/) { 2665 if ($line =~ /}\s*if\b/) {
2374 ERROR("trailing statements should be on next line\n" . 2666 ERROR("TRAILING_STATEMENTS",
2667 "trailing statements should be on next line\n" .
2375 $herecurr); 2668 $herecurr);
2376 } 2669 }
2377# case and default should not have general statements after them 2670# case and default should not have general statements after them
@@ -2381,14 +2674,16 @@ sub process {
2381 \s*return\s+ 2674 \s*return\s+
2382 )/xg) 2675 )/xg)
2383 { 2676 {
2384 ERROR("trailing statements should be on next line\n" . $herecurr); 2677 ERROR("TRAILING_STATEMENTS",
2678 "trailing statements should be on next line\n" . $herecurr);
2385 } 2679 }
2386 2680
2387 # Check for }<nl>else {, these must be at the same 2681 # Check for }<nl>else {, these must be at the same
2388 # indent level to be relevant to each other. 2682 # indent level to be relevant to each other.
2389 if ($prevline=~/}\s*$/ and $line=~/^.\s*else\s*/ and 2683 if ($prevline=~/}\s*$/ and $line=~/^.\s*else\s*/ and
2390 $previndent == $indent) { 2684 $previndent == $indent) {
2391 ERROR("else should follow close brace '}'\n" . $hereprev); 2685 ERROR("ELSE_AFTER_BRACE",
2686 "else should follow close brace '}'\n" . $hereprev);
2392 } 2687 }
2393 2688
2394 if ($prevline=~/}\s*$/ and $line=~/^.\s*while\s*/ and 2689 if ($prevline=~/}\s*$/ and $line=~/^.\s*while\s*/ and
@@ -2401,7 +2696,8 @@ sub process {
2401 $s =~ s/\n.*//g; 2696 $s =~ s/\n.*//g;
2402 2697
2403 if ($s =~ /^\s*;/) { 2698 if ($s =~ /^\s*;/) {
2404 ERROR("while should follow close brace '}'\n" . $hereprev); 2699 ERROR("WHILE_AFTER_BRACE",
2700 "while should follow close brace '}'\n" . $hereprev);
2405 } 2701 }
2406 } 2702 }
2407 2703
@@ -2414,7 +2710,8 @@ sub process {
2414 2710
2415#no spaces allowed after \ in define 2711#no spaces allowed after \ in define
2416 if ($line=~/\#\s*define.*\\\s$/) { 2712 if ($line=~/\#\s*define.*\\\s$/) {
2417 WARN("Whitepspace after \\ makes next lines useless\n" . $herecurr); 2713 WARN("WHITESPACE_AFTER_LINE_CONTINUATION",
2714 "Whitepspace after \\ makes next lines useless\n" . $herecurr);
2418 } 2715 }
2419 2716
2420#warn if <asm/foo.h> is #included and <linux/foo.h> is available (uses RAW line) 2717#warn if <asm/foo.h> is #included and <linux/foo.h> is available (uses RAW line)
@@ -2426,9 +2723,11 @@ sub process {
2426 $1 !~ /$allowed_asm_includes/) 2723 $1 !~ /$allowed_asm_includes/)
2427 { 2724 {
2428 if ($realfile =~ m{^arch/}) { 2725 if ($realfile =~ m{^arch/}) {
2429 CHK("Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr); 2726 CHK("ARCH_INCLUDE_LINUX",
2727 "Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr);
2430 } else { 2728 } else {
2431 WARN("Use #include <linux/$file> instead of <asm/$file>\n" . $herecurr); 2729 WARN("INCLUDE_LINUX",
2730 "Use #include <linux/$file> instead of <asm/$file>\n" . $herecurr);
2432 } 2731 }
2433 } 2732 }
2434 } 2733 }
@@ -2512,7 +2811,8 @@ sub process {
2512 if ($rest !~ /while\s*\(/ && 2811 if ($rest !~ /while\s*\(/ &&
2513 $dstat !~ /$exceptions/) 2812 $dstat !~ /$exceptions/)
2514 { 2813 {
2515 ERROR("Macros with multiple statements should be enclosed in a do - while loop\n" . "$here\n$ctx\n"); 2814 ERROR("MULTISTATEMENT_MACRO_USE_DO_WHILE",
2815 "Macros with multiple statements should be enclosed in a do - while loop\n" . "$here\n$ctx\n");
2516 } 2816 }
2517 2817
2518 } elsif ($ctx !~ /;/) { 2818 } elsif ($ctx !~ /;/) {
@@ -2522,7 +2822,8 @@ sub process {
2522 $dstat !~ /^\.$Ident\s*=/ && 2822 $dstat !~ /^\.$Ident\s*=/ &&
2523 $dstat =~ /$Operators/) 2823 $dstat =~ /$Operators/)
2524 { 2824 {
2525 ERROR("Macros with complex values should be enclosed in parenthesis\n" . "$here\n$ctx\n"); 2825 ERROR("COMPLEX_MACRO",
2826 "Macros with complex values should be enclosed in parenthesis\n" . "$here\n$ctx\n");
2526 } 2827 }
2527 } 2828 }
2528 } 2829 }
@@ -2533,7 +2834,8 @@ sub process {
2533# ALIGN(...) 2834# ALIGN(...)
2534# VMLINUX_SYMBOL(...) 2835# VMLINUX_SYMBOL(...)
2535 if ($realfile eq 'vmlinux.lds.h' && $line =~ /(?:(?:^|\s)$Ident\s*=|=\s*$Ident(?:\s|$))/) { 2836 if ($realfile eq 'vmlinux.lds.h' && $line =~ /(?:(?:^|\s)$Ident\s*=|=\s*$Ident(?:\s|$))/) {
2536 WARN("vmlinux.lds.h needs VMLINUX_SYMBOL() around C-visible symbols\n" . $herecurr); 2837 WARN("MISSING_VMLINUX_SYMBOL",
2838 "vmlinux.lds.h needs VMLINUX_SYMBOL() around C-visible symbols\n" . $herecurr);
2537 } 2839 }
2538 2840
2539# check for redundant bracing round if etc 2841# check for redundant bracing round if etc
@@ -2581,7 +2883,8 @@ sub process {
2581 } 2883 }
2582 } 2884 }
2583 if ($seen && !$allowed) { 2885 if ($seen && !$allowed) {
2584 WARN("braces {} are not necessary for any arm of this statement\n" . $herectx); 2886 WARN("BRACES",
2887 "braces {} are not necessary for any arm of this statement\n" . $herectx);
2585 } 2888 }
2586 } 2889 }
2587 } 2890 }
@@ -2635,33 +2938,38 @@ sub process {
2635 $herectx .= raw_line($linenr, $n) . "\n";; 2938 $herectx .= raw_line($linenr, $n) . "\n";;
2636 } 2939 }
2637 2940
2638 WARN("braces {} are not necessary for single statement blocks\n" . $herectx); 2941 WARN("BRACES",
2942 "braces {} are not necessary for single statement blocks\n" . $herectx);
2639 } 2943 }
2640 } 2944 }
2641 2945
2642# don't include deprecated include files (uses RAW line) 2946# don't include deprecated include files (uses RAW line)
2643 for my $inc (@dep_includes) { 2947 for my $inc (@dep_includes) {
2644 if ($rawline =~ m@^.\s*\#\s*include\s*\<$inc>@) { 2948 if ($rawline =~ m@^.\s*\#\s*include\s*\<$inc>@) {
2645 ERROR("Don't use <$inc>: see Documentation/feature-removal-schedule.txt\n" . $herecurr); 2949 ERROR("DEPRECATED_INCLUDE",
2950 "Don't use <$inc>: see Documentation/feature-removal-schedule.txt\n" . $herecurr);
2646 } 2951 }
2647 } 2952 }
2648 2953
2649# don't use deprecated functions 2954# don't use deprecated functions
2650 for my $func (@dep_functions) { 2955 for my $func (@dep_functions) {
2651 if ($line =~ /\b$func\b/) { 2956 if ($line =~ /\b$func\b/) {
2652 ERROR("Don't use $func(): see Documentation/feature-removal-schedule.txt\n" . $herecurr); 2957 ERROR("DEPRECATED_FUNCTION",
2958 "Don't use $func(): see Documentation/feature-removal-schedule.txt\n" . $herecurr);
2653 } 2959 }
2654 } 2960 }
2655 2961
2656# no volatiles please 2962# no volatiles please
2657 my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b}; 2963 my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b};
2658 if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) { 2964 if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) {
2659 WARN("Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr); 2965 WARN("VOLATILE",
2966 "Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr);
2660 } 2967 }
2661 2968
2662# warn about #if 0 2969# warn about #if 0
2663 if ($line =~ /^.\s*\#\s*if\s+0\b/) { 2970 if ($line =~ /^.\s*\#\s*if\s+0\b/) {
2664 CHK("if this code is redundant consider removing it\n" . 2971 CHK("REDUNDANT_CODE",
2972 "if this code is redundant consider removing it\n" .
2665 $herecurr); 2973 $herecurr);
2666 } 2974 }
2667 2975
@@ -2669,14 +2977,16 @@ sub process {
2669 if ($prevline =~ /\bif\s*\(([^\)]*)\)/) { 2977 if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
2670 my $expr = $1; 2978 my $expr = $1;
2671 if ($line =~ /\bkfree\(\Q$expr\E\);/) { 2979 if ($line =~ /\bkfree\(\Q$expr\E\);/) {
2672 WARN("kfree(NULL) is safe this check is probably not required\n" . $hereprev); 2980 WARN("NEEDLESS_KFREE",
2981 "kfree(NULL) is safe this check is probably not required\n" . $hereprev);
2673 } 2982 }
2674 } 2983 }
2675# check for needless usb_free_urb() checks 2984# check for needless usb_free_urb() checks
2676 if ($prevline =~ /\bif\s*\(([^\)]*)\)/) { 2985 if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
2677 my $expr = $1; 2986 my $expr = $1;
2678 if ($line =~ /\busb_free_urb\(\Q$expr\E\);/) { 2987 if ($line =~ /\busb_free_urb\(\Q$expr\E\);/) {
2679 WARN("usb_free_urb(NULL) is safe this check is probably not required\n" . $hereprev); 2988 WARN("NEEDLESS_USB_FREE_URB",
2989 "usb_free_urb(NULL) is safe this check is probably not required\n" . $hereprev);
2680 } 2990 }
2681 } 2991 }
2682 2992
@@ -2684,14 +2994,16 @@ sub process {
2684 if ($line =~ /\budelay\s*\(\s*(\w+)\s*\)/) { 2994 if ($line =~ /\budelay\s*\(\s*(\w+)\s*\)/) {
2685 # ignore udelay's < 10, however 2995 # ignore udelay's < 10, however
2686 if (! (($1 =~ /(\d+)/) && ($1 < 10)) ) { 2996 if (! (($1 =~ /(\d+)/) && ($1 < 10)) ) {
2687 CHK("usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt\n" . $line); 2997 CHK("USLEEP_RANGE",
2998 "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt\n" . $line);
2688 } 2999 }
2689 } 3000 }
2690 3001
2691# warn about unexpectedly long msleep's 3002# warn about unexpectedly long msleep's
2692 if ($line =~ /\bmsleep\s*\((\d+)\);/) { 3003 if ($line =~ /\bmsleep\s*\((\d+)\);/) {
2693 if ($1 < 20) { 3004 if ($1 < 20) {
2694 WARN("msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt\n" . $line); 3005 WARN("MSLEEP",
3006 "msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt\n" . $line);
2695 } 3007 }
2696 } 3008 }
2697 3009
@@ -2704,7 +3016,8 @@ sub process {
2704 3016
2705# warn about spacing in #ifdefs 3017# warn about spacing in #ifdefs
2706 if ($line =~ /^.\s*\#\s*(ifdef|ifndef|elif)\s\s+/) { 3018 if ($line =~ /^.\s*\#\s*(ifdef|ifndef|elif)\s\s+/) {
2707 ERROR("exactly one space required after that #$1\n" . $herecurr); 3019 ERROR("SPACING",
3020 "exactly one space required after that #$1\n" . $herecurr);
2708 } 3021 }
2709 3022
2710# check for spinlock_t definitions without a comment. 3023# check for spinlock_t definitions without a comment.
@@ -2712,50 +3025,65 @@ sub process {
2712 $line =~ /^.\s*(DEFINE_MUTEX)\s*\(/) { 3025 $line =~ /^.\s*(DEFINE_MUTEX)\s*\(/) {
2713 my $which = $1; 3026 my $which = $1;
2714 if (!ctx_has_comment($first_line, $linenr)) { 3027 if (!ctx_has_comment($first_line, $linenr)) {
2715 CHK("$1 definition without comment\n" . $herecurr); 3028 CHK("UNCOMMENTED_DEFINITION",
3029 "$1 definition without comment\n" . $herecurr);
2716 } 3030 }
2717 } 3031 }
2718# check for memory barriers without a comment. 3032# check for memory barriers without a comment.
2719 if ($line =~ /\b(mb|rmb|wmb|read_barrier_depends|smp_mb|smp_rmb|smp_wmb|smp_read_barrier_depends)\(/) { 3033 if ($line =~ /\b(mb|rmb|wmb|read_barrier_depends|smp_mb|smp_rmb|smp_wmb|smp_read_barrier_depends)\(/) {
2720 if (!ctx_has_comment($first_line, $linenr)) { 3034 if (!ctx_has_comment($first_line, $linenr)) {
2721 CHK("memory barrier without comment\n" . $herecurr); 3035 CHK("MEMORY_BARRIER",
3036 "memory barrier without comment\n" . $herecurr);
2722 } 3037 }
2723 } 3038 }
2724# check of hardware specific defines 3039# check of hardware specific defines
2725 if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) { 3040 if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) {
2726 CHK("architecture specific defines should be avoided\n" . $herecurr); 3041 CHK("ARCH_DEFINES",
3042 "architecture specific defines should be avoided\n" . $herecurr);
2727 } 3043 }
2728 3044
2729# Check that the storage class is at the beginning of a declaration 3045# Check that the storage class is at the beginning of a declaration
2730 if ($line =~ /\b$Storage\b/ && $line !~ /^.\s*$Storage\b/) { 3046 if ($line =~ /\b$Storage\b/ && $line !~ /^.\s*$Storage\b/) {
2731 WARN("storage class should be at the beginning of the declaration\n" . $herecurr) 3047 WARN("STORAGE_CLASS",
3048 "storage class should be at the beginning of the declaration\n" . $herecurr)
2732 } 3049 }
2733 3050
2734# check the location of the inline attribute, that it is between 3051# check the location of the inline attribute, that it is between
2735# storage class and type. 3052# storage class and type.
2736 if ($line =~ /\b$Type\s+$Inline\b/ || 3053 if ($line =~ /\b$Type\s+$Inline\b/ ||
2737 $line =~ /\b$Inline\s+$Storage\b/) { 3054 $line =~ /\b$Inline\s+$Storage\b/) {
2738 ERROR("inline keyword should sit between storage class and type\n" . $herecurr); 3055 ERROR("INLINE_LOCATION",
3056 "inline keyword should sit between storage class and type\n" . $herecurr);
2739 } 3057 }
2740 3058
2741# Check for __inline__ and __inline, prefer inline 3059# Check for __inline__ and __inline, prefer inline
2742 if ($line =~ /\b(__inline__|__inline)\b/) { 3060 if ($line =~ /\b(__inline__|__inline)\b/) {
2743 WARN("plain inline is preferred over $1\n" . $herecurr); 3061 WARN("INLINE",
3062 "plain inline is preferred over $1\n" . $herecurr);
2744 } 3063 }
2745 3064
2746# Check for __attribute__ packed, prefer __packed 3065# Check for __attribute__ packed, prefer __packed
2747 if ($line =~ /\b__attribute__\s*\(\s*\(.*\bpacked\b/) { 3066 if ($line =~ /\b__attribute__\s*\(\s*\(.*\bpacked\b/) {
2748 WARN("__packed is preferred over __attribute__((packed))\n" . $herecurr); 3067 WARN("PREFER_PACKED",
3068 "__packed is preferred over __attribute__((packed))\n" . $herecurr);
3069 }
3070
3071# Check for __attribute__ aligned, prefer __aligned
3072 if ($line =~ /\b__attribute__\s*\(\s*\(.*aligned/) {
3073 WARN("PREFER_ALIGNED",
3074 "__aligned(size) is preferred over __attribute__((aligned(size)))\n" . $herecurr);
2749 } 3075 }
2750 3076
2751# check for sizeof(&) 3077# check for sizeof(&)
2752 if ($line =~ /\bsizeof\s*\(\s*\&/) { 3078 if ($line =~ /\bsizeof\s*\(\s*\&/) {
2753 WARN("sizeof(& should be avoided\n" . $herecurr); 3079 WARN("SIZEOF_ADDRESS",
3080 "sizeof(& should be avoided\n" . $herecurr);
2754 } 3081 }
2755 3082
2756# check for line continuations in quoted strings with odd counts of " 3083# check for line continuations in quoted strings with odd counts of "
2757 if ($rawline =~ /\\$/ && $rawline =~ tr/"/"/ % 2) { 3084 if ($rawline =~ /\\$/ && $rawline =~ tr/"/"/ % 2) {
2758 WARN("Avoid line continuations in quoted strings\n" . $herecurr); 3085 WARN("LINE_CONTINUATIONS",
3086 "Avoid line continuations in quoted strings\n" . $herecurr);
2759 } 3087 }
2760 3088
2761# check for new externs in .c files. 3089# check for new externs in .c files.
@@ -2772,17 +3100,20 @@ sub process {
2772 if ($s =~ /^\s*;/ && 3100 if ($s =~ /^\s*;/ &&
2773 $function_name ne 'uninitialized_var') 3101 $function_name ne 'uninitialized_var')
2774 { 3102 {
2775 WARN("externs should be avoided in .c files\n" . $herecurr); 3103 WARN("AVOID_EXTERNS",
3104 "externs should be avoided in .c files\n" . $herecurr);
2776 } 3105 }
2777 3106
2778 if ($paren_space =~ /\n/) { 3107 if ($paren_space =~ /\n/) {
2779 WARN("arguments for function declarations should follow identifier\n" . $herecurr); 3108 WARN("FUNCTION_ARGUMENTS",
3109 "arguments for function declarations should follow identifier\n" . $herecurr);
2780 } 3110 }
2781 3111
2782 } elsif ($realfile =~ /\.c$/ && defined $stat && 3112 } elsif ($realfile =~ /\.c$/ && defined $stat &&
2783 $stat =~ /^.\s*extern\s+/) 3113 $stat =~ /^.\s*extern\s+/)
2784 { 3114 {
2785 WARN("externs should be avoided in .c files\n" . $herecurr); 3115 WARN("AVOID_EXTERNS",
3116 "externs should be avoided in .c files\n" . $herecurr);
2786 } 3117 }
2787 3118
2788# checks for new __setup's 3119# checks for new __setup's
@@ -2790,37 +3121,44 @@ sub process {
2790 my $name = $1; 3121 my $name = $1;
2791 3122
2792 if (!grep(/$name/, @setup_docs)) { 3123 if (!grep(/$name/, @setup_docs)) {
2793 CHK("__setup appears un-documented -- check Documentation/kernel-parameters.txt\n" . $herecurr); 3124 CHK("UNDOCUMENTED_SETUP",
3125 "__setup appears un-documented -- check Documentation/kernel-parameters.txt\n" . $herecurr);
2794 } 3126 }
2795 } 3127 }
2796 3128
2797# check for pointless casting of kmalloc return 3129# check for pointless casting of kmalloc return
2798 if ($line =~ /\*\s*\)\s*[kv][czm]alloc(_node){0,1}\b/) { 3130 if ($line =~ /\*\s*\)\s*[kv][czm]alloc(_node){0,1}\b/) {
2799 WARN("unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr); 3131 WARN("UNNECESSARY_CASTS",
3132 "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr);
2800 } 3133 }
2801 3134
2802# check for multiple semicolons 3135# check for multiple semicolons
2803 if ($line =~ /;\s*;\s*$/) { 3136 if ($line =~ /;\s*;\s*$/) {
2804 WARN("Statements terminations use 1 semicolon\n" . $herecurr); 3137 WARN("ONE_SEMICOLON",
3138 "Statements terminations use 1 semicolon\n" . $herecurr);
2805 } 3139 }
2806 3140
2807# check for gcc specific __FUNCTION__ 3141# check for gcc specific __FUNCTION__
2808 if ($line =~ /__FUNCTION__/) { 3142 if ($line =~ /__FUNCTION__/) {
2809 WARN("__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr); 3143 WARN("USE_FUNC",
3144 "__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr);
2810 } 3145 }
2811 3146
2812# check for semaphores initialized locked 3147# check for semaphores initialized locked
2813 if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) { 3148 if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) {
2814 WARN("consider using a completion\n" . $herecurr); 3149 WARN("CONSIDER_COMPLETION",
3150 "consider using a completion\n" . $herecurr);
2815 3151
2816 } 3152 }
2817# recommend kstrto* over simple_strto* 3153# recommend kstrto* over simple_strto*
2818 if ($line =~ /\bsimple_(strto.*?)\s*\(/) { 3154 if ($line =~ /\bsimple_(strto.*?)\s*\(/) {
2819 WARN("consider using kstrto* in preference to simple_$1\n" . $herecurr); 3155 WARN("CONSIDER_KSTRTO",
3156 "consider using kstrto* in preference to simple_$1\n" . $herecurr);
2820 } 3157 }
2821# check for __initcall(), use device_initcall() explicitly please 3158# check for __initcall(), use device_initcall() explicitly please
2822 if ($line =~ /^.\s*__initcall\s*\(/) { 3159 if ($line =~ /^.\s*__initcall\s*\(/) {
2823 WARN("please use device_initcall() instead of __initcall()\n" . $herecurr); 3160 WARN("USE_DEVICE_INITCALL",
3161 "please use device_initcall() instead of __initcall()\n" . $herecurr);
2824 } 3162 }
2825# check for various ops structs, ensure they are const. 3163# check for various ops structs, ensure they are const.
2826 my $struct_ops = qr{acpi_dock_ops| 3164 my $struct_ops = qr{acpi_dock_ops|
@@ -2862,7 +3200,8 @@ sub process {
2862 wd_ops}x; 3200 wd_ops}x;
2863 if ($line !~ /\bconst\b/ && 3201 if ($line !~ /\bconst\b/ &&
2864 $line =~ /\bstruct\s+($struct_ops)\b/) { 3202 $line =~ /\bstruct\s+($struct_ops)\b/) {
2865 WARN("struct $1 should normally be const\n" . 3203 WARN("CONST_STRUCT",
3204 "struct $1 should normally be const\n" .
2866 $herecurr); 3205 $herecurr);
2867 } 3206 }
2868 3207
@@ -2875,7 +3214,8 @@ sub process {
2875 $line !~ /\[[^\]]*\.\.\.[^\]]*NR_CPUS[^\]]*\]/ && 3214 $line !~ /\[[^\]]*\.\.\.[^\]]*NR_CPUS[^\]]*\]/ &&
2876 $line !~ /\[[^\]]*NR_CPUS[^\]]*\.\.\.[^\]]*\]/) 3215 $line !~ /\[[^\]]*NR_CPUS[^\]]*\.\.\.[^\]]*\]/)
2877 { 3216 {
2878 WARN("usage of NR_CPUS is often wrong - consider using cpu_possible(), num_possible_cpus(), for_each_possible_cpu(), etc\n" . $herecurr); 3217 WARN("NR_CPUS",
3218 "usage of NR_CPUS is often wrong - consider using cpu_possible(), num_possible_cpus(), for_each_possible_cpu(), etc\n" . $herecurr);
2879 } 3219 }
2880 3220
2881# check for %L{u,d,i} in strings 3221# check for %L{u,d,i} in strings
@@ -2884,7 +3224,8 @@ sub process {
2884 $string = substr($rawline, $-[1], $+[1] - $-[1]); 3224 $string = substr($rawline, $-[1], $+[1] - $-[1]);
2885 $string =~ s/%%/__/g; 3225 $string =~ s/%%/__/g;
2886 if ($string =~ /(?<!%)%L[udi]/) { 3226 if ($string =~ /(?<!%)%L[udi]/) {
2887 WARN("\%Ld/%Lu are not-standard C, use %lld/%llu\n" . $herecurr); 3227 WARN("PRINTF_L",
3228 "\%Ld/%Lu are not-standard C, use %lld/%llu\n" . $herecurr);
2888 last; 3229 last;
2889 } 3230 }
2890 } 3231 }
@@ -2892,9 +3233,11 @@ sub process {
2892# whine mightly about in_atomic 3233# whine mightly about in_atomic
2893 if ($line =~ /\bin_atomic\s*\(/) { 3234 if ($line =~ /\bin_atomic\s*\(/) {
2894 if ($realfile =~ m@^drivers/@) { 3235 if ($realfile =~ m@^drivers/@) {
2895 ERROR("do not use in_atomic in drivers\n" . $herecurr); 3236 ERROR("IN_ATOMIC",
3237 "do not use in_atomic in drivers\n" . $herecurr);
2896 } elsif ($realfile !~ m@^kernel/@) { 3238 } elsif ($realfile !~ m@^kernel/@) {
2897 WARN("use of in_atomic() is incorrect outside core kernel code\n" . $herecurr); 3239 WARN("IN_ATOMIC",
3240 "use of in_atomic() is incorrect outside core kernel code\n" . $herecurr);
2898 } 3241 }
2899 } 3242 }
2900 3243
@@ -2904,18 +3247,21 @@ sub process {
2904 if ($realfile !~ m@^kernel/lockdep@ && 3247 if ($realfile !~ m@^kernel/lockdep@ &&
2905 $realfile !~ m@^include/linux/lockdep@ && 3248 $realfile !~ m@^include/linux/lockdep@ &&
2906 $realfile !~ m@^drivers/base/core@) { 3249 $realfile !~ m@^drivers/base/core@) {
2907 ERROR("lockdep_no_validate class is reserved for device->mutex.\n" . $herecurr); 3250 ERROR("LOCKDEP",
3251 "lockdep_no_validate class is reserved for device->mutex.\n" . $herecurr);
2908 } 3252 }
2909 } 3253 }
2910 3254
2911 if ($line =~ /debugfs_create_file.*S_IWUGO/ || 3255 if ($line =~ /debugfs_create_file.*S_IWUGO/ ||
2912 $line =~ /DEVICE_ATTR.*S_IWUGO/ ) { 3256 $line =~ /DEVICE_ATTR.*S_IWUGO/ ) {
2913 WARN("Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr); 3257 WARN("EXPORTED_WORLD_WRITABLE",
3258 "Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr);
2914 } 3259 }
2915 3260
2916 # Check for memset with swapped arguments 3261 # Check for memset with swapped arguments
2917 if ($line =~ /memset.*\,(\ |)(0x|)0(\ |0|)\);/) { 3262 if ($line =~ /memset.*\,(\ |)(0x|)0(\ |0|)\);/) {
2918 ERROR("memset size is 3rd argument, not the second.\n" . $herecurr); 3263 ERROR("MEMSET",
3264 "memset size is 3rd argument, not the second.\n" . $herecurr);
2919 } 3265 }
2920 } 3266 }
2921 3267
@@ -2938,10 +3284,12 @@ sub process {
2938 } 3284 }
2939 3285
2940 if (!$is_patch) { 3286 if (!$is_patch) {
2941 ERROR("Does not appear to be a unified-diff format patch\n"); 3287 ERROR("NOT_UNIFIED_DIFF",
3288 "Does not appear to be a unified-diff format patch\n");
2942 } 3289 }
2943 if ($is_patch && $chk_signoff && $signoff == 0) { 3290 if ($is_patch && $chk_signoff && $signoff == 0) {
2944 ERROR("Missing Signed-off-by: line(s)\n"); 3291 ERROR("MISSING_SIGN_OFF",
3292 "Missing Signed-off-by: line(s)\n");
2945 } 3293 }
2946 3294
2947 print report_dump(); 3295 print report_dump();
@@ -2963,13 +3311,25 @@ sub process {
2963 } 3311 }
2964 } 3312 }
2965 3313
3314 if (keys %ignore_type) {
3315 print "NOTE: Ignored message types:";
3316 foreach my $ignore (sort keys %ignore_type) {
3317 print " $ignore";
3318 }
3319 print "\n";
3320 print "\n" if ($quiet == 0);
3321 }
3322
2966 if ($clean == 1 && $quiet == 0) { 3323 if ($clean == 1 && $quiet == 0) {
2967 print "$vname has no obvious style problems and is ready for submission.\n" 3324 print "$vname has no obvious style problems and is ready for submission.\n"
2968 } 3325 }
2969 if ($clean == 0 && $quiet == 0) { 3326 if ($clean == 0 && $quiet == 0) {
2970 print "$vname has style problems, please review. If any of these errors\n"; 3327 print << "EOM";
2971 print "are false positives report them to the maintainer, see\n"; 3328$vname has style problems, please review.
2972 print "CHECKPATCH in MAINTAINERS.\n"; 3329
3330If any of these errors are false positives, please report
3331them to the maintainer, see CHECKPATCH in MAINTAINERS.
3332EOM
2973 } 3333 }
2974 3334
2975 return $clean; 3335 return $clean;
diff --git a/scripts/depmod.sh b/scripts/depmod.sh
index 3b029cba2baf..a27235685949 100755
--- a/scripts/depmod.sh
+++ b/scripts/depmod.sh
@@ -21,13 +21,15 @@ fi
21# older versions of depmod require the version string to start with three 21# older versions of depmod require the version string to start with three
22# numbers, so we cheat with a symlink here 22# numbers, so we cheat with a symlink here
23depmod_hack_needed=true 23depmod_hack_needed=true
24mkdir -p .tmp_depmod/lib/modules/$KERNELRELEASE 24tmp_dir=$(mktemp -d ${TMPDIR:-/tmp}/depmod.XXXXXX)
25if "$DEPMOD" -b .tmp_depmod $KERNELRELEASE 2>/dev/null; then 25mkdir -p "$tmp_dir/lib/modules/$KERNELRELEASE"
26 if test -e .tmp_depmod/lib/modules/$KERNELRELEASE/modules.dep -o \ 26if "$DEPMOD" -b "$tmp_dir" $KERNELRELEASE 2>/dev/null; then
27 -e .tmp_depmod/lib/modules/$KERNELRELEASE/modules.dep.bin; then 27 if test -e "$tmp_dir/lib/modules/$KERNELRELEASE/modules.dep" -o \
28 -e "$tmp_dir/lib/modules/$KERNELRELEASE/modules.dep.bin"; then
28 depmod_hack_needed=false 29 depmod_hack_needed=false
29 fi 30 fi
30fi 31fi
32rm -rf "$tmp_dir"
31if $depmod_hack_needed; then 33if $depmod_hack_needed; then
32 symlink="$INSTALL_MOD_PATH/lib/modules/99.98.$KERNELRELEASE" 34 symlink="$INSTALL_MOD_PATH/lib/modules/99.98.$KERNELRELEASE"
33 ln -s "$KERNELRELEASE" "$symlink" 35 ln -s "$KERNELRELEASE" "$symlink"
diff --git a/scripts/docproc.c b/scripts/docproc.c
index 98dec87974d0..4cfdc1797eb8 100644
--- a/scripts/docproc.c
+++ b/scripts/docproc.c
@@ -205,8 +205,7 @@ static void find_export_symbols(char * filename)
205 PATH_MAX - strlen(real_filename)); 205 PATH_MAX - strlen(real_filename));
206 sym = add_new_file(filename); 206 sym = add_new_file(filename);
207 fp = fopen(real_filename, "r"); 207 fp = fopen(real_filename, "r");
208 if (fp == NULL) 208 if (fp == NULL) {
209 {
210 fprintf(stderr, "docproc: "); 209 fprintf(stderr, "docproc: ");
211 perror(real_filename); 210 perror(real_filename);
212 exit(1); 211 exit(1);
@@ -487,8 +486,7 @@ static void parse_file(FILE *infile)
487 default: 486 default:
488 defaultline(line); 487 defaultline(line);
489 } 488 }
490 } 489 } else {
491 else {
492 defaultline(line); 490 defaultline(line);
493 } 491 }
494 } 492 }
@@ -519,8 +517,7 @@ int main(int argc, char *argv[])
519 exit(2); 517 exit(2);
520 } 518 }
521 519
522 if (strcmp("doc", argv[1]) == 0) 520 if (strcmp("doc", argv[1]) == 0) {
523 {
524 /* Need to do this in two passes. 521 /* Need to do this in two passes.
525 * First pass is used to collect all symbols exported 522 * First pass is used to collect all symbols exported
526 * in the various files; 523 * in the various files;
@@ -556,9 +553,7 @@ int main(int argc, char *argv[])
556 fprintf(stderr, "Warning: didn't use docs for %s\n", 553 fprintf(stderr, "Warning: didn't use docs for %s\n",
557 all_list[i]); 554 all_list[i]);
558 } 555 }
559 } 556 } else if (strcmp("depend", argv[1]) == 0) {
560 else if (strcmp("depend", argv[1]) == 0)
561 {
562 /* Create first part of dependency chain 557 /* Create first part of dependency chain
563 * file.tmpl */ 558 * file.tmpl */
564 printf("%s\t", argv[2]); 559 printf("%s\t", argv[2]);
@@ -571,9 +566,7 @@ int main(int argc, char *argv[])
571 findall = adddep; 566 findall = adddep;
572 parse_file(infile); 567 parse_file(infile);
573 printf("\n"); 568 printf("\n");
574 } 569 } else {
575 else
576 {
577 fprintf(stderr, "Unknown option: %s\n", argv[1]); 570 fprintf(stderr, "Unknown option: %s\n", argv[1]);
578 exit(1); 571 exit(1);
579 } 572 }
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
index 04a31c17639f..6d1c6bb9f224 100644
--- a/scripts/dtc/Makefile
+++ b/scripts/dtc/Makefile
@@ -25,31 +25,5 @@ HOSTCFLAGS_dtc-lexer.lex.o := $(HOSTCFLAGS_DTC)
25HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC) 25HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC)
26 26
27# dependencies on generated files need to be listed explicitly 27# dependencies on generated files need to be listed explicitly
28$(obj)/dtc-parser.tab.o: $(obj)/dtc-parser.tab.c $(obj)/dtc-parser.tab.h 28$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
29$(obj)/dtc-lexer.lex.o: $(obj)/dtc-lexer.lex.c $(obj)/dtc-parser.tab.h
30 29
31targets += dtc-parser.tab.c dtc-lexer.lex.c
32
33clean-files += dtc-parser.tab.h
34
35# GENERATE_PARSER := 1 # Uncomment to rebuild flex/bison output
36
37ifdef GENERATE_PARSER
38
39BISON = bison
40FLEX = flex
41
42quiet_cmd_bison = BISON $@
43 cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped
44quiet_cmd_flex = FLEX $@
45 cmd_flex = $(FLEX) -o$@ $<; cp $@ $@_shipped
46
47$(obj)/dtc-parser.tab.c: $(src)/dtc-parser.y FORCE
48 $(call if_changed,bison)
49
50$(obj)/dtc-parser.tab.h: $(obj)/dtc-parser.tab.c
51
52$(obj)/dtc-lexer.lex.c: $(src)/dtc-lexer.l FORCE
53 $(call if_changed,flex)
54
55endif
diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped
index 50c4420b4b2c..8bbe12817050 100644
--- a/scripts/dtc/dtc-lexer.lex.c_shipped
+++ b/scripts/dtc/dtc-lexer.lex.c_shipped
@@ -1,6 +1,5 @@
1#line 2 "dtc-lexer.lex.c"
2 1
3#line 4 "dtc-lexer.lex.c" 2#line 3 "scripts/dtc/dtc-lexer.lex.c_shipped"
4 3
5#define YY_INT_ALIGNED short int 4#define YY_INT_ALIGNED short int
6 5
@@ -54,6 +53,7 @@ typedef int flex_int32_t;
54typedef unsigned char flex_uint8_t; 53typedef unsigned char flex_uint8_t;
55typedef unsigned short int flex_uint16_t; 54typedef unsigned short int flex_uint16_t;
56typedef unsigned int flex_uint32_t; 55typedef unsigned int flex_uint32_t;
56#endif /* ! C99 */
57 57
58/* Limits of integral types. */ 58/* Limits of integral types. */
59#ifndef INT8_MIN 59#ifndef INT8_MIN
@@ -84,8 +84,6 @@ typedef unsigned int flex_uint32_t;
84#define UINT32_MAX (4294967295U) 84#define UINT32_MAX (4294967295U)
85#endif 85#endif
86 86
87#endif /* ! C99 */
88
89#endif /* ! FLEXINT_H */ 87#endif /* ! FLEXINT_H */
90 88
91#ifdef __cplusplus 89#ifdef __cplusplus
@@ -142,15 +140,7 @@ typedef unsigned int flex_uint32_t;
142 140
143/* Size of default input buffer. */ 141/* Size of default input buffer. */
144#ifndef YY_BUF_SIZE 142#ifndef YY_BUF_SIZE
145#ifdef __ia64__
146/* On IA-64, the buffer size is 16k, not 8k.
147 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
148 * Ditto for the __ia64__ case accordingly.
149 */
150#define YY_BUF_SIZE 32768
151#else
152#define YY_BUF_SIZE 16384 143#define YY_BUF_SIZE 16384
153#endif /* __ia64__ */
154#endif 144#endif
155 145
156/* The state buf must be large enough to hold one state per character in the main buffer. 146/* The state buf must be large enough to hold one state per character in the main buffer.
@@ -550,7 +540,6 @@ int yy_flex_debug = 0;
550#define YY_MORE_ADJ 0 540#define YY_MORE_ADJ 0
551#define YY_RESTORE_YY_MORE_OFFSET 541#define YY_RESTORE_YY_MORE_OFFSET
552char *yytext; 542char *yytext;
553#line 1 "dtc-lexer.l"
554/* 543/*
555 * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005. 544 * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005.
556 * 545 *
@@ -572,10 +561,6 @@ char *yytext;
572 */ 561 */
573#define YY_NO_INPUT 1 562#define YY_NO_INPUT 1
574 563
575
576
577
578#line 37 "dtc-lexer.l"
579#include "dtc.h" 564#include "dtc.h"
580#include "srcpos.h" 565#include "srcpos.h"
581#include "dtc-parser.tab.h" 566#include "dtc-parser.tab.h"
@@ -603,7 +588,6 @@ static int dts_version = 1;
603 588
604static void push_input_file(const char *filename); 589static void push_input_file(const char *filename);
605static int pop_input_file(void); 590static int pop_input_file(void);
606#line 607 "dtc-lexer.lex.c"
607 591
608#define INITIAL 0 592#define INITIAL 0
609#define INCLUDE 1 593#define INCLUDE 1
@@ -686,12 +670,7 @@ static int input (void );
686 670
687/* Amount of stuff to slurp up with each read. */ 671/* Amount of stuff to slurp up with each read. */
688#ifndef YY_READ_BUF_SIZE 672#ifndef YY_READ_BUF_SIZE
689#ifdef __ia64__
690/* On IA-64, the buffer size is 16k, not 8k */
691#define YY_READ_BUF_SIZE 16384
692#else
693#define YY_READ_BUF_SIZE 8192 673#define YY_READ_BUF_SIZE 8192
694#endif /* __ia64__ */
695#endif 674#endif
696 675
697/* Copy whatever the last rule matched to the standard output. */ 676/* Copy whatever the last rule matched to the standard output. */
@@ -710,7 +689,7 @@ static int input (void );
710 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 689 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
711 { \ 690 { \
712 int c = '*'; \ 691 int c = '*'; \
713 size_t n; \ 692 unsigned n; \
714 for ( n = 0; n < max_size && \ 693 for ( n = 0; n < max_size && \
715 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 694 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
716 buf[n] = (char) c; \ 695 buf[n] = (char) c; \
@@ -792,10 +771,6 @@ YY_DECL
792 register char *yy_cp, *yy_bp; 771 register char *yy_cp, *yy_bp;
793 register int yy_act; 772 register int yy_act;
794 773
795#line 66 "dtc-lexer.l"
796
797#line 798 "dtc-lexer.lex.c"
798
799 if ( !(yy_init) ) 774 if ( !(yy_init) )
800 { 775 {
801 (yy_init) = 1; 776 (yy_init) = 1;
@@ -876,7 +851,6 @@ do_action: /* This label is used only to access EOF actions. */
876case 1: 851case 1:
877/* rule 1 can match eol */ 852/* rule 1 can match eol */
878YY_RULE_SETUP 853YY_RULE_SETUP
879#line 67 "dtc-lexer.l"
880{ 854{
881 char *name = strchr(yytext, '\"') + 1; 855 char *name = strchr(yytext, '\"') + 1;
882 yytext[yyleng-1] = '\0'; 856 yytext[yyleng-1] = '\0';
@@ -888,7 +862,6 @@ case YY_STATE_EOF(INCLUDE):
888case YY_STATE_EOF(BYTESTRING): 862case YY_STATE_EOF(BYTESTRING):
889case YY_STATE_EOF(PROPNODENAME): 863case YY_STATE_EOF(PROPNODENAME):
890case YY_STATE_EOF(V1): 864case YY_STATE_EOF(V1):
891#line 73 "dtc-lexer.l"
892{ 865{
893 if (!pop_input_file()) { 866 if (!pop_input_file()) {
894 yyterminate(); 867 yyterminate();
@@ -898,7 +871,6 @@ case YY_STATE_EOF(V1):
898case 2: 871case 2:
899/* rule 2 can match eol */ 872/* rule 2 can match eol */
900YY_RULE_SETUP 873YY_RULE_SETUP
901#line 79 "dtc-lexer.l"
902{ 874{
903 DPRINT("String: %s\n", yytext); 875 DPRINT("String: %s\n", yytext);
904 yylval.data = data_copy_escape_string(yytext+1, 876 yylval.data = data_copy_escape_string(yytext+1,
@@ -908,7 +880,6 @@ YY_RULE_SETUP
908 YY_BREAK 880 YY_BREAK
909case 3: 881case 3:
910YY_RULE_SETUP 882YY_RULE_SETUP
911#line 86 "dtc-lexer.l"
912{ 883{
913 DPRINT("Keyword: /dts-v1/\n"); 884 DPRINT("Keyword: /dts-v1/\n");
914 dts_version = 1; 885 dts_version = 1;
@@ -918,7 +889,6 @@ YY_RULE_SETUP
918 YY_BREAK 889 YY_BREAK
919case 4: 890case 4:
920YY_RULE_SETUP 891YY_RULE_SETUP
921#line 93 "dtc-lexer.l"
922{ 892{
923 DPRINT("Keyword: /memreserve/\n"); 893 DPRINT("Keyword: /memreserve/\n");
924 BEGIN_DEFAULT(); 894 BEGIN_DEFAULT();
@@ -927,7 +897,6 @@ YY_RULE_SETUP
927 YY_BREAK 897 YY_BREAK
928case 5: 898case 5:
929YY_RULE_SETUP 899YY_RULE_SETUP
930#line 99 "dtc-lexer.l"
931{ 900{
932 DPRINT("Label: %s\n", yytext); 901 DPRINT("Label: %s\n", yytext);
933 yylval.labelref = xstrdup(yytext); 902 yylval.labelref = xstrdup(yytext);
@@ -937,7 +906,6 @@ YY_RULE_SETUP
937 YY_BREAK 906 YY_BREAK
938case 6: 907case 6:
939YY_RULE_SETUP 908YY_RULE_SETUP
940#line 106 "dtc-lexer.l"
941{ 909{
942 yylval.literal = xstrdup(yytext); 910 yylval.literal = xstrdup(yytext);
943 DPRINT("Literal: '%s'\n", yylval.literal); 911 DPRINT("Literal: '%s'\n", yylval.literal);
@@ -946,7 +914,6 @@ YY_RULE_SETUP
946 YY_BREAK 914 YY_BREAK
947case 7: 915case 7:
948YY_RULE_SETUP 916YY_RULE_SETUP
949#line 112 "dtc-lexer.l"
950{ /* label reference */ 917{ /* label reference */
951 DPRINT("Ref: %s\n", yytext+1); 918 DPRINT("Ref: %s\n", yytext+1);
952 yylval.labelref = xstrdup(yytext+1); 919 yylval.labelref = xstrdup(yytext+1);
@@ -955,7 +922,6 @@ YY_RULE_SETUP
955 YY_BREAK 922 YY_BREAK
956case 8: 923case 8:
957YY_RULE_SETUP 924YY_RULE_SETUP
958#line 118 "dtc-lexer.l"
959{ /* new-style path reference */ 925{ /* new-style path reference */
960 yytext[yyleng-1] = '\0'; 926 yytext[yyleng-1] = '\0';
961 DPRINT("Ref: %s\n", yytext+2); 927 DPRINT("Ref: %s\n", yytext+2);
@@ -965,7 +931,6 @@ YY_RULE_SETUP
965 YY_BREAK 931 YY_BREAK
966case 9: 932case 9:
967YY_RULE_SETUP 933YY_RULE_SETUP
968#line 125 "dtc-lexer.l"
969{ 934{
970 yylval.byte = strtol(yytext, NULL, 16); 935 yylval.byte = strtol(yytext, NULL, 16);
971 DPRINT("Byte: %02x\n", (int)yylval.byte); 936 DPRINT("Byte: %02x\n", (int)yylval.byte);
@@ -974,7 +939,6 @@ YY_RULE_SETUP
974 YY_BREAK 939 YY_BREAK
975case 10: 940case 10:
976YY_RULE_SETUP 941YY_RULE_SETUP
977#line 131 "dtc-lexer.l"
978{ 942{
979 DPRINT("/BYTESTRING\n"); 943 DPRINT("/BYTESTRING\n");
980 BEGIN_DEFAULT(); 944 BEGIN_DEFAULT();
@@ -983,7 +947,6 @@ YY_RULE_SETUP
983 YY_BREAK 947 YY_BREAK
984case 11: 948case 11:
985YY_RULE_SETUP 949YY_RULE_SETUP
986#line 137 "dtc-lexer.l"
987{ 950{
988 DPRINT("PropNodeName: %s\n", yytext); 951 DPRINT("PropNodeName: %s\n", yytext);
989 yylval.propnodename = xstrdup(yytext); 952 yylval.propnodename = xstrdup(yytext);
@@ -993,7 +956,6 @@ YY_RULE_SETUP
993 YY_BREAK 956 YY_BREAK
994case 12: 957case 12:
995YY_RULE_SETUP 958YY_RULE_SETUP
996#line 144 "dtc-lexer.l"
997{ 959{
998 DPRINT("Binary Include\n"); 960 DPRINT("Binary Include\n");
999 return DT_INCBIN; 961 return DT_INCBIN;
@@ -1002,24 +964,20 @@ YY_RULE_SETUP
1002case 13: 964case 13:
1003/* rule 13 can match eol */ 965/* rule 13 can match eol */
1004YY_RULE_SETUP 966YY_RULE_SETUP
1005#line 149 "dtc-lexer.l"
1006/* eat whitespace */ 967/* eat whitespace */
1007 YY_BREAK 968 YY_BREAK
1008case 14: 969case 14:
1009/* rule 14 can match eol */ 970/* rule 14 can match eol */
1010YY_RULE_SETUP 971YY_RULE_SETUP
1011#line 150 "dtc-lexer.l"
1012/* eat C-style comments */ 972/* eat C-style comments */
1013 YY_BREAK 973 YY_BREAK
1014case 15: 974case 15:
1015/* rule 15 can match eol */ 975/* rule 15 can match eol */
1016YY_RULE_SETUP 976YY_RULE_SETUP
1017#line 151 "dtc-lexer.l"
1018/* eat C++-style comments */ 977/* eat C++-style comments */
1019 YY_BREAK 978 YY_BREAK
1020case 16: 979case 16:
1021YY_RULE_SETUP 980YY_RULE_SETUP
1022#line 153 "dtc-lexer.l"
1023{ 981{
1024 DPRINT("Char: %c (\\x%02x)\n", yytext[0], 982 DPRINT("Char: %c (\\x%02x)\n", yytext[0],
1025 (unsigned)yytext[0]); 983 (unsigned)yytext[0]);
@@ -1037,10 +995,8 @@ YY_RULE_SETUP
1037 YY_BREAK 995 YY_BREAK
1038case 17: 996case 17:
1039YY_RULE_SETUP 997YY_RULE_SETUP
1040#line 168 "dtc-lexer.l"
1041ECHO; 998ECHO;
1042 YY_BREAK 999 YY_BREAK
1043#line 1044 "dtc-lexer.lex.c"
1044 1000
1045 case YY_END_OF_BUFFER: 1001 case YY_END_OF_BUFFER:
1046 { 1002 {
@@ -1756,8 +1712,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1756 1712
1757/** Setup the input buffer state to scan the given bytes. The next call to yylex() will 1713/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1758 * scan from a @e copy of @a bytes. 1714 * scan from a @e copy of @a bytes.
1759 * @param yybytes the byte buffer to scan 1715 * @param bytes the byte buffer to scan
1760 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. 1716 * @param len the number of bytes in the buffer pointed to by @a bytes.
1761 * 1717 *
1762 * @return the newly allocated buffer state object. 1718 * @return the newly allocated buffer state object.
1763 */ 1719 */
@@ -1996,10 +1952,6 @@ void yyfree (void * ptr )
1996 1952
1997#define YYTABLES_NAME "yytables" 1953#define YYTABLES_NAME "yytables"
1998 1954
1999#line 168 "dtc-lexer.l"
2000
2001
2002
2003static void push_input_file(const char *filename) 1955static void push_input_file(const char *filename)
2004{ 1956{
2005 assert(filename); 1957 assert(filename);
@@ -2011,7 +1963,6 @@ static void push_input_file(const char *filename)
2011 yypush_buffer_state(yy_create_buffer(yyin,YY_BUF_SIZE)); 1963 yypush_buffer_state(yy_create_buffer(yyin,YY_BUF_SIZE));
2012} 1964}
2013 1965
2014
2015static int pop_input_file(void) 1966static int pop_input_file(void)
2016{ 1967{
2017 if (srcfile_pop() == 0) 1968 if (srcfile_pop() == 0)
diff --git a/scripts/dtc/dtc-parser.tab.c_shipped b/scripts/dtc/dtc-parser.tab.c_shipped
index 9be2eea18a30..b05921e1e848 100644
--- a/scripts/dtc/dtc-parser.tab.c_shipped
+++ b/scripts/dtc/dtc-parser.tab.c_shipped
@@ -1,10 +1,9 @@
1 1/* A Bison parser, made by GNU Bison 2.4.3. */
2/* A Bison parser, made by GNU Bison 2.4.1. */
3 2
4/* Skeleton implementation for Bison's Yacc-like parsers in C 3/* Skeleton implementation for Bison's Yacc-like parsers in C
5 4
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
7 Free Software Foundation, Inc. 6 2009, 2010 Free Software Foundation, Inc.
8 7
9 This program is free software: you can redistribute it and/or modify 8 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
@@ -46,7 +45,7 @@
46#define YYBISON 1 45#define YYBISON 1
47 46
48/* Bison version. */ 47/* Bison version. */
49#define YYBISON_VERSION "2.4.1" 48#define YYBISON_VERSION "2.4.3"
50 49
51/* Skeleton name. */ 50/* Skeleton name. */
52#define YYSKELETON_NAME "yacc.c" 51#define YYSKELETON_NAME "yacc.c"
@@ -67,8 +66,6 @@
67 66
68/* Copy the first part of user declarations. */ 67/* Copy the first part of user declarations. */
69 68
70/* Line 189 of yacc.c */
71#line 21 "dtc-parser.y"
72 69
73#include <stdio.h> 70#include <stdio.h>
74 71
@@ -87,12 +84,10 @@ extern int treesource_error;
87static unsigned long long eval_literal(const char *s, int base, int bits); 84static unsigned long long eval_literal(const char *s, int base, int bits);
88 85
89 86
90/* Line 189 of yacc.c */
91#line 92 "dtc-parser.tab.c"
92 87
93/* Enabling traces. */ 88/* Enabling traces. */
94#ifndef YYDEBUG 89#ifndef YYDEBUG
95# define YYDEBUG 0 90# define YYDEBUG 1
96#endif 91#endif
97 92
98/* Enabling verbose error messages. */ 93/* Enabling verbose error messages. */
@@ -134,8 +129,6 @@ static unsigned long long eval_literal(const char *s, int base, int bits);
134typedef union YYSTYPE 129typedef union YYSTYPE
135{ 130{
136 131
137/* Line 214 of yacc.c */
138#line 39 "dtc-parser.y"
139 132
140 char *propnodename; 133 char *propnodename;
141 char *literal; 134 char *literal;
@@ -154,8 +147,6 @@ typedef union YYSTYPE
154 147
155 148
156 149
157/* Line 214 of yacc.c */
158#line 159 "dtc-parser.tab.c"
159} YYSTYPE; 150} YYSTYPE;
160# define YYSTYPE_IS_TRIVIAL 1 151# define YYSTYPE_IS_TRIVIAL 1
161# define yystype YYSTYPE /* obsolescent; will be withdrawn */ 152# define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -166,8 +157,6 @@ typedef union YYSTYPE
166/* Copy the second part of user declarations. */ 157/* Copy the second part of user declarations. */
167 158
168 159
169/* Line 264 of yacc.c */
170#line 171 "dtc-parser.tab.c"
171 160
172#ifdef short 161#ifdef short
173# undef short 162# undef short
@@ -217,7 +206,7 @@ typedef short int yytype_int16;
217#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 206#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
218 207
219#ifndef YY_ 208#ifndef YY_
220# if YYENABLE_NLS 209# if defined YYENABLE_NLS && YYENABLE_NLS
221# if ENABLE_NLS 210# if ENABLE_NLS
222# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 211# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
223# define YY_(msgid) dgettext ("bison-runtime", msgid) 212# define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -607,9 +596,18 @@ static const yytype_uint8 yystos[] =
607 596
608/* Like YYERROR except do call yyerror. This remains here temporarily 597/* Like YYERROR except do call yyerror. This remains here temporarily
609 to ease the transition to the new meaning of YYERROR, for GCC. 598 to ease the transition to the new meaning of YYERROR, for GCC.
610 Once GCC version 2 has supplanted version 1, this can go. */ 599 Once GCC version 2 has supplanted version 1, this can go. However,
600 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
601 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
602 discussed. */
611 603
612#define YYFAIL goto yyerrlab 604#define YYFAIL goto yyerrlab
605#if defined YYFAIL
606 /* This is here to suppress warnings from the GCC cpp's
607 -Wunused-macros. Normally we don't worry about that warning, but
608 some users do, and we want to make it easy for users to remove
609 YYFAIL uses, which will produce warnings from Bison 2.5. */
610#endif
613 611
614#define YYRECOVERING() (!!yyerrstatus) 612#define YYRECOVERING() (!!yyerrstatus)
615 613
@@ -666,7 +664,7 @@ while (YYID (0))
666 we won't break user code: when these are the locations we know. */ 664 we won't break user code: when these are the locations we know. */
667 665
668#ifndef YY_LOCATION_PRINT 666#ifndef YY_LOCATION_PRINT
669# if YYLTYPE_IS_TRIVIAL 667# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
670# define YY_LOCATION_PRINT(File, Loc) \ 668# define YY_LOCATION_PRINT(File, Loc) \
671 fprintf (File, "%d.%d-%d.%d", \ 669 fprintf (File, "%d.%d-%d.%d", \
672 (Loc).first_line, (Loc).first_column, \ 670 (Loc).first_line, (Loc).first_column, \
@@ -1405,8 +1403,6 @@ yyreduce:
1405 { 1403 {
1406 case 2: 1404 case 2:
1407 1405
1408/* Line 1455 of yacc.c */
1409#line 87 "dtc-parser.y"
1410 { 1406 {
1411 the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node), 1407 the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node),
1412 guess_boot_cpuid((yyvsp[(4) - (4)].node))); 1408 guess_boot_cpuid((yyvsp[(4) - (4)].node)));
@@ -1415,8 +1411,6 @@ yyreduce:
1415 1411
1416 case 3: 1412 case 3:
1417 1413
1418/* Line 1455 of yacc.c */
1419#line 95 "dtc-parser.y"
1420 { 1414 {
1421 (yyval.re) = NULL; 1415 (yyval.re) = NULL;
1422 ;} 1416 ;}
@@ -1424,8 +1418,6 @@ yyreduce:
1424 1418
1425 case 4: 1419 case 4:
1426 1420
1427/* Line 1455 of yacc.c */
1428#line 99 "dtc-parser.y"
1429 { 1421 {
1430 (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re)); 1422 (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
1431 ;} 1423 ;}
@@ -1433,8 +1425,6 @@ yyreduce:
1433 1425
1434 case 5: 1426 case 5:
1435 1427
1436/* Line 1455 of yacc.c */
1437#line 106 "dtc-parser.y"
1438 { 1428 {
1439 (yyval.re) = build_reserve_entry((yyvsp[(2) - (4)].addr), (yyvsp[(3) - (4)].addr)); 1429 (yyval.re) = build_reserve_entry((yyvsp[(2) - (4)].addr), (yyvsp[(3) - (4)].addr));
1440 ;} 1430 ;}
@@ -1442,8 +1432,6 @@ yyreduce:
1442 1432
1443 case 6: 1433 case 6:
1444 1434
1445/* Line 1455 of yacc.c */
1446#line 110 "dtc-parser.y"
1447 { 1435 {
1448 add_label(&(yyvsp[(2) - (2)].re)->labels, (yyvsp[(1) - (2)].labelref)); 1436 add_label(&(yyvsp[(2) - (2)].re)->labels, (yyvsp[(1) - (2)].labelref));
1449 (yyval.re) = (yyvsp[(2) - (2)].re); 1437 (yyval.re) = (yyvsp[(2) - (2)].re);
@@ -1452,8 +1440,6 @@ yyreduce:
1452 1440
1453 case 7: 1441 case 7:
1454 1442
1455/* Line 1455 of yacc.c */
1456#line 118 "dtc-parser.y"
1457 { 1443 {
1458 (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64); 1444 (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64);
1459 ;} 1445 ;}
@@ -1461,8 +1447,6 @@ yyreduce:
1461 1447
1462 case 8: 1448 case 8:
1463 1449
1464/* Line 1455 of yacc.c */
1465#line 125 "dtc-parser.y"
1466 { 1450 {
1467 (yyval.node) = name_node((yyvsp[(2) - (2)].node), ""); 1451 (yyval.node) = name_node((yyvsp[(2) - (2)].node), "");
1468 ;} 1452 ;}
@@ -1470,8 +1454,6 @@ yyreduce:
1470 1454
1471 case 9: 1455 case 9:
1472 1456
1473/* Line 1455 of yacc.c */
1474#line 129 "dtc-parser.y"
1475 { 1457 {
1476 (yyval.node) = merge_nodes((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); 1458 (yyval.node) = merge_nodes((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
1477 ;} 1459 ;}
@@ -1479,8 +1461,6 @@ yyreduce:
1479 1461
1480 case 10: 1462 case 10:
1481 1463
1482/* Line 1455 of yacc.c */
1483#line 133 "dtc-parser.y"
1484 { 1464 {
1485 struct node *target = get_node_by_ref((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].labelref)); 1465 struct node *target = get_node_by_ref((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].labelref));
1486 1466
@@ -1494,8 +1474,6 @@ yyreduce:
1494 1474
1495 case 11: 1475 case 11:
1496 1476
1497/* Line 1455 of yacc.c */
1498#line 146 "dtc-parser.y"
1499 { 1477 {
1500 (yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist)); 1478 (yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist));
1501 ;} 1479 ;}
@@ -1503,8 +1481,6 @@ yyreduce:
1503 1481
1504 case 12: 1482 case 12:
1505 1483
1506/* Line 1455 of yacc.c */
1507#line 153 "dtc-parser.y"
1508 { 1484 {
1509 (yyval.proplist) = NULL; 1485 (yyval.proplist) = NULL;
1510 ;} 1486 ;}
@@ -1512,8 +1488,6 @@ yyreduce:
1512 1488
1513 case 13: 1489 case 13:
1514 1490
1515/* Line 1455 of yacc.c */
1516#line 157 "dtc-parser.y"
1517 { 1491 {
1518 (yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist)); 1492 (yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist));
1519 ;} 1493 ;}
@@ -1521,8 +1495,6 @@ yyreduce:
1521 1495
1522 case 14: 1496 case 14:
1523 1497
1524/* Line 1455 of yacc.c */
1525#line 164 "dtc-parser.y"
1526 { 1498 {
1527 (yyval.prop) = build_property((yyvsp[(1) - (4)].propnodename), (yyvsp[(3) - (4)].data)); 1499 (yyval.prop) = build_property((yyvsp[(1) - (4)].propnodename), (yyvsp[(3) - (4)].data));
1528 ;} 1500 ;}
@@ -1530,8 +1502,6 @@ yyreduce:
1530 1502
1531 case 15: 1503 case 15:
1532 1504
1533/* Line 1455 of yacc.c */
1534#line 168 "dtc-parser.y"
1535 { 1505 {
1536 (yyval.prop) = build_property((yyvsp[(1) - (2)].propnodename), empty_data); 1506 (yyval.prop) = build_property((yyvsp[(1) - (2)].propnodename), empty_data);
1537 ;} 1507 ;}
@@ -1539,8 +1509,6 @@ yyreduce:
1539 1509
1540 case 16: 1510 case 16:
1541 1511
1542/* Line 1455 of yacc.c */
1543#line 172 "dtc-parser.y"
1544 { 1512 {
1545 add_label(&(yyvsp[(2) - (2)].prop)->labels, (yyvsp[(1) - (2)].labelref)); 1513 add_label(&(yyvsp[(2) - (2)].prop)->labels, (yyvsp[(1) - (2)].labelref));
1546 (yyval.prop) = (yyvsp[(2) - (2)].prop); 1514 (yyval.prop) = (yyvsp[(2) - (2)].prop);
@@ -1549,8 +1517,6 @@ yyreduce:
1549 1517
1550 case 17: 1518 case 17:
1551 1519
1552/* Line 1455 of yacc.c */
1553#line 180 "dtc-parser.y"
1554 { 1520 {
1555 (yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data)); 1521 (yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data));
1556 ;} 1522 ;}
@@ -1558,8 +1524,6 @@ yyreduce:
1558 1524
1559 case 18: 1525 case 18:
1560 1526
1561/* Line 1455 of yacc.c */
1562#line 184 "dtc-parser.y"
1563 { 1527 {
1564 (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data)); 1528 (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
1565 ;} 1529 ;}
@@ -1567,8 +1531,6 @@ yyreduce:
1567 1531
1568 case 19: 1532 case 19:
1569 1533
1570/* Line 1455 of yacc.c */
1571#line 188 "dtc-parser.y"
1572 { 1534 {
1573 (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data)); 1535 (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
1574 ;} 1536 ;}
@@ -1576,8 +1538,6 @@ yyreduce:
1576 1538
1577 case 20: 1539 case 20:
1578 1540
1579/* Line 1455 of yacc.c */
1580#line 192 "dtc-parser.y"
1581 { 1541 {
1582 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref)); 1542 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
1583 ;} 1543 ;}
@@ -1585,8 +1545,6 @@ yyreduce:
1585 1545
1586 case 21: 1546 case 21:
1587 1547
1588/* Line 1455 of yacc.c */
1589#line 196 "dtc-parser.y"
1590 { 1548 {
1591 FILE *f = srcfile_relative_open((yyvsp[(4) - (9)].data).val, NULL); 1549 FILE *f = srcfile_relative_open((yyvsp[(4) - (9)].data).val, NULL);
1592 struct data d; 1550 struct data d;
@@ -1607,8 +1565,6 @@ yyreduce:
1607 1565
1608 case 22: 1566 case 22:
1609 1567
1610/* Line 1455 of yacc.c */
1611#line 213 "dtc-parser.y"
1612 { 1568 {
1613 FILE *f = srcfile_relative_open((yyvsp[(4) - (5)].data).val, NULL); 1569 FILE *f = srcfile_relative_open((yyvsp[(4) - (5)].data).val, NULL);
1614 struct data d = empty_data; 1570 struct data d = empty_data;
@@ -1622,8 +1578,6 @@ yyreduce:
1622 1578
1623 case 23: 1579 case 23:
1624 1580
1625/* Line 1455 of yacc.c */
1626#line 223 "dtc-parser.y"
1627 { 1581 {
1628 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref)); 1582 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1629 ;} 1583 ;}
@@ -1631,8 +1585,6 @@ yyreduce:
1631 1585
1632 case 24: 1586 case 24:
1633 1587
1634/* Line 1455 of yacc.c */
1635#line 230 "dtc-parser.y"
1636 { 1588 {
1637 (yyval.data) = empty_data; 1589 (yyval.data) = empty_data;
1638 ;} 1590 ;}
@@ -1640,8 +1592,6 @@ yyreduce:
1640 1592
1641 case 25: 1593 case 25:
1642 1594
1643/* Line 1455 of yacc.c */
1644#line 234 "dtc-parser.y"
1645 { 1595 {
1646 (yyval.data) = (yyvsp[(1) - (2)].data); 1596 (yyval.data) = (yyvsp[(1) - (2)].data);
1647 ;} 1597 ;}
@@ -1649,8 +1599,6 @@ yyreduce:
1649 1599
1650 case 26: 1600 case 26:
1651 1601
1652/* Line 1455 of yacc.c */
1653#line 238 "dtc-parser.y"
1654 { 1602 {
1655 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref)); 1603 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1656 ;} 1604 ;}
@@ -1658,8 +1606,6 @@ yyreduce:
1658 1606
1659 case 27: 1607 case 27:
1660 1608
1661/* Line 1455 of yacc.c */
1662#line 245 "dtc-parser.y"
1663 { 1609 {
1664 (yyval.data) = empty_data; 1610 (yyval.data) = empty_data;
1665 ;} 1611 ;}
@@ -1667,8 +1613,6 @@ yyreduce:
1667 1613
1668 case 28: 1614 case 28:
1669 1615
1670/* Line 1455 of yacc.c */
1671#line 249 "dtc-parser.y"
1672 { 1616 {
1673 (yyval.data) = data_append_cell((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].cell)); 1617 (yyval.data) = data_append_cell((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].cell));
1674 ;} 1618 ;}
@@ -1676,8 +1620,6 @@ yyreduce:
1676 1620
1677 case 29: 1621 case 29:
1678 1622
1679/* Line 1455 of yacc.c */
1680#line 253 "dtc-parser.y"
1681 { 1623 {
1682 (yyval.data) = data_append_cell(data_add_marker((yyvsp[(1) - (2)].data), REF_PHANDLE, 1624 (yyval.data) = data_append_cell(data_add_marker((yyvsp[(1) - (2)].data), REF_PHANDLE,
1683 (yyvsp[(2) - (2)].labelref)), -1); 1625 (yyvsp[(2) - (2)].labelref)), -1);
@@ -1686,8 +1628,6 @@ yyreduce:
1686 1628
1687 case 30: 1629 case 30:
1688 1630
1689/* Line 1455 of yacc.c */
1690#line 258 "dtc-parser.y"
1691 { 1631 {
1692 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref)); 1632 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1693 ;} 1633 ;}
@@ -1695,8 +1635,6 @@ yyreduce:
1695 1635
1696 case 31: 1636 case 31:
1697 1637
1698/* Line 1455 of yacc.c */
1699#line 265 "dtc-parser.y"
1700 { 1638 {
1701 (yyval.cell) = eval_literal((yyvsp[(1) - (1)].literal), 0, 32); 1639 (yyval.cell) = eval_literal((yyvsp[(1) - (1)].literal), 0, 32);
1702 ;} 1640 ;}
@@ -1704,8 +1642,6 @@ yyreduce:
1704 1642
1705 case 32: 1643 case 32:
1706 1644
1707/* Line 1455 of yacc.c */
1708#line 272 "dtc-parser.y"
1709 { 1645 {
1710 (yyval.data) = empty_data; 1646 (yyval.data) = empty_data;
1711 ;} 1647 ;}
@@ -1713,8 +1649,6 @@ yyreduce:
1713 1649
1714 case 33: 1650 case 33:
1715 1651
1716/* Line 1455 of yacc.c */
1717#line 276 "dtc-parser.y"
1718 { 1652 {
1719 (yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte)); 1653 (yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte));
1720 ;} 1654 ;}
@@ -1722,8 +1656,6 @@ yyreduce:
1722 1656
1723 case 34: 1657 case 34:
1724 1658
1725/* Line 1455 of yacc.c */
1726#line 280 "dtc-parser.y"
1727 { 1659 {
1728 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref)); 1660 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1729 ;} 1661 ;}
@@ -1731,8 +1663,6 @@ yyreduce:
1731 1663
1732 case 35: 1664 case 35:
1733 1665
1734/* Line 1455 of yacc.c */
1735#line 287 "dtc-parser.y"
1736 { 1666 {
1737 (yyval.nodelist) = NULL; 1667 (yyval.nodelist) = NULL;
1738 ;} 1668 ;}
@@ -1740,8 +1670,6 @@ yyreduce:
1740 1670
1741 case 36: 1671 case 36:
1742 1672
1743/* Line 1455 of yacc.c */
1744#line 291 "dtc-parser.y"
1745 { 1673 {
1746 (yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist)); 1674 (yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist));
1747 ;} 1675 ;}
@@ -1749,8 +1677,6 @@ yyreduce:
1749 1677
1750 case 37: 1678 case 37:
1751 1679
1752/* Line 1455 of yacc.c */
1753#line 295 "dtc-parser.y"
1754 { 1680 {
1755 print_error("syntax error: properties must precede subnodes"); 1681 print_error("syntax error: properties must precede subnodes");
1756 YYERROR; 1682 YYERROR;
@@ -1759,8 +1685,6 @@ yyreduce:
1759 1685
1760 case 38: 1686 case 38:
1761 1687
1762/* Line 1455 of yacc.c */
1763#line 303 "dtc-parser.y"
1764 { 1688 {
1765 (yyval.node) = name_node((yyvsp[(2) - (2)].node), (yyvsp[(1) - (2)].propnodename)); 1689 (yyval.node) = name_node((yyvsp[(2) - (2)].node), (yyvsp[(1) - (2)].propnodename));
1766 ;} 1690 ;}
@@ -1768,8 +1692,6 @@ yyreduce:
1768 1692
1769 case 39: 1693 case 39:
1770 1694
1771/* Line 1455 of yacc.c */
1772#line 307 "dtc-parser.y"
1773 { 1695 {
1774 add_label(&(yyvsp[(2) - (2)].node)->labels, (yyvsp[(1) - (2)].labelref)); 1696 add_label(&(yyvsp[(2) - (2)].node)->labels, (yyvsp[(1) - (2)].labelref));
1775 (yyval.node) = (yyvsp[(2) - (2)].node); 1697 (yyval.node) = (yyvsp[(2) - (2)].node);
@@ -1778,8 +1700,6 @@ yyreduce:
1778 1700
1779 1701
1780 1702
1781/* Line 1455 of yacc.c */
1782#line 1783 "dtc-parser.tab.c"
1783 default: break; 1703 default: break;
1784 } 1704 }
1785 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 1705 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -1990,8 +1910,6 @@ yyreturn:
1990 1910
1991 1911
1992 1912
1993/* Line 1675 of yacc.c */
1994#line 313 "dtc-parser.y"
1995 1913
1996 1914
1997void print_error(char const *fmt, ...) 1915void print_error(char const *fmt, ...)
diff --git a/scripts/dtc/dtc-parser.tab.h_shipped b/scripts/dtc/dtc-parser.tab.h_shipped
index 95c9547adea5..4ee682bb7d33 100644
--- a/scripts/dtc/dtc-parser.tab.h_shipped
+++ b/scripts/dtc/dtc-parser.tab.h_shipped
@@ -1,10 +1,9 @@
1 1/* A Bison parser, made by GNU Bison 2.4.3. */
2/* A Bison parser, made by GNU Bison 2.4.1. */
3 2
4/* Skeleton interface for Bison's Yacc-like parsers in C 3/* Skeleton interface for Bison's Yacc-like parsers in C
5 4
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
7 Free Software Foundation, Inc. 6 2009, 2010 Free Software Foundation, Inc.
8 7
9 This program is free software: you can redistribute it and/or modify 8 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
@@ -58,8 +57,6 @@
58typedef union YYSTYPE 57typedef union YYSTYPE
59{ 58{
60 59
61/* Line 1676 of yacc.c */
62#line 39 "dtc-parser.y"
63 60
64 char *propnodename; 61 char *propnodename;
65 char *literal; 62 char *literal;
@@ -78,8 +75,6 @@ typedef union YYSTYPE
78 75
79 76
80 77
81/* Line 1676 of yacc.c */
82#line 83 "dtc-parser.tab.h"
83} YYSTYPE; 78} YYSTYPE;
84# define YYSTYPE_IS_TRIVIAL 1 79# define YYSTYPE_IS_TRIVIAL 1
85# define yystype YYSTYPE /* obsolescent; will be withdrawn */ 80# define yystype YYSTYPE /* obsolescent; will be withdrawn */
diff --git a/scripts/gcc-goto.sh b/scripts/gcc-goto.sh
index 520d16b1ffaf..98cffcb941ea 100644
--- a/scripts/gcc-goto.sh
+++ b/scripts/gcc-goto.sh
@@ -1,5 +1,5 @@
1#!/bin/sh 1#!/bin/sh
2# Test for gcc 'asm goto' suport 2# Test for gcc 'asm goto' support
3# Copyright (C) 2010, Jason Baron <jbaron@redhat.com> 3# Copyright (C) 2010, Jason Baron <jbaron@redhat.com>
4 4
5echo "int main(void) { entry: asm goto (\"\"::::entry); return 0; }" | $@ -x c - -c -o /dev/null >/dev/null 2>&1 && echo "y" 5echo "int main(void) { entry: asm goto (\"\"::::entry); return 0; }" | $@ -x c - -c -o /dev/null >/dev/null 2>&1 && echo "y"
diff --git a/scripts/genksyms/.gitignore b/scripts/genksyms/.gitignore
index be5cadb1b907..86dc07a01b43 100644
--- a/scripts/genksyms/.gitignore
+++ b/scripts/genksyms/.gitignore
@@ -1,4 +1,5 @@
1keywords.c 1*.hash.c
2lex.c 2*.lex.c
3parse.[ch] 3*.tab.c
4*.tab.h
4genksyms 5genksyms
diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile
index 13d03cf05d95..a5510903e874 100644
--- a/scripts/genksyms/Makefile
+++ b/scripts/genksyms/Makefile
@@ -2,52 +2,12 @@
2hostprogs-y := genksyms 2hostprogs-y := genksyms
3always := $(hostprogs-y) 3always := $(hostprogs-y)
4 4
5genksyms-objs := genksyms.o parse.o lex.o 5genksyms-objs := genksyms.o parse.tab.o lex.lex.o
6 6
7# -I needed for generated C source (shipped source) 7# -I needed for generated C source (shipped source)
8HOSTCFLAGS_parse.o := -Wno-uninitialized -I$(src) 8HOSTCFLAGS_parse.tab.o := -I$(src)
9HOSTCFLAGS_lex.lex.o := -I$(src)
9 10
10# dependencies on generated files need to be listed explicitly 11# dependencies on generated files need to be listed explicitly
11$(obj)/lex.o: $(obj)/parse.h $(obj)/keywords.c 12$(obj)/lex.lex.o: $(obj)/keywords.hash.c $(obj)/parse.tab.h
12 13
13# -I needed for generated C source (shipped source)
14HOSTCFLAGS_lex.o := -I$(src)
15
16ifdef GENERATE_PARSER
17
18# gperf
19
20quiet_cmd_keywords.c = GPERF $@
21 cmd_keywords.c = gperf -L ANSI-C -a -C -E -g -H is_reserved_hash \
22 -k 1,3,$$ -N is_reserved_word -p -t $< > $@
23
24$(obj)/keywords.c: $(obj)/keywords.gperf FORCE
25 $(call if_changed,keywords.c)
26 cp $@ $@_shipped
27
28# flex
29
30quiet_cmd_lex.c = FLEX $@
31 cmd_lex.c = flex -o$@ -d $<
32
33$(obj)/lex.c: $(obj)/lex.l $(obj)/keywords.c FORCE
34 $(call if_changed,lex.c)
35 cp $@ $@_shipped
36
37# bison
38
39quiet_cmd_parse.c = BISON $@
40 cmd_parse.c = bison -o$@ -dtv $(filter-out FORCE,$^)
41
42$(obj)/parse.c: $(obj)/parse.y FORCE
43 $(call if_changed,parse.c)
44 cp $@ $@_shipped
45 cp $(@:.c=.h) $(@:.c=.h)_shipped
46
47$(obj)/parse.h: $(obj)/parse.c ;
48
49clean-files += parse.output
50
51endif
52
53targets += keywords.c lex.c parse.c parse.h
diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c
index f9e75531ea03..6d3fda0ce2ae 100644
--- a/scripts/genksyms/genksyms.c
+++ b/scripts/genksyms/genksyms.c
@@ -448,7 +448,7 @@ static struct string_list *read_node(FILE *f)
448 node.string = buffer; 448 node.string = buffer;
449 449
450 if (node.string[1] == '#') { 450 if (node.string[1] == '#') {
451 int n; 451 size_t n;
452 452
453 for (n = 0; n < ARRAY_SIZE(symbol_types); n++) { 453 for (n = 0; n < ARRAY_SIZE(symbol_types); n++) {
454 if (node.string[0] == symbol_types[n].n) { 454 if (node.string[0] == symbol_types[n].n) {
diff --git a/scripts/genksyms/keywords.gperf b/scripts/genksyms/keywords.gperf
index e6349acb6f2f..3e77a943e7b7 100644
--- a/scripts/genksyms/keywords.gperf
+++ b/scripts/genksyms/keywords.gperf
@@ -1,3 +1,6 @@
1%language=ANSI-C
2%define hash-function-name is_reserved_hash
3%define lookup-function-name is_reserved_word
1%{ 4%{
2struct resword; 5struct resword;
3static const struct resword *is_reserved_word(register const char *str, register unsigned int len); 6static const struct resword *is_reserved_word(register const char *str, register unsigned int len);
diff --git a/scripts/genksyms/keywords.c_shipped b/scripts/genksyms/keywords.hash.c_shipped
index 8060e06798b3..82062607e8c0 100644
--- a/scripts/genksyms/keywords.c_shipped
+++ b/scripts/genksyms/keywords.hash.c_shipped
@@ -1,5 +1,5 @@
1/* ANSI-C code produced by gperf version 3.0.4 */ 1/* ANSI-C code produced by gperf version 3.0.4 */
2/* Command-line: gperf -L ANSI-C -a -C -E -g -H is_reserved_hash -k '1,3,$' -N is_reserved_word -p -t scripts/genksyms/keywords.gperf */ 2/* Command-line: gperf -t --output-file scripts/genksyms/keywords.hash.c_shipped -a -C -E -g -k '1,3,$' -p -t scripts/genksyms/keywords.gperf */
3 3
4#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ 4#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
5 && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ 5 && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
@@ -28,11 +28,11 @@
28#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>." 28#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
29#endif 29#endif
30 30
31#line 1 "scripts/genksyms/keywords.gperf" 31#line 4 "scripts/genksyms/keywords.gperf"
32 32
33struct resword; 33struct resword;
34static const struct resword *is_reserved_word(register const char *str, register unsigned int len); 34static const struct resword *is_reserved_word(register const char *str, register unsigned int len);
35#line 5 "scripts/genksyms/keywords.gperf" 35#line 8 "scripts/genksyms/keywords.gperf"
36struct resword { const char *name; int token; }; 36struct resword { const char *name; int token; };
37/* maximum key range = 64, duplicates = 0 */ 37/* maximum key range = 64, duplicates = 0 */
38 38
@@ -99,108 +99,108 @@ is_reserved_word (register const char *str, register unsigned int len)
99 static const struct resword wordlist[] = 99 static const struct resword wordlist[] =
100 { 100 {
101 {""}, {""}, {""}, 101 {""}, {""}, {""},
102#line 30 "scripts/genksyms/keywords.gperf" 102#line 33 "scripts/genksyms/keywords.gperf"
103 {"asm", ASM_KEYW}, 103 {"asm", ASM_KEYW},
104 {""}, 104 {""},
105#line 12 "scripts/genksyms/keywords.gperf" 105#line 15 "scripts/genksyms/keywords.gperf"
106 {"__asm", ASM_KEYW}, 106 {"__asm", ASM_KEYW},
107 {""}, 107 {""},
108#line 13 "scripts/genksyms/keywords.gperf" 108#line 16 "scripts/genksyms/keywords.gperf"
109 {"__asm__", ASM_KEYW}, 109 {"__asm__", ASM_KEYW},
110 {""}, {""}, 110 {""}, {""},
111#line 56 "scripts/genksyms/keywords.gperf" 111#line 59 "scripts/genksyms/keywords.gperf"
112 {"__typeof__", TYPEOF_KEYW}, 112 {"__typeof__", TYPEOF_KEYW},
113 {""}, 113 {""},
114#line 16 "scripts/genksyms/keywords.gperf" 114#line 19 "scripts/genksyms/keywords.gperf"
115 {"__const", CONST_KEYW}, 115 {"__const", CONST_KEYW},
116#line 15 "scripts/genksyms/keywords.gperf" 116#line 18 "scripts/genksyms/keywords.gperf"
117 {"__attribute__", ATTRIBUTE_KEYW}, 117 {"__attribute__", ATTRIBUTE_KEYW},
118#line 17 "scripts/genksyms/keywords.gperf" 118#line 20 "scripts/genksyms/keywords.gperf"
119 {"__const__", CONST_KEYW}, 119 {"__const__", CONST_KEYW},
120#line 22 "scripts/genksyms/keywords.gperf" 120#line 25 "scripts/genksyms/keywords.gperf"
121 {"__signed__", SIGNED_KEYW}, 121 {"__signed__", SIGNED_KEYW},
122#line 48 "scripts/genksyms/keywords.gperf" 122#line 51 "scripts/genksyms/keywords.gperf"
123 {"static", STATIC_KEYW}, 123 {"static", STATIC_KEYW},
124 {""}, 124 {""},
125#line 43 "scripts/genksyms/keywords.gperf" 125#line 46 "scripts/genksyms/keywords.gperf"
126 {"int", INT_KEYW}, 126 {"int", INT_KEYW},
127#line 36 "scripts/genksyms/keywords.gperf" 127#line 39 "scripts/genksyms/keywords.gperf"
128 {"char", CHAR_KEYW}, 128 {"char", CHAR_KEYW},
129#line 37 "scripts/genksyms/keywords.gperf" 129#line 40 "scripts/genksyms/keywords.gperf"
130 {"const", CONST_KEYW}, 130 {"const", CONST_KEYW},
131#line 49 "scripts/genksyms/keywords.gperf" 131#line 52 "scripts/genksyms/keywords.gperf"
132 {"struct", STRUCT_KEYW}, 132 {"struct", STRUCT_KEYW},
133#line 28 "scripts/genksyms/keywords.gperf" 133#line 31 "scripts/genksyms/keywords.gperf"
134 {"__restrict__", RESTRICT_KEYW}, 134 {"__restrict__", RESTRICT_KEYW},
135#line 29 "scripts/genksyms/keywords.gperf" 135#line 32 "scripts/genksyms/keywords.gperf"
136 {"restrict", RESTRICT_KEYW}, 136 {"restrict", RESTRICT_KEYW},
137#line 9 "scripts/genksyms/keywords.gperf" 137#line 12 "scripts/genksyms/keywords.gperf"
138 {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW}, 138 {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW},
139#line 20 "scripts/genksyms/keywords.gperf" 139#line 23 "scripts/genksyms/keywords.gperf"
140 {"__inline__", INLINE_KEYW}, 140 {"__inline__", INLINE_KEYW},
141 {""}, 141 {""},
142#line 24 "scripts/genksyms/keywords.gperf" 142#line 27 "scripts/genksyms/keywords.gperf"
143 {"__volatile__", VOLATILE_KEYW}, 143 {"__volatile__", VOLATILE_KEYW},
144#line 7 "scripts/genksyms/keywords.gperf" 144#line 10 "scripts/genksyms/keywords.gperf"
145 {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW}, 145 {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW},
146#line 27 "scripts/genksyms/keywords.gperf" 146#line 30 "scripts/genksyms/keywords.gperf"
147 {"_restrict", RESTRICT_KEYW}, 147 {"_restrict", RESTRICT_KEYW},
148 {""}, 148 {""},
149#line 14 "scripts/genksyms/keywords.gperf" 149#line 17 "scripts/genksyms/keywords.gperf"
150 {"__attribute", ATTRIBUTE_KEYW}, 150 {"__attribute", ATTRIBUTE_KEYW},
151#line 8 "scripts/genksyms/keywords.gperf" 151#line 11 "scripts/genksyms/keywords.gperf"
152 {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, 152 {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW},
153#line 18 "scripts/genksyms/keywords.gperf" 153#line 21 "scripts/genksyms/keywords.gperf"
154 {"__extension__", EXTENSION_KEYW}, 154 {"__extension__", EXTENSION_KEYW},
155#line 39 "scripts/genksyms/keywords.gperf" 155#line 42 "scripts/genksyms/keywords.gperf"
156 {"enum", ENUM_KEYW}, 156 {"enum", ENUM_KEYW},
157#line 10 "scripts/genksyms/keywords.gperf" 157#line 13 "scripts/genksyms/keywords.gperf"
158 {"EXPORT_UNUSED_SYMBOL", EXPORT_SYMBOL_KEYW}, 158 {"EXPORT_UNUSED_SYMBOL", EXPORT_SYMBOL_KEYW},
159#line 40 "scripts/genksyms/keywords.gperf" 159#line 43 "scripts/genksyms/keywords.gperf"
160 {"extern", EXTERN_KEYW}, 160 {"extern", EXTERN_KEYW},
161 {""}, 161 {""},
162#line 21 "scripts/genksyms/keywords.gperf" 162#line 24 "scripts/genksyms/keywords.gperf"
163 {"__signed", SIGNED_KEYW}, 163 {"__signed", SIGNED_KEYW},
164#line 11 "scripts/genksyms/keywords.gperf" 164#line 14 "scripts/genksyms/keywords.gperf"
165 {"EXPORT_UNUSED_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, 165 {"EXPORT_UNUSED_SYMBOL_GPL", EXPORT_SYMBOL_KEYW},
166#line 51 "scripts/genksyms/keywords.gperf" 166#line 54 "scripts/genksyms/keywords.gperf"
167 {"union", UNION_KEYW}, 167 {"union", UNION_KEYW},
168#line 55 "scripts/genksyms/keywords.gperf" 168#line 58 "scripts/genksyms/keywords.gperf"
169 {"typeof", TYPEOF_KEYW}, 169 {"typeof", TYPEOF_KEYW},
170#line 50 "scripts/genksyms/keywords.gperf" 170#line 53 "scripts/genksyms/keywords.gperf"
171 {"typedef", TYPEDEF_KEYW}, 171 {"typedef", TYPEDEF_KEYW},
172#line 19 "scripts/genksyms/keywords.gperf" 172#line 22 "scripts/genksyms/keywords.gperf"
173 {"__inline", INLINE_KEYW}, 173 {"__inline", INLINE_KEYW},
174#line 35 "scripts/genksyms/keywords.gperf" 174#line 38 "scripts/genksyms/keywords.gperf"
175 {"auto", AUTO_KEYW}, 175 {"auto", AUTO_KEYW},
176#line 23 "scripts/genksyms/keywords.gperf" 176#line 26 "scripts/genksyms/keywords.gperf"
177 {"__volatile", VOLATILE_KEYW}, 177 {"__volatile", VOLATILE_KEYW},
178 {""}, {""}, 178 {""}, {""},
179#line 52 "scripts/genksyms/keywords.gperf" 179#line 55 "scripts/genksyms/keywords.gperf"
180 {"unsigned", UNSIGNED_KEYW}, 180 {"unsigned", UNSIGNED_KEYW},
181 {""}, 181 {""},
182#line 46 "scripts/genksyms/keywords.gperf" 182#line 49 "scripts/genksyms/keywords.gperf"
183 {"short", SHORT_KEYW}, 183 {"short", SHORT_KEYW},
184#line 42 "scripts/genksyms/keywords.gperf" 184#line 45 "scripts/genksyms/keywords.gperf"
185 {"inline", INLINE_KEYW}, 185 {"inline", INLINE_KEYW},
186 {""}, 186 {""},
187#line 54 "scripts/genksyms/keywords.gperf" 187#line 57 "scripts/genksyms/keywords.gperf"
188 {"volatile", VOLATILE_KEYW}, 188 {"volatile", VOLATILE_KEYW},
189#line 44 "scripts/genksyms/keywords.gperf" 189#line 47 "scripts/genksyms/keywords.gperf"
190 {"long", LONG_KEYW}, 190 {"long", LONG_KEYW},
191#line 26 "scripts/genksyms/keywords.gperf" 191#line 29 "scripts/genksyms/keywords.gperf"
192 {"_Bool", BOOL_KEYW}, 192 {"_Bool", BOOL_KEYW},
193 {""}, {""}, 193 {""}, {""},
194#line 45 "scripts/genksyms/keywords.gperf" 194#line 48 "scripts/genksyms/keywords.gperf"
195 {"register", REGISTER_KEYW}, 195 {"register", REGISTER_KEYW},
196#line 53 "scripts/genksyms/keywords.gperf" 196#line 56 "scripts/genksyms/keywords.gperf"
197 {"void", VOID_KEYW}, 197 {"void", VOID_KEYW},
198#line 41 "scripts/genksyms/keywords.gperf" 198#line 44 "scripts/genksyms/keywords.gperf"
199 {"float", FLOAT_KEYW}, 199 {"float", FLOAT_KEYW},
200#line 38 "scripts/genksyms/keywords.gperf" 200#line 41 "scripts/genksyms/keywords.gperf"
201 {"double", DOUBLE_KEYW}, 201 {"double", DOUBLE_KEYW},
202 {""}, {""}, {""}, {""}, 202 {""}, {""}, {""}, {""},
203#line 47 "scripts/genksyms/keywords.gperf" 203#line 50 "scripts/genksyms/keywords.gperf"
204 {"signed", SIGNED_KEYW} 204 {"signed", SIGNED_KEYW}
205 }; 205 };
206 206
diff --git a/scripts/genksyms/lex.l b/scripts/genksyms/lex.l
index e4ddd493fec3..400ae06a70df 100644
--- a/scripts/genksyms/lex.l
+++ b/scripts/genksyms/lex.l
@@ -29,7 +29,7 @@
29#include <ctype.h> 29#include <ctype.h>
30 30
31#include "genksyms.h" 31#include "genksyms.h"
32#include "parse.h" 32#include "parse.tab.h"
33 33
34/* We've got a two-level lexer here. We let flex do basic tokenization 34/* We've got a two-level lexer here. We let flex do basic tokenization
35 and then we categorize those basic tokens in the second stage. */ 35 and then we categorize those basic tokens in the second stage. */
@@ -94,7 +94,7 @@ MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>)
94 94
95/* Bring in the keyword recognizer. */ 95/* Bring in the keyword recognizer. */
96 96
97#include "keywords.c" 97#include "keywords.hash.c"
98 98
99 99
100/* Macros to append to our phrase collection list. */ 100/* Macros to append to our phrase collection list. */
diff --git a/scripts/genksyms/lex.c_shipped b/scripts/genksyms/lex.lex.c_shipped
index af4939041e4b..c83cf60410be 100644
--- a/scripts/genksyms/lex.c_shipped
+++ b/scripts/genksyms/lex.lex.c_shipped
@@ -1,20 +1,10 @@
1#line 2 "scripts/genksyms/lex.c"
2 1
3#line 4 "scripts/genksyms/lex.c" 2#line 3 "scripts/genksyms/lex.lex.c_shipped"
4 3
5#define YY_INT_ALIGNED short int 4#define YY_INT_ALIGNED short int
6 5
7/* A lexical scanner generated by flex */ 6/* A lexical scanner generated by flex */
8 7
9/* %not-for-header */
10
11/* %if-c-only */
12/* %if-not-reentrant */
13
14/* %endif */
15/* %endif */
16/* %ok-for-header */
17
18#define FLEX_SCANNER 8#define FLEX_SCANNER
19#define YY_FLEX_MAJOR_VERSION 2 9#define YY_FLEX_MAJOR_VERSION 2
20#define YY_FLEX_MINOR_VERSION 5 10#define YY_FLEX_MINOR_VERSION 5
@@ -23,32 +13,16 @@
23#define FLEX_BETA 13#define FLEX_BETA
24#endif 14#endif
25 15
26/* %if-c++-only */
27/* %endif */
28
29/* %if-c-only */
30
31/* %endif */
32
33/* %if-c-only */
34
35/* %endif */
36
37/* First, we deal with platform-specific or compiler-specific issues. */ 16/* First, we deal with platform-specific or compiler-specific issues. */
38 17
39/* begin standard C headers. */ 18/* begin standard C headers. */
40/* %if-c-only */
41#include <stdio.h> 19#include <stdio.h>
42#include <string.h> 20#include <string.h>
43#include <errno.h> 21#include <errno.h>
44#include <stdlib.h> 22#include <stdlib.h>
45/* %endif */
46 23
47/* %if-tables-serialization */
48/* %endif */
49/* end standard C headers. */ 24/* end standard C headers. */
50 25
51/* %if-c-or-c++ */
52/* flex integer type definitions */ 26/* flex integer type definitions */
53 27
54#ifndef FLEXINT_H 28#ifndef FLEXINT_H
@@ -112,11 +86,6 @@ typedef unsigned int flex_uint32_t;
112 86
113#endif /* ! FLEXINT_H */ 87#endif /* ! FLEXINT_H */
114 88
115/* %endif */
116
117/* %if-c++-only */
118/* %endif */
119
120#ifdef __cplusplus 89#ifdef __cplusplus
121 90
122/* The "const" storage-class-modifier is valid. */ 91/* The "const" storage-class-modifier is valid. */
@@ -138,13 +107,8 @@ typedef unsigned int flex_uint32_t;
138#define yyconst 107#define yyconst
139#endif 108#endif
140 109
141/* %not-for-header */
142
143/* Returned upon end-of-file. */ 110/* Returned upon end-of-file. */
144#define YY_NULL 0 111#define YY_NULL 0
145/* %ok-for-header */
146
147/* %not-for-header */
148 112
149/* Promotes a possibly negative, possibly signed char to an unsigned 113/* Promotes a possibly negative, possibly signed char to an unsigned
150 * integer for use as an array index. If the signed char is negative, 114 * integer for use as an array index. If the signed char is negative,
@@ -152,14 +116,6 @@ typedef unsigned int flex_uint32_t;
152 * double cast. 116 * double cast.
153 */ 117 */
154#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 118#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
155/* %ok-for-header */
156
157/* %if-reentrant */
158/* %endif */
159
160/* %if-not-reentrant */
161
162/* %endif */
163 119
164/* Enter a start condition. This macro really ought to take a parameter, 120/* Enter a start condition. This macro really ought to take a parameter,
165 * but we do it the disgusting crufty way forced on us by the ()-less 121 * but we do it the disgusting crufty way forced on us by the ()-less
@@ -196,15 +152,9 @@ typedef unsigned int flex_uint32_t;
196typedef struct yy_buffer_state *YY_BUFFER_STATE; 152typedef struct yy_buffer_state *YY_BUFFER_STATE;
197#endif 153#endif
198 154
199/* %if-not-reentrant */
200extern int yyleng; 155extern int yyleng;
201/* %endif */
202 156
203/* %if-c-only */
204/* %if-not-reentrant */
205extern FILE *yyin, *yyout; 157extern FILE *yyin, *yyout;
206/* %endif */
207/* %endif */
208 158
209#define EOB_ACT_CONTINUE_SCAN 0 159#define EOB_ACT_CONTINUE_SCAN 0
210#define EOB_ACT_END_OF_FILE 1 160#define EOB_ACT_END_OF_FILE 1
@@ -237,12 +187,7 @@ typedef size_t yy_size_t;
237#define YY_STRUCT_YY_BUFFER_STATE 187#define YY_STRUCT_YY_BUFFER_STATE
238struct yy_buffer_state 188struct yy_buffer_state
239 { 189 {
240/* %if-c-only */
241 FILE *yy_input_file; 190 FILE *yy_input_file;
242/* %endif */
243
244/* %if-c++-only */
245/* %endif */
246 191
247 char *yy_ch_buf; /* input buffer */ 192 char *yy_ch_buf; /* input buffer */
248 char *yy_buf_pos; /* current position in input buffer */ 193 char *yy_buf_pos; /* current position in input buffer */
@@ -303,19 +248,10 @@ struct yy_buffer_state
303 }; 248 };
304#endif /* !YY_STRUCT_YY_BUFFER_STATE */ 249#endif /* !YY_STRUCT_YY_BUFFER_STATE */
305 250
306/* %if-c-only Standard (non-C++) definition */
307/* %not-for-header */
308
309/* %if-not-reentrant */
310
311/* Stack of input buffers. */ 251/* Stack of input buffers. */
312static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ 252static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
313static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ 253static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
314static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ 254static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
315/* %endif */
316/* %ok-for-header */
317
318/* %endif */
319 255
320/* We provide macros for accessing buffer states in case in the 256/* We provide macros for accessing buffer states in case in the
321 * future we want to put the buffer states in a more general 257 * future we want to put the buffer states in a more general
@@ -332,11 +268,6 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
332 */ 268 */
333#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 269#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
334 270
335/* %if-c-only Standard (non-C++) definition */
336
337/* %if-not-reentrant */
338/* %not-for-header */
339
340/* yy_hold_char holds the character lost when yytext is formed. */ 271/* yy_hold_char holds the character lost when yytext is formed. */
341static char yy_hold_char; 272static char yy_hold_char;
342static int yy_n_chars; /* number of characters read into yy_ch_buf */ 273static int yy_n_chars; /* number of characters read into yy_ch_buf */
@@ -351,9 +282,6 @@ static int yy_start = 0; /* start state number */
351 * instead of setting up a fresh yyin. A bit of a hack ... 282 * instead of setting up a fresh yyin. A bit of a hack ...
352 */ 283 */
353static int yy_did_buffer_switch_on_eof; 284static int yy_did_buffer_switch_on_eof;
354/* %ok-for-header */
355
356/* %endif */
357 285
358void yyrestart (FILE *input_file ); 286void yyrestart (FILE *input_file );
359void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); 287void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
@@ -373,8 +301,6 @@ YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
373YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); 301YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
374YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); 302YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
375 303
376/* %endif */
377
378void *yyalloc (yy_size_t ); 304void *yyalloc (yy_size_t );
379void *yyrealloc (void *,yy_size_t ); 305void *yyrealloc (void *,yy_size_t );
380void yyfree (void * ); 306void yyfree (void * );
@@ -403,14 +329,11 @@ void yyfree (void * );
403 329
404#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 330#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
405 331
406/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
407/* Begin user sect3 */ 332/* Begin user sect3 */
408 333
409#define yywrap(n) 1 334#define yywrap(n) 1
410#define YY_SKIP_YYWRAP 335#define YY_SKIP_YYWRAP
411 336
412#define FLEX_DEBUG
413
414typedef unsigned char YY_CHAR; 337typedef unsigned char YY_CHAR;
415 338
416FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 339FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
@@ -424,28 +347,21 @@ int yylineno = 1;
424extern char *yytext; 347extern char *yytext;
425#define yytext_ptr yytext 348#define yytext_ptr yytext
426 349
427/* %if-c-only Standard (non-C++) definition */
428
429static yy_state_type yy_get_previous_state (void ); 350static yy_state_type yy_get_previous_state (void );
430static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); 351static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
431static int yy_get_next_buffer (void ); 352static int yy_get_next_buffer (void );
432static void yy_fatal_error (yyconst char msg[] ); 353static void yy_fatal_error (yyconst char msg[] );
433 354
434/* %endif */
435
436/* Done after the current pattern has been matched and before the 355/* Done after the current pattern has been matched and before the
437 * corresponding action - sets up yytext. 356 * corresponding action - sets up yytext.
438 */ 357 */
439#define YY_DO_BEFORE_ACTION \ 358#define YY_DO_BEFORE_ACTION \
440 (yytext_ptr) = yy_bp; \ 359 (yytext_ptr) = yy_bp; \
441/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
442 yyleng = (size_t) (yy_cp - yy_bp); \ 360 yyleng = (size_t) (yy_cp - yy_bp); \
443 (yy_hold_char) = *yy_cp; \ 361 (yy_hold_char) = *yy_cp; \
444 *yy_cp = '\0'; \ 362 *yy_cp = '\0'; \
445/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
446 (yy_c_buf_p) = yy_cp; 363 (yy_c_buf_p) = yy_cp;
447 364
448/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
449#define YY_NUM_RULES 13 365#define YY_NUM_RULES 13
450#define YY_END_OF_BUFFER 14 366#define YY_END_OF_BUFFER 14
451/* This struct is not used in this scanner, 367/* This struct is not used in this scanner,
@@ -610,13 +526,7 @@ static yy_state_type yy_last_accepting_state;
610static char *yy_last_accepting_cpos; 526static char *yy_last_accepting_cpos;
611 527
612extern int yy_flex_debug; 528extern int yy_flex_debug;
613int yy_flex_debug = 1; 529int yy_flex_debug = 0;
614
615static yyconst flex_int16_t yy_rule_linenum[13] =
616 { 0,
617 67, 68, 69, 72, 75, 76, 77, 83, 84, 85,
618 87, 90
619 } ;
620 530
621/* The intent behind this definition is that it'll catch 531/* The intent behind this definition is that it'll catch
622 * any uses of REJECT which flex missed. 532 * any uses of REJECT which flex missed.
@@ -626,7 +536,6 @@ static yyconst flex_int16_t yy_rule_linenum[13] =
626#define YY_MORE_ADJ 0 536#define YY_MORE_ADJ 0
627#define YY_RESTORE_YY_MORE_OFFSET 537#define YY_RESTORE_YY_MORE_OFFSET
628char *yytext; 538char *yytext;
629#line 1 "scripts/genksyms/lex.l"
630/* Lexical analysis for genksyms. 539/* Lexical analysis for genksyms.
631 Copyright 1996, 1997 Linux International. 540 Copyright 1996, 1997 Linux International.
632 541
@@ -648,7 +557,6 @@ char *yytext;
648 You should have received a copy of the GNU General Public License 557 You should have received a copy of the GNU General Public License
649 along with this program; if not, write to the Free Software Foundation, 558 along with this program; if not, write to the Free Software Foundation,
650 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 559 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
651#line 25 "scripts/genksyms/lex.l"
652 560
653#include <limits.h> 561#include <limits.h>
654#include <stdlib.h> 562#include <stdlib.h>
@@ -656,7 +564,7 @@ char *yytext;
656#include <ctype.h> 564#include <ctype.h>
657 565
658#include "genksyms.h" 566#include "genksyms.h"
659#include "parse.h" 567#include "parse.tab.h"
660 568
661/* We've got a two-level lexer here. We let flex do basic tokenization 569/* We've got a two-level lexer here. We let flex do basic tokenization
662 and then we categorize those basic tokens in the second stage. */ 570 and then we categorize those basic tokens in the second stage. */
@@ -664,7 +572,6 @@ char *yytext;
664 572
665/* We don't do multiple input files. */ 573/* We don't do multiple input files. */
666#define YY_NO_INPUT 1 574#define YY_NO_INPUT 1
667#line 668 "scripts/genksyms/lex.c"
668 575
669#define INITIAL 0 576#define INITIAL 0
670 577
@@ -673,28 +580,15 @@ char *yytext;
673 * down here because we want the user's section 1 to have been scanned first. 580 * down here because we want the user's section 1 to have been scanned first.
674 * The user has a chance to override it with an option. 581 * The user has a chance to override it with an option.
675 */ 582 */
676/* %if-c-only */
677#include <unistd.h> 583#include <unistd.h>
678/* %endif */
679/* %if-c++-only */
680/* %endif */
681#endif 584#endif
682 585
683#ifndef YY_EXTRA_TYPE 586#ifndef YY_EXTRA_TYPE
684#define YY_EXTRA_TYPE void * 587#define YY_EXTRA_TYPE void *
685#endif 588#endif
686 589
687/* %if-c-only Reentrant structure and macros (non-C++). */
688/* %if-reentrant */
689/* %if-c-only */
690
691static int yy_init_globals (void ); 590static int yy_init_globals (void );
692 591
693/* %endif */
694/* %if-reentrant */
695/* %endif */
696/* %endif End reentrant structures and macros. */
697
698/* Accessor methods to globals. 592/* Accessor methods to globals.
699 These are made visible to non-reentrant scanners for convenience. */ 593 These are made visible to non-reentrant scanners for convenience. */
700 594
@@ -724,9 +618,6 @@ int yyget_lineno (void );
724 618
725void yyset_lineno (int line_number ); 619void yyset_lineno (int line_number );
726 620
727/* %if-bison-bridge */
728/* %endif */
729
730/* Macros after this point can all be overridden by user definitions in 621/* Macros after this point can all be overridden by user definitions in
731 * section 1. 622 * section 1.
732 */ 623 */
@@ -739,14 +630,8 @@ extern int yywrap (void );
739#endif 630#endif
740#endif 631#endif
741 632
742/* %not-for-header */
743
744 static void yyunput (int c,char *buf_ptr ); 633 static void yyunput (int c,char *buf_ptr );
745 634
746/* %ok-for-header */
747
748/* %endif */
749
750#ifndef yytext_ptr 635#ifndef yytext_ptr
751static void yy_flex_strncpy (char *,yyconst char *,int ); 636static void yy_flex_strncpy (char *,yyconst char *,int );
752#endif 637#endif
@@ -756,23 +641,15 @@ static int yy_flex_strlen (yyconst char * );
756#endif 641#endif
757 642
758#ifndef YY_NO_INPUT 643#ifndef YY_NO_INPUT
759/* %if-c-only Standard (non-C++) definition */
760/* %not-for-header */
761 644
762#ifdef __cplusplus 645#ifdef __cplusplus
763static int yyinput (void ); 646static int yyinput (void );
764#else 647#else
765static int input (void ); 648static int input (void );
766#endif 649#endif
767/* %ok-for-header */
768 650
769/* %endif */
770#endif 651#endif
771 652
772/* %if-c-only */
773
774/* %endif */
775
776/* Amount of stuff to slurp up with each read. */ 653/* Amount of stuff to slurp up with each read. */
777#ifndef YY_READ_BUF_SIZE 654#ifndef YY_READ_BUF_SIZE
778#define YY_READ_BUF_SIZE 8192 655#define YY_READ_BUF_SIZE 8192
@@ -780,14 +657,10 @@ static int input (void );
780 657
781/* Copy whatever the last rule matched to the standard output. */ 658/* Copy whatever the last rule matched to the standard output. */
782#ifndef ECHO 659#ifndef ECHO
783/* %if-c-only Standard (non-C++) definition */
784/* This used to be an fputs(), but since the string might contain NUL's, 660/* This used to be an fputs(), but since the string might contain NUL's,
785 * we now use fwrite(). 661 * we now use fwrite().
786 */ 662 */
787#define ECHO fwrite( yytext, yyleng, 1, yyout ) 663#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
788/* %endif */
789/* %if-c++-only C++ definition */
790/* %endif */
791#endif 664#endif
792 665
793/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 666/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -795,11 +668,10 @@ static int input (void );
795 */ 668 */
796#ifndef YY_INPUT 669#ifndef YY_INPUT
797#define YY_INPUT(buf,result,max_size) \ 670#define YY_INPUT(buf,result,max_size) \
798/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
799 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 671 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
800 { \ 672 { \
801 int c = '*'; \ 673 int c = '*'; \
802 int n; \ 674 unsigned n; \
803 for ( n = 0; n < max_size && \ 675 for ( n = 0; n < max_size && \
804 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 676 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
805 buf[n] = (char) c; \ 677 buf[n] = (char) c; \
@@ -824,8 +696,6 @@ static int input (void );
824 } \ 696 } \
825 }\ 697 }\
826\ 698\
827/* %if-c++-only C++ definition \ */\
828/* %endif */
829 699
830#endif 700#endif
831 701
@@ -844,39 +714,20 @@ static int input (void );
844 714
845/* Report a fatal error. */ 715/* Report a fatal error. */
846#ifndef YY_FATAL_ERROR 716#ifndef YY_FATAL_ERROR
847/* %if-c-only */
848#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 717#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
849/* %endif */
850/* %if-c++-only */
851/* %endif */
852#endif 718#endif
853 719
854/* %if-tables-serialization structures and prototypes */
855/* %not-for-header */
856
857/* %ok-for-header */
858
859/* %not-for-header */
860
861/* %tables-yydmap generated elements */
862/* %endif */
863/* end tables serialization structures and prototypes */ 720/* end tables serialization structures and prototypes */
864 721
865/* %ok-for-header */
866
867/* Default declaration of generated scanner - a define so the user can 722/* Default declaration of generated scanner - a define so the user can
868 * easily add parameters. 723 * easily add parameters.
869 */ 724 */
870#ifndef YY_DECL 725#ifndef YY_DECL
871#define YY_DECL_IS_OURS 1 726#define YY_DECL_IS_OURS 1
872/* %if-c-only Standard (non-C++) definition */
873 727
874extern int yylex (void); 728extern int yylex (void);
875 729
876#define YY_DECL int yylex (void) 730#define YY_DECL int yylex (void)
877/* %endif */
878/* %if-c++-only C++ definition */
879/* %endif */
880#endif /* !YY_DECL */ 731#endif /* !YY_DECL */
881 732
882/* Code executed at the beginning of each rule, after yytext and yyleng 733/* Code executed at the beginning of each rule, after yytext and yyleng
@@ -891,15 +742,12 @@ extern int yylex (void);
891#define YY_BREAK break; 742#define YY_BREAK break;
892#endif 743#endif
893 744
894/* %% [6.0] YY_RULE_SETUP definition goes here */
895#define YY_RULE_SETUP \ 745#define YY_RULE_SETUP \
896 if ( yyleng > 0 ) \ 746 if ( yyleng > 0 ) \
897 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ 747 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
898 (yytext[yyleng - 1] == '\n'); \ 748 (yytext[yyleng - 1] == '\n'); \
899 YY_USER_ACTION 749 YY_USER_ACTION
900 750
901/* %not-for-header */
902
903/** The main scanner function which does all the work. 751/** The main scanner function which does all the work.
904 */ 752 */
905YY_DECL 753YY_DECL
@@ -908,13 +756,7 @@ YY_DECL
908 register char *yy_cp, *yy_bp; 756 register char *yy_cp, *yy_bp;
909 register int yy_act; 757 register int yy_act;
910 758
911/* %% [7.0] user's declarations go here */
912#line 63 "scripts/genksyms/lex.l"
913
914
915
916 /* Keep track of our location in the original source files. */ 759 /* Keep track of our location in the original source files. */
917#line 918 "scripts/genksyms/lex.c"
918 760
919 if ( !(yy_init) ) 761 if ( !(yy_init) )
920 { 762 {
@@ -928,18 +770,10 @@ YY_DECL
928 (yy_start) = 1; /* first start state */ 770 (yy_start) = 1; /* first start state */
929 771
930 if ( ! yyin ) 772 if ( ! yyin )
931/* %if-c-only */
932 yyin = stdin; 773 yyin = stdin;
933/* %endif */
934/* %if-c++-only */
935/* %endif */
936 774
937 if ( ! yyout ) 775 if ( ! yyout )
938/* %if-c-only */
939 yyout = stdout; 776 yyout = stdout;
940/* %endif */
941/* %if-c++-only */
942/* %endif */
943 777
944 if ( ! YY_CURRENT_BUFFER ) { 778 if ( ! YY_CURRENT_BUFFER ) {
945 yyensure_buffer_stack (); 779 yyensure_buffer_stack ();
@@ -952,7 +786,6 @@ YY_DECL
952 786
953 while ( 1 ) /* loops until end-of-file is reached */ 787 while ( 1 ) /* loops until end-of-file is reached */
954 { 788 {
955/* %% [8.0] yymore()-related code goes here */
956 yy_cp = (yy_c_buf_p); 789 yy_cp = (yy_c_buf_p);
957 790
958 /* Support of yytext. */ 791 /* Support of yytext. */
@@ -963,7 +796,6 @@ YY_DECL
963 */ 796 */
964 yy_bp = yy_cp; 797 yy_bp = yy_cp;
965 798
966/* %% [9.0] code to set up and find next match goes here */
967 yy_current_state = (yy_start); 799 yy_current_state = (yy_start);
968 yy_current_state += YY_AT_BOL(); 800 yy_current_state += YY_AT_BOL();
969yy_match: 801yy_match:
@@ -987,7 +819,6 @@ yy_match:
987 while ( yy_base[yy_current_state] != 266 ); 819 while ( yy_base[yy_current_state] != 266 );
988 820
989yy_find_action: 821yy_find_action:
990/* %% [10.0] code to find the action number goes here */
991 yy_act = yy_accept[yy_current_state]; 822 yy_act = yy_accept[yy_current_state];
992 if ( yy_act == 0 ) 823 if ( yy_act == 0 )
993 { /* have to back up */ 824 { /* have to back up */
@@ -998,30 +829,10 @@ yy_find_action:
998 829
999 YY_DO_BEFORE_ACTION; 830 YY_DO_BEFORE_ACTION;
1000 831
1001/* %% [11.0] code for yylineno update goes here */
1002
1003do_action: /* This label is used only to access EOF actions. */ 832do_action: /* This label is used only to access EOF actions. */
1004 833
1005/* %% [12.0] debug code goes here */
1006 if ( yy_flex_debug )
1007 {
1008 if ( yy_act == 0 )
1009 fprintf( stderr, "--scanner backing up\n" );
1010 else if ( yy_act < 13 )
1011 fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
1012 (long)yy_rule_linenum[yy_act], yytext );
1013 else if ( yy_act == 13 )
1014 fprintf( stderr, "--accepting default rule (\"%s\")\n",
1015 yytext );
1016 else if ( yy_act == 14 )
1017 fprintf( stderr, "--(end of buffer or a NUL)\n" );
1018 else
1019 fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
1020 }
1021
1022 switch ( yy_act ) 834 switch ( yy_act )
1023 { /* beginning of action switch */ 835 { /* beginning of action switch */
1024/* %% [13.0] actions go here */
1025 case 0: /* must back up */ 836 case 0: /* must back up */
1026 /* undo the effects of YY_DO_BEFORE_ACTION */ 837 /* undo the effects of YY_DO_BEFORE_ACTION */
1027 *yy_cp = (yy_hold_char); 838 *yy_cp = (yy_hold_char);
@@ -1032,42 +843,35 @@ do_action: /* This label is used only to access EOF actions. */
1032case 1: 843case 1:
1033/* rule 1 can match eol */ 844/* rule 1 can match eol */
1034YY_RULE_SETUP 845YY_RULE_SETUP
1035#line 67 "scripts/genksyms/lex.l"
1036return FILENAME; 846return FILENAME;
1037 YY_BREAK 847 YY_BREAK
1038case 2: 848case 2:
1039/* rule 2 can match eol */ 849/* rule 2 can match eol */
1040YY_RULE_SETUP 850YY_RULE_SETUP
1041#line 68 "scripts/genksyms/lex.l"
1042cur_line++; 851cur_line++;
1043 YY_BREAK 852 YY_BREAK
1044case 3: 853case 3:
1045/* rule 3 can match eol */ 854/* rule 3 can match eol */
1046YY_RULE_SETUP 855YY_RULE_SETUP
1047#line 69 "scripts/genksyms/lex.l"
1048cur_line++; 856cur_line++;
1049 YY_BREAK 857 YY_BREAK
1050/* Ignore all other whitespace. */ 858/* Ignore all other whitespace. */
1051case 4: 859case 4:
1052YY_RULE_SETUP 860YY_RULE_SETUP
1053#line 72 "scripts/genksyms/lex.l"
1054; 861;
1055 YY_BREAK 862 YY_BREAK
1056case 5: 863case 5:
1057/* rule 5 can match eol */ 864/* rule 5 can match eol */
1058YY_RULE_SETUP 865YY_RULE_SETUP
1059#line 75 "scripts/genksyms/lex.l"
1060return STRING; 866return STRING;
1061 YY_BREAK 867 YY_BREAK
1062case 6: 868case 6:
1063/* rule 6 can match eol */ 869/* rule 6 can match eol */
1064YY_RULE_SETUP 870YY_RULE_SETUP
1065#line 76 "scripts/genksyms/lex.l"
1066return CHAR; 871return CHAR;
1067 YY_BREAK 872 YY_BREAK
1068case 7: 873case 7:
1069YY_RULE_SETUP 874YY_RULE_SETUP
1070#line 77 "scripts/genksyms/lex.l"
1071return IDENT; 875return IDENT;
1072 YY_BREAK 876 YY_BREAK
1073/* The Pedant requires that the other C multi-character tokens be 877/* The Pedant requires that the other C multi-character tokens be
@@ -1076,36 +880,29 @@ return IDENT;
1076 around them properly. */ 880 around them properly. */
1077case 8: 881case 8:
1078YY_RULE_SETUP 882YY_RULE_SETUP
1079#line 83 "scripts/genksyms/lex.l"
1080return OTHER; 883return OTHER;
1081 YY_BREAK 884 YY_BREAK
1082case 9: 885case 9:
1083YY_RULE_SETUP 886YY_RULE_SETUP
1084#line 84 "scripts/genksyms/lex.l"
1085return INT; 887return INT;
1086 YY_BREAK 888 YY_BREAK
1087case 10: 889case 10:
1088YY_RULE_SETUP 890YY_RULE_SETUP
1089#line 85 "scripts/genksyms/lex.l"
1090return REAL; 891return REAL;
1091 YY_BREAK 892 YY_BREAK
1092case 11: 893case 11:
1093YY_RULE_SETUP 894YY_RULE_SETUP
1094#line 87 "scripts/genksyms/lex.l"
1095return DOTS; 895return DOTS;
1096 YY_BREAK 896 YY_BREAK
1097/* All other tokens are single characters. */ 897/* All other tokens are single characters. */
1098case 12: 898case 12:
1099YY_RULE_SETUP 899YY_RULE_SETUP
1100#line 90 "scripts/genksyms/lex.l"
1101return yytext[0]; 900return yytext[0];
1102 YY_BREAK 901 YY_BREAK
1103case 13: 902case 13:
1104YY_RULE_SETUP 903YY_RULE_SETUP
1105#line 93 "scripts/genksyms/lex.l"
1106ECHO; 904ECHO;
1107 YY_BREAK 905 YY_BREAK
1108#line 1109 "scripts/genksyms/lex.c"
1109case YY_STATE_EOF(INITIAL): 906case YY_STATE_EOF(INITIAL):
1110 yyterminate(); 907 yyterminate();
1111 908
@@ -1172,7 +969,6 @@ case YY_STATE_EOF(INITIAL):
1172 969
1173 else 970 else
1174 { 971 {
1175/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
1176 yy_cp = (yy_c_buf_p); 972 yy_cp = (yy_c_buf_p);
1177 goto yy_find_action; 973 goto yy_find_action;
1178 } 974 }
@@ -1238,14 +1034,6 @@ case YY_STATE_EOF(INITIAL):
1238 } /* end of action switch */ 1034 } /* end of action switch */
1239 } /* end of scanning one token */ 1035 } /* end of scanning one token */
1240} /* end of yylex */ 1036} /* end of yylex */
1241/* %ok-for-header */
1242
1243/* %if-c++-only */
1244/* %not-for-header */
1245
1246/* %ok-for-header */
1247
1248/* %endif */
1249 1037
1250/* yy_get_next_buffer - try to read in a new buffer 1038/* yy_get_next_buffer - try to read in a new buffer
1251 * 1039 *
@@ -1254,11 +1042,7 @@ case YY_STATE_EOF(INITIAL):
1254 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 1042 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1255 * EOB_ACT_END_OF_FILE - end of file 1043 * EOB_ACT_END_OF_FILE - end of file
1256 */ 1044 */
1257/* %if-c-only */
1258static int yy_get_next_buffer (void) 1045static int yy_get_next_buffer (void)
1259/* %endif */
1260/* %if-c++-only */
1261/* %endif */
1262{ 1046{
1263 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 1047 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1264 register char *source = (yytext_ptr); 1048 register char *source = (yytext_ptr);
@@ -1392,24 +1176,16 @@ static int yy_get_next_buffer (void)
1392 1176
1393/* yy_get_previous_state - get the state just before the EOB char was reached */ 1177/* yy_get_previous_state - get the state just before the EOB char was reached */
1394 1178
1395/* %if-c-only */
1396/* %not-for-header */
1397
1398 static yy_state_type yy_get_previous_state (void) 1179 static yy_state_type yy_get_previous_state (void)
1399/* %endif */
1400/* %if-c++-only */
1401/* %endif */
1402{ 1180{
1403 register yy_state_type yy_current_state; 1181 register yy_state_type yy_current_state;
1404 register char *yy_cp; 1182 register char *yy_cp;
1405 1183
1406/* %% [15.0] code to get the start state into yy_current_state goes here */
1407 yy_current_state = (yy_start); 1184 yy_current_state = (yy_start);
1408 yy_current_state += YY_AT_BOL(); 1185 yy_current_state += YY_AT_BOL();
1409 1186
1410 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 1187 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1411 { 1188 {
1412/* %% [16.0] code to find the next state goes here */
1413 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1189 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1414 if ( yy_accept[yy_current_state] ) 1190 if ( yy_accept[yy_current_state] )
1415 { 1191 {
@@ -1433,15 +1209,10 @@ static int yy_get_next_buffer (void)
1433 * synopsis 1209 * synopsis
1434 * next_state = yy_try_NUL_trans( current_state ); 1210 * next_state = yy_try_NUL_trans( current_state );
1435 */ 1211 */
1436/* %if-c-only */
1437 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 1212 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1438/* %endif */
1439/* %if-c++-only */
1440/* %endif */
1441{ 1213{
1442 register int yy_is_jam; 1214 register int yy_is_jam;
1443 /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ 1215 register char *yy_cp = (yy_c_buf_p);
1444 register char *yy_cp = (yy_c_buf_p);
1445 1216
1446 register YY_CHAR yy_c = 1; 1217 register YY_CHAR yy_c = 1;
1447 if ( yy_accept[yy_current_state] ) 1218 if ( yy_accept[yy_current_state] )
@@ -1461,12 +1232,7 @@ static int yy_get_next_buffer (void)
1461 return yy_is_jam ? 0 : yy_current_state; 1232 return yy_is_jam ? 0 : yy_current_state;
1462} 1233}
1463 1234
1464/* %if-c-only */
1465
1466 static void yyunput (int c, register char * yy_bp ) 1235 static void yyunput (int c, register char * yy_bp )
1467/* %endif */
1468/* %if-c++-only */
1469/* %endif */
1470{ 1236{
1471 register char *yy_cp; 1237 register char *yy_cp;
1472 1238
@@ -1498,17 +1264,11 @@ static int yy_get_next_buffer (void)
1498 1264
1499 *--yy_cp = (char) c; 1265 *--yy_cp = (char) c;
1500 1266
1501/* %% [18.0] update yylineno here */
1502
1503 (yytext_ptr) = yy_bp; 1267 (yytext_ptr) = yy_bp;
1504 (yy_hold_char) = *yy_cp; 1268 (yy_hold_char) = *yy_cp;
1505 (yy_c_buf_p) = yy_cp; 1269 (yy_c_buf_p) = yy_cp;
1506} 1270}
1507/* %if-c-only */
1508
1509/* %endif */
1510 1271
1511/* %if-c-only */
1512#ifndef YY_NO_INPUT 1272#ifndef YY_NO_INPUT
1513#ifdef __cplusplus 1273#ifdef __cplusplus
1514 static int yyinput (void) 1274 static int yyinput (void)
@@ -1516,9 +1276,6 @@ static int yy_get_next_buffer (void)
1516 static int input (void) 1276 static int input (void)
1517#endif 1277#endif
1518 1278
1519/* %endif */
1520/* %if-c++-only */
1521/* %endif */
1522{ 1279{
1523 int c; 1280 int c;
1524 1281
@@ -1582,25 +1339,18 @@ static int yy_get_next_buffer (void)
1582 *(yy_c_buf_p) = '\0'; /* preserve yytext */ 1339 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1583 (yy_hold_char) = *++(yy_c_buf_p); 1340 (yy_hold_char) = *++(yy_c_buf_p);
1584 1341
1585/* %% [19.0] update BOL and yylineno */
1586 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); 1342 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1587 1343
1588 return c; 1344 return c;
1589} 1345}
1590/* %if-c-only */
1591#endif /* ifndef YY_NO_INPUT */ 1346#endif /* ifndef YY_NO_INPUT */
1592/* %endif */
1593 1347
1594/** Immediately switch to a different input stream. 1348/** Immediately switch to a different input stream.
1595 * @param input_file A readable stream. 1349 * @param input_file A readable stream.
1596 * 1350 *
1597 * @note This function does not reset the start condition to @c INITIAL . 1351 * @note This function does not reset the start condition to @c INITIAL .
1598 */ 1352 */
1599/* %if-c-only */
1600 void yyrestart (FILE * input_file ) 1353 void yyrestart (FILE * input_file )
1601/* %endif */
1602/* %if-c++-only */
1603/* %endif */
1604{ 1354{
1605 1355
1606 if ( ! YY_CURRENT_BUFFER ){ 1356 if ( ! YY_CURRENT_BUFFER ){
@@ -1617,11 +1367,7 @@ static int yy_get_next_buffer (void)
1617 * @param new_buffer The new input buffer. 1367 * @param new_buffer The new input buffer.
1618 * 1368 *
1619 */ 1369 */
1620/* %if-c-only */
1621 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) 1370 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1622/* %endif */
1623/* %if-c++-only */
1624/* %endif */
1625{ 1371{
1626 1372
1627 /* TODO. We should be able to replace this entire function body 1373 /* TODO. We should be able to replace this entire function body
@@ -1652,11 +1398,7 @@ static int yy_get_next_buffer (void)
1652 (yy_did_buffer_switch_on_eof) = 1; 1398 (yy_did_buffer_switch_on_eof) = 1;
1653} 1399}
1654 1400
1655/* %if-c-only */
1656static void yy_load_buffer_state (void) 1401static void yy_load_buffer_state (void)
1657/* %endif */
1658/* %if-c++-only */
1659/* %endif */
1660{ 1402{
1661 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 1403 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1662 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 1404 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
@@ -1670,11 +1412,7 @@ static void yy_load_buffer_state (void)
1670 * 1412 *
1671 * @return the allocated buffer state. 1413 * @return the allocated buffer state.
1672 */ 1414 */
1673/* %if-c-only */
1674 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) 1415 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1675/* %endif */
1676/* %if-c++-only */
1677/* %endif */
1678{ 1416{
1679 YY_BUFFER_STATE b; 1417 YY_BUFFER_STATE b;
1680 1418
@@ -1702,11 +1440,7 @@ static void yy_load_buffer_state (void)
1702 * @param b a buffer created with yy_create_buffer() 1440 * @param b a buffer created with yy_create_buffer()
1703 * 1441 *
1704 */ 1442 */
1705/* %if-c-only */
1706 void yy_delete_buffer (YY_BUFFER_STATE b ) 1443 void yy_delete_buffer (YY_BUFFER_STATE b )
1707/* %endif */
1708/* %if-c++-only */
1709/* %endif */
1710{ 1444{
1711 1445
1712 if ( ! b ) 1446 if ( ! b )
@@ -1721,26 +1455,15 @@ static void yy_load_buffer_state (void)
1721 yyfree((void *) b ); 1455 yyfree((void *) b );
1722} 1456}
1723 1457
1724/* %if-c-only */
1725
1726#ifndef __cplusplus 1458#ifndef __cplusplus
1727extern int isatty (int ); 1459extern int isatty (int );
1728#endif /* __cplusplus */ 1460#endif /* __cplusplus */
1729 1461
1730/* %endif */
1731
1732/* %if-c++-only */
1733/* %endif */
1734
1735/* Initializes or reinitializes a buffer. 1462/* Initializes or reinitializes a buffer.
1736 * This function is sometimes called more than once on the same buffer, 1463 * This function is sometimes called more than once on the same buffer,
1737 * such as during a yyrestart() or at EOF. 1464 * such as during a yyrestart() or at EOF.
1738 */ 1465 */
1739/* %if-c-only */
1740 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) 1466 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1741/* %endif */
1742/* %if-c++-only */
1743/* %endif */
1744 1467
1745{ 1468{
1746 int oerrno = errno; 1469 int oerrno = errno;
@@ -1759,13 +1482,8 @@ extern int isatty (int );
1759 b->yy_bs_column = 0; 1482 b->yy_bs_column = 0;
1760 } 1483 }
1761 1484
1762/* %if-c-only */
1763
1764 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 1485 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1765 1486
1766/* %endif */
1767/* %if-c++-only */
1768/* %endif */
1769 errno = oerrno; 1487 errno = oerrno;
1770} 1488}
1771 1489
@@ -1773,11 +1491,7 @@ extern int isatty (int );
1773 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. 1491 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1774 * 1492 *
1775 */ 1493 */
1776/* %if-c-only */
1777 void yy_flush_buffer (YY_BUFFER_STATE b ) 1494 void yy_flush_buffer (YY_BUFFER_STATE b )
1778/* %endif */
1779/* %if-c++-only */
1780/* %endif */
1781{ 1495{
1782 if ( ! b ) 1496 if ( ! b )
1783 return; 1497 return;
@@ -1800,18 +1514,13 @@ extern int isatty (int );
1800 yy_load_buffer_state( ); 1514 yy_load_buffer_state( );
1801} 1515}
1802 1516
1803/* %if-c-or-c++ */
1804/** Pushes the new state onto the stack. The new state becomes 1517/** Pushes the new state onto the stack. The new state becomes
1805 * the current state. This function will allocate the stack 1518 * the current state. This function will allocate the stack
1806 * if necessary. 1519 * if necessary.
1807 * @param new_buffer The new state. 1520 * @param new_buffer The new state.
1808 * 1521 *
1809 */ 1522 */
1810/* %if-c-only */
1811void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) 1523void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1812/* %endif */
1813/* %if-c++-only */
1814/* %endif */
1815{ 1524{
1816 if (new_buffer == NULL) 1525 if (new_buffer == NULL)
1817 return; 1526 return;
@@ -1836,18 +1545,12 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1836 yy_load_buffer_state( ); 1545 yy_load_buffer_state( );
1837 (yy_did_buffer_switch_on_eof) = 1; 1546 (yy_did_buffer_switch_on_eof) = 1;
1838} 1547}
1839/* %endif */
1840 1548
1841/* %if-c-or-c++ */
1842/** Removes and deletes the top of the stack, if present. 1549/** Removes and deletes the top of the stack, if present.
1843 * The next element becomes the new top. 1550 * The next element becomes the new top.
1844 * 1551 *
1845 */ 1552 */
1846/* %if-c-only */
1847void yypop_buffer_state (void) 1553void yypop_buffer_state (void)
1848/* %endif */
1849/* %if-c++-only */
1850/* %endif */
1851{ 1554{
1852 if (!YY_CURRENT_BUFFER) 1555 if (!YY_CURRENT_BUFFER)
1853 return; 1556 return;
@@ -1862,17 +1565,11 @@ void yypop_buffer_state (void)
1862 (yy_did_buffer_switch_on_eof) = 1; 1565 (yy_did_buffer_switch_on_eof) = 1;
1863 } 1566 }
1864} 1567}
1865/* %endif */
1866 1568
1867/* %if-c-or-c++ */
1868/* Allocates the stack if it does not exist. 1569/* Allocates the stack if it does not exist.
1869 * Guarantees space for at least one push. 1570 * Guarantees space for at least one push.
1870 */ 1571 */
1871/* %if-c-only */
1872static void yyensure_buffer_stack (void) 1572static void yyensure_buffer_stack (void)
1873/* %endif */
1874/* %if-c++-only */
1875/* %endif */
1876{ 1573{
1877 int num_to_alloc; 1574 int num_to_alloc;
1878 1575
@@ -1914,9 +1611,7 @@ static void yyensure_buffer_stack (void)
1914 (yy_buffer_stack_max) = num_to_alloc; 1611 (yy_buffer_stack_max) = num_to_alloc;
1915 } 1612 }
1916} 1613}
1917/* %endif */
1918 1614
1919/* %if-c-only */
1920/** Setup the input buffer state to scan directly from a user-specified character buffer. 1615/** Setup the input buffer state to scan directly from a user-specified character buffer.
1921 * @param base the character buffer 1616 * @param base the character buffer
1922 * @param size the size in bytes of the character buffer 1617 * @param size the size in bytes of the character buffer
@@ -1951,9 +1646,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1951 1646
1952 return b; 1647 return b;
1953} 1648}
1954/* %endif */
1955 1649
1956/* %if-c-only */
1957/** Setup the input buffer state to scan a string. The next call to yylex() will 1650/** Setup the input buffer state to scan a string. The next call to yylex() will
1958 * scan from a @e copy of @a str. 1651 * scan from a @e copy of @a str.
1959 * @param yystr a NUL-terminated string to scan 1652 * @param yystr a NUL-terminated string to scan
@@ -1967,9 +1660,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1967 1660
1968 return yy_scan_bytes(yystr,strlen(yystr) ); 1661 return yy_scan_bytes(yystr,strlen(yystr) );
1969} 1662}
1970/* %endif */
1971 1663
1972/* %if-c-only */
1973/** Setup the input buffer state to scan the given bytes. The next call to yylex() will 1664/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1974 * scan from a @e copy of @a bytes. 1665 * scan from a @e copy of @a bytes.
1975 * @param bytes the byte buffer to scan 1666 * @param bytes the byte buffer to scan
@@ -2006,21 +1697,16 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
2006 1697
2007 return b; 1698 return b;
2008} 1699}
2009/* %endif */
2010 1700
2011#ifndef YY_EXIT_FAILURE 1701#ifndef YY_EXIT_FAILURE
2012#define YY_EXIT_FAILURE 2 1702#define YY_EXIT_FAILURE 2
2013#endif 1703#endif
2014 1704
2015/* %if-c-only */
2016static void yy_fatal_error (yyconst char* msg ) 1705static void yy_fatal_error (yyconst char* msg )
2017{ 1706{
2018 (void) fprintf( stderr, "%s\n", msg ); 1707 (void) fprintf( stderr, "%s\n", msg );
2019 exit( YY_EXIT_FAILURE ); 1708 exit( YY_EXIT_FAILURE );
2020} 1709}
2021/* %endif */
2022/* %if-c++-only */
2023/* %endif */
2024 1710
2025/* Redefine yyless() so it works in section 3 code. */ 1711/* Redefine yyless() so it works in section 3 code. */
2026 1712
@@ -2041,10 +1727,6 @@ static void yy_fatal_error (yyconst char* msg )
2041 1727
2042/* Accessor methods (get/set functions) to struct members. */ 1728/* Accessor methods (get/set functions) to struct members. */
2043 1729
2044/* %if-c-only */
2045/* %if-reentrant */
2046/* %endif */
2047
2048/** Get the current line number. 1730/** Get the current line number.
2049 * 1731 *
2050 */ 1732 */
@@ -2087,9 +1769,6 @@ char *yyget_text (void)
2087 return yytext; 1769 return yytext;
2088} 1770}
2089 1771
2090/* %if-reentrant */
2091/* %endif */
2092
2093/** Set the current line number. 1772/** Set the current line number.
2094 * @param line_number 1773 * @param line_number
2095 * 1774 *
@@ -2126,14 +1805,6 @@ void yyset_debug (int bdebug )
2126 yy_flex_debug = bdebug ; 1805 yy_flex_debug = bdebug ;
2127} 1806}
2128 1807
2129/* %endif */
2130
2131/* %if-reentrant */
2132/* %if-bison-bridge */
2133/* %endif */
2134/* %endif if-c-only */
2135
2136/* %if-c-only */
2137static int yy_init_globals (void) 1808static int yy_init_globals (void)
2138{ 1809{
2139 /* Initialization is the same as for the non-reentrant scanner. 1810 /* Initialization is the same as for the non-reentrant scanner.
@@ -2161,9 +1832,7 @@ static int yy_init_globals (void)
2161 */ 1832 */
2162 return 0; 1833 return 0;
2163} 1834}
2164/* %endif */
2165 1835
2166/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
2167/* yylex_destroy is for both reentrant and non-reentrant scanners. */ 1836/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2168int yylex_destroy (void) 1837int yylex_destroy (void)
2169{ 1838{
@@ -2183,11 +1852,8 @@ int yylex_destroy (void)
2183 * yylex() is called, initialization will occur. */ 1852 * yylex() is called, initialization will occur. */
2184 yy_init_globals( ); 1853 yy_init_globals( );
2185 1854
2186/* %if-reentrant */
2187/* %endif */
2188 return 0; 1855 return 0;
2189} 1856}
2190/* %endif */
2191 1857
2192/* 1858/*
2193 * Internal utility routines. 1859 * Internal utility routines.
@@ -2235,21 +1901,11 @@ void yyfree (void * ptr )
2235 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ 1901 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2236} 1902}
2237 1903
2238/* %if-tables-serialization definitions */
2239/* %define-yytables The name for this specific scanner's tables. */
2240#define YYTABLES_NAME "yytables" 1904#define YYTABLES_NAME "yytables"
2241/* %endif */
2242
2243/* %ok-for-header */
2244
2245#line 93 "scripts/genksyms/lex.l"
2246
2247
2248 1905
2249/* Bring in the keyword recognizer. */ 1906/* Bring in the keyword recognizer. */
2250 1907
2251#include "keywords.c" 1908#include "keywords.hash.c"
2252
2253 1909
2254/* Macros to append to our phrase collection list. */ 1910/* Macros to append to our phrase collection list. */
2255 1911
@@ -2274,7 +1930,6 @@ void yyfree (void * ptr )
2274 1930
2275#define APP _APP(yytext, yyleng) 1931#define APP _APP(yytext, yyleng)
2276 1932
2277
2278/* The second stage lexer. Here we incorporate knowledge of the state 1933/* The second stage lexer. Here we incorporate knowledge of the state
2279 of the parser to tailor the tokens that are returned. */ 1934 of the parser to tailor the tokens that are returned. */
2280 1935
diff --git a/scripts/genksyms/parse.c_shipped b/scripts/genksyms/parse.tab.c_shipped
index 1a0b8607fb0e..61d4a5d09856 100644
--- a/scripts/genksyms/parse.c_shipped
+++ b/scripts/genksyms/parse.tab.c_shipped
@@ -1,10 +1,9 @@
1 1/* A Bison parser, made by GNU Bison 2.4.3. */
2/* A Bison parser, made by GNU Bison 2.4.1. */
3 2
4/* Skeleton implementation for Bison's Yacc-like parsers in C 3/* Skeleton implementation for Bison's Yacc-like parsers in C
5 4
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
7 Free Software Foundation, Inc. 6 2009, 2010 Free Software Foundation, Inc.
8 7
9 This program is free software: you can redistribute it and/or modify 8 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
@@ -46,7 +45,7 @@
46#define YYBISON 1 45#define YYBISON 1
47 46
48/* Bison version. */ 47/* Bison version. */
49#define YYBISON_VERSION "2.4.1" 48#define YYBISON_VERSION "2.4.3"
50 49
51/* Skeleton name. */ 50/* Skeleton name. */
52#define YYSKELETON_NAME "yacc.c" 51#define YYSKELETON_NAME "yacc.c"
@@ -67,8 +66,6 @@
67 66
68/* Copy the first part of user declarations. */ 67/* Copy the first part of user declarations. */
69 68
70/* Line 189 of yacc.c */
71#line 24 "scripts/genksyms/parse.y"
72 69
73 70
74#include <assert.h> 71#include <assert.h>
@@ -101,8 +98,6 @@ remove_list(struct string_list **pb, struct string_list **pe)
101 98
102 99
103 100
104/* Line 189 of yacc.c */
105#line 106 "scripts/genksyms/parse.c"
106 101
107/* Enabling traces. */ 102/* Enabling traces. */
108#ifndef YYDEBUG 103#ifndef YYDEBUG
@@ -186,8 +181,6 @@ typedef int YYSTYPE;
186/* Copy the second part of user declarations. */ 181/* Copy the second part of user declarations. */
187 182
188 183
189/* Line 264 of yacc.c */
190#line 191 "scripts/genksyms/parse.c"
191 184
192#ifdef short 185#ifdef short
193# undef short 186# undef short
@@ -237,7 +230,7 @@ typedef short int yytype_int16;
237#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 230#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
238 231
239#ifndef YY_ 232#ifndef YY_
240# if YYENABLE_NLS 233# if defined YYENABLE_NLS && YYENABLE_NLS
241# if ENABLE_NLS 234# if ENABLE_NLS
242# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 235# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
243# define YY_(msgid) dgettext ("bison-runtime", msgid) 236# define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -855,9 +848,18 @@ static const yytype_uint8 yystos[] =
855 848
856/* Like YYERROR except do call yyerror. This remains here temporarily 849/* Like YYERROR except do call yyerror. This remains here temporarily
857 to ease the transition to the new meaning of YYERROR, for GCC. 850 to ease the transition to the new meaning of YYERROR, for GCC.
858 Once GCC version 2 has supplanted version 1, this can go. */ 851 Once GCC version 2 has supplanted version 1, this can go. However,
852 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
853 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
854 discussed. */
859 855
860#define YYFAIL goto yyerrlab 856#define YYFAIL goto yyerrlab
857#if defined YYFAIL
858 /* This is here to suppress warnings from the GCC cpp's
859 -Wunused-macros. Normally we don't worry about that warning, but
860 some users do, and we want to make it easy for users to remove
861 YYFAIL uses, which will produce warnings from Bison 2.5. */
862#endif
861 863
862#define YYRECOVERING() (!!yyerrstatus) 864#define YYRECOVERING() (!!yyerrstatus)
863 865
@@ -914,7 +916,7 @@ while (YYID (0))
914 we won't break user code: when these are the locations we know. */ 916 we won't break user code: when these are the locations we know. */
915 917
916#ifndef YY_LOCATION_PRINT 918#ifndef YY_LOCATION_PRINT
917# if YYLTYPE_IS_TRIVIAL 919# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
918# define YY_LOCATION_PRINT(File, Loc) \ 920# define YY_LOCATION_PRINT(File, Loc) \
919 fprintf (File, "%d.%d-%d.%d", \ 921 fprintf (File, "%d.%d-%d.%d", \
920 (Loc).first_line, (Loc).first_column, \ 922 (Loc).first_line, (Loc).first_column, \
@@ -1653,64 +1655,46 @@ yyreduce:
1653 { 1655 {
1654 case 4: 1656 case 4:
1655 1657
1656/* Line 1455 of yacc.c */
1657#line 109 "scripts/genksyms/parse.y"
1658 { is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; ;} 1658 { is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; ;}
1659 break; 1659 break;
1660 1660
1661 case 5: 1661 case 5:
1662 1662
1663/* Line 1455 of yacc.c */
1664#line 111 "scripts/genksyms/parse.y"
1665 { free_list(*(yyvsp[(2) - (2)]), NULL); *(yyvsp[(2) - (2)]) = NULL; ;} 1663 { free_list(*(yyvsp[(2) - (2)]), NULL); *(yyvsp[(2) - (2)]) = NULL; ;}
1666 break; 1664 break;
1667 1665
1668 case 6: 1666 case 6:
1669 1667
1670/* Line 1455 of yacc.c */
1671#line 115 "scripts/genksyms/parse.y"
1672 { is_typedef = 1; ;} 1668 { is_typedef = 1; ;}
1673 break; 1669 break;
1674 1670
1675 case 7: 1671 case 7:
1676 1672
1677/* Line 1455 of yacc.c */
1678#line 116 "scripts/genksyms/parse.y"
1679 { (yyval) = (yyvsp[(4) - (4)]); ;} 1673 { (yyval) = (yyvsp[(4) - (4)]); ;}
1680 break; 1674 break;
1681 1675
1682 case 8: 1676 case 8:
1683 1677
1684/* Line 1455 of yacc.c */
1685#line 117 "scripts/genksyms/parse.y"
1686 { is_typedef = 1; ;} 1678 { is_typedef = 1; ;}
1687 break; 1679 break;
1688 1680
1689 case 9: 1681 case 9:
1690 1682
1691/* Line 1455 of yacc.c */
1692#line 118 "scripts/genksyms/parse.y"
1693 { (yyval) = (yyvsp[(3) - (3)]); ;} 1683 { (yyval) = (yyvsp[(3) - (3)]); ;}
1694 break; 1684 break;
1695 1685
1696 case 14: 1686 case 14:
1697 1687
1698/* Line 1455 of yacc.c */
1699#line 123 "scripts/genksyms/parse.y"
1700 { (yyval) = (yyvsp[(2) - (2)]); ;} 1688 { (yyval) = (yyvsp[(2) - (2)]); ;}
1701 break; 1689 break;
1702 1690
1703 case 15: 1691 case 15:
1704 1692
1705/* Line 1455 of yacc.c */
1706#line 124 "scripts/genksyms/parse.y"
1707 { (yyval) = (yyvsp[(2) - (2)]); ;} 1693 { (yyval) = (yyvsp[(2) - (2)]); ;}
1708 break; 1694 break;
1709 1695
1710 case 16: 1696 case 16:
1711 1697
1712/* Line 1455 of yacc.c */
1713#line 129 "scripts/genksyms/parse.y"
1714 { if (current_name) { 1698 { if (current_name) {
1715 struct string_list *decl = (*(yyvsp[(3) - (3)]))->next; 1699 struct string_list *decl = (*(yyvsp[(3) - (3)]))->next;
1716 (*(yyvsp[(3) - (3)]))->next = NULL; 1700 (*(yyvsp[(3) - (3)]))->next = NULL;
@@ -1725,15 +1709,11 @@ yyreduce:
1725 1709
1726 case 17: 1710 case 17:
1727 1711
1728/* Line 1455 of yacc.c */
1729#line 142 "scripts/genksyms/parse.y"
1730 { (yyval) = NULL; ;} 1712 { (yyval) = NULL; ;}
1731 break; 1713 break;
1732 1714
1733 case 19: 1715 case 19:
1734 1716
1735/* Line 1455 of yacc.c */
1736#line 148 "scripts/genksyms/parse.y"
1737 { struct string_list *decl = *(yyvsp[(1) - (1)]); 1717 { struct string_list *decl = *(yyvsp[(1) - (1)]);
1738 *(yyvsp[(1) - (1)]) = NULL; 1718 *(yyvsp[(1) - (1)]) = NULL;
1739 add_symbol(current_name, 1719 add_symbol(current_name,
@@ -1745,8 +1725,6 @@ yyreduce:
1745 1725
1746 case 20: 1726 case 20:
1747 1727
1748/* Line 1455 of yacc.c */
1749#line 156 "scripts/genksyms/parse.y"
1750 { struct string_list *decl = *(yyvsp[(3) - (3)]); 1728 { struct string_list *decl = *(yyvsp[(3) - (3)]);
1751 *(yyvsp[(3) - (3)]) = NULL; 1729 *(yyvsp[(3) - (3)]) = NULL;
1752 free_list(*(yyvsp[(2) - (3)]), NULL); 1730 free_list(*(yyvsp[(2) - (3)]), NULL);
@@ -1760,36 +1738,26 @@ yyreduce:
1760 1738
1761 case 21: 1739 case 21:
1762 1740
1763/* Line 1455 of yacc.c */
1764#line 169 "scripts/genksyms/parse.y"
1765 { (yyval) = (yyvsp[(4) - (4)]) ? (yyvsp[(4) - (4)]) : (yyvsp[(3) - (4)]) ? (yyvsp[(3) - (4)]) : (yyvsp[(2) - (4)]) ? (yyvsp[(2) - (4)]) : (yyvsp[(1) - (4)]); ;} 1741 { (yyval) = (yyvsp[(4) - (4)]) ? (yyvsp[(4) - (4)]) : (yyvsp[(3) - (4)]) ? (yyvsp[(3) - (4)]) : (yyvsp[(2) - (4)]) ? (yyvsp[(2) - (4)]) : (yyvsp[(1) - (4)]); ;}
1766 break; 1742 break;
1767 1743
1768 case 22: 1744 case 22:
1769 1745
1770/* Line 1455 of yacc.c */
1771#line 174 "scripts/genksyms/parse.y"
1772 { decl_spec = NULL; ;} 1746 { decl_spec = NULL; ;}
1773 break; 1747 break;
1774 1748
1775 case 24: 1749 case 24:
1776 1750
1777/* Line 1455 of yacc.c */
1778#line 179 "scripts/genksyms/parse.y"
1779 { decl_spec = *(yyvsp[(1) - (1)]); ;} 1751 { decl_spec = *(yyvsp[(1) - (1)]); ;}
1780 break; 1752 break;
1781 1753
1782 case 25: 1754 case 25:
1783 1755
1784/* Line 1455 of yacc.c */
1785#line 180 "scripts/genksyms/parse.y"
1786 { decl_spec = *(yyvsp[(2) - (2)]); ;} 1756 { decl_spec = *(yyvsp[(2) - (2)]); ;}
1787 break; 1757 break;
1788 1758
1789 case 26: 1759 case 26:
1790 1760
1791/* Line 1455 of yacc.c */
1792#line 185 "scripts/genksyms/parse.y"
1793 { /* Version 2 checksumming ignores storage class, as that 1761 { /* Version 2 checksumming ignores storage class, as that
1794 is really irrelevant to the linkage. */ 1762 is really irrelevant to the linkage. */
1795 remove_node((yyvsp[(1) - (1)])); 1763 remove_node((yyvsp[(1) - (1)]));
@@ -1799,43 +1767,31 @@ yyreduce:
1799 1767
1800 case 31: 1768 case 31:
1801 1769
1802/* Line 1455 of yacc.c */
1803#line 197 "scripts/genksyms/parse.y"
1804 { is_extern = 1; (yyval) = (yyvsp[(1) - (1)]); ;} 1770 { is_extern = 1; (yyval) = (yyvsp[(1) - (1)]); ;}
1805 break; 1771 break;
1806 1772
1807 case 32: 1773 case 32:
1808 1774
1809/* Line 1455 of yacc.c */
1810#line 198 "scripts/genksyms/parse.y"
1811 { is_extern = 0; (yyval) = (yyvsp[(1) - (1)]); ;} 1775 { is_extern = 0; (yyval) = (yyvsp[(1) - (1)]); ;}
1812 break; 1776 break;
1813 1777
1814 case 37: 1778 case 37:
1815 1779
1816/* Line 1455 of yacc.c */
1817#line 210 "scripts/genksyms/parse.y"
1818 { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_STRUCT; (yyval) = (yyvsp[(2) - (2)]); ;} 1780 { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_STRUCT; (yyval) = (yyvsp[(2) - (2)]); ;}
1819 break; 1781 break;
1820 1782
1821 case 38: 1783 case 38:
1822 1784
1823/* Line 1455 of yacc.c */
1824#line 212 "scripts/genksyms/parse.y"
1825 { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_UNION; (yyval) = (yyvsp[(2) - (2)]); ;} 1785 { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_UNION; (yyval) = (yyvsp[(2) - (2)]); ;}
1826 break; 1786 break;
1827 1787
1828 case 39: 1788 case 39:
1829 1789
1830/* Line 1455 of yacc.c */
1831#line 214 "scripts/genksyms/parse.y"
1832 { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_ENUM; (yyval) = (yyvsp[(2) - (2)]); ;} 1790 { remove_node((yyvsp[(1) - (2)])); (*(yyvsp[(2) - (2)]))->tag = SYM_ENUM; (yyval) = (yyvsp[(2) - (2)]); ;}
1833 break; 1791 break;
1834 1792
1835 case 40: 1793 case 40:
1836 1794
1837/* Line 1455 of yacc.c */
1838#line 218 "scripts/genksyms/parse.y"
1839 { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r; 1795 { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r;
1840 r = copy_node(i); r->tag = SYM_STRUCT; 1796 r = copy_node(i); r->tag = SYM_STRUCT;
1841 r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL; 1797 r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL;
@@ -1846,8 +1802,6 @@ yyreduce:
1846 1802
1847 case 41: 1803 case 41:
1848 1804
1849/* Line 1455 of yacc.c */
1850#line 225 "scripts/genksyms/parse.y"
1851 { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r; 1805 { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r;
1852 r = copy_node(i); r->tag = SYM_UNION; 1806 r = copy_node(i); r->tag = SYM_UNION;
1853 r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL; 1807 r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL;
@@ -1858,8 +1812,6 @@ yyreduce:
1858 1812
1859 case 42: 1813 case 42:
1860 1814
1861/* Line 1455 of yacc.c */
1862#line 232 "scripts/genksyms/parse.y"
1863 { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r; 1815 { struct string_list *s = *(yyvsp[(3) - (3)]), *i = *(yyvsp[(2) - (3)]), *r;
1864 r = copy_node(i); r->tag = SYM_ENUM; 1816 r = copy_node(i); r->tag = SYM_ENUM;
1865 r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL; 1817 r->next = (*(yyvsp[(1) - (3)]))->next; *(yyvsp[(3) - (3)]) = r; (*(yyvsp[(1) - (3)]))->next = NULL;
@@ -1870,57 +1822,41 @@ yyreduce:
1870 1822
1871 case 43: 1823 case 43:
1872 1824
1873/* Line 1455 of yacc.c */
1874#line 242 "scripts/genksyms/parse.y"
1875 { add_symbol(NULL, SYM_ENUM, NULL, 0); (yyval) = (yyvsp[(2) - (2)]); ;} 1825 { add_symbol(NULL, SYM_ENUM, NULL, 0); (yyval) = (yyvsp[(2) - (2)]); ;}
1876 break; 1826 break;
1877 1827
1878 case 44: 1828 case 44:
1879 1829
1880/* Line 1455 of yacc.c */
1881#line 244 "scripts/genksyms/parse.y"
1882 { (yyval) = (yyvsp[(2) - (2)]); ;} 1830 { (yyval) = (yyvsp[(2) - (2)]); ;}
1883 break; 1831 break;
1884 1832
1885 case 45: 1833 case 45:
1886 1834
1887/* Line 1455 of yacc.c */
1888#line 245 "scripts/genksyms/parse.y"
1889 { (yyval) = (yyvsp[(2) - (2)]); ;} 1835 { (yyval) = (yyvsp[(2) - (2)]); ;}
1890 break; 1836 break;
1891 1837
1892 case 56: 1838 case 56:
1893 1839
1894/* Line 1455 of yacc.c */
1895#line 259 "scripts/genksyms/parse.y"
1896 { (*(yyvsp[(1) - (1)]))->tag = SYM_TYPEDEF; (yyval) = (yyvsp[(1) - (1)]); ;} 1840 { (*(yyvsp[(1) - (1)]))->tag = SYM_TYPEDEF; (yyval) = (yyvsp[(1) - (1)]); ;}
1897 break; 1841 break;
1898 1842
1899 case 57: 1843 case 57:
1900 1844
1901/* Line 1455 of yacc.c */
1902#line 264 "scripts/genksyms/parse.y"
1903 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;} 1845 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;}
1904 break; 1846 break;
1905 1847
1906 case 58: 1848 case 58:
1907 1849
1908/* Line 1455 of yacc.c */
1909#line 268 "scripts/genksyms/parse.y"
1910 { (yyval) = NULL; ;} 1850 { (yyval) = NULL; ;}
1911 break; 1851 break;
1912 1852
1913 case 61: 1853 case 61:
1914 1854
1915/* Line 1455 of yacc.c */
1916#line 274 "scripts/genksyms/parse.y"
1917 { (yyval) = (yyvsp[(2) - (2)]); ;} 1855 { (yyval) = (yyvsp[(2) - (2)]); ;}
1918 break; 1856 break;
1919 1857
1920 case 65: 1858 case 65:
1921 1859
1922/* Line 1455 of yacc.c */
1923#line 280 "scripts/genksyms/parse.y"
1924 { /* restrict has no effect in prototypes so ignore it */ 1860 { /* restrict has no effect in prototypes so ignore it */
1925 remove_node((yyvsp[(1) - (1)])); 1861 remove_node((yyvsp[(1) - (1)]));
1926 (yyval) = (yyvsp[(1) - (1)]); 1862 (yyval) = (yyvsp[(1) - (1)]);
@@ -1929,15 +1865,11 @@ yyreduce:
1929 1865
1930 case 66: 1866 case 66:
1931 1867
1932/* Line 1455 of yacc.c */
1933#line 287 "scripts/genksyms/parse.y"
1934 { (yyval) = (yyvsp[(2) - (2)]); ;} 1868 { (yyval) = (yyvsp[(2) - (2)]); ;}
1935 break; 1869 break;
1936 1870
1937 case 68: 1871 case 68:
1938 1872
1939/* Line 1455 of yacc.c */
1940#line 293 "scripts/genksyms/parse.y"
1941 { if (current_name != NULL) { 1873 { if (current_name != NULL) {
1942 error_with_pos("unexpected second declaration name"); 1874 error_with_pos("unexpected second declaration name");
1943 YYERROR; 1875 YYERROR;
@@ -1950,134 +1882,96 @@ yyreduce:
1950 1882
1951 case 69: 1883 case 69:
1952 1884
1953/* Line 1455 of yacc.c */
1954#line 302 "scripts/genksyms/parse.y"
1955 { (yyval) = (yyvsp[(4) - (4)]); ;} 1885 { (yyval) = (yyvsp[(4) - (4)]); ;}
1956 break; 1886 break;
1957 1887
1958 case 70: 1888 case 70:
1959 1889
1960/* Line 1455 of yacc.c */
1961#line 304 "scripts/genksyms/parse.y"
1962 { (yyval) = (yyvsp[(4) - (4)]); ;} 1890 { (yyval) = (yyvsp[(4) - (4)]); ;}
1963 break; 1891 break;
1964 1892
1965 case 71: 1893 case 71:
1966 1894
1967/* Line 1455 of yacc.c */
1968#line 306 "scripts/genksyms/parse.y"
1969 { (yyval) = (yyvsp[(2) - (2)]); ;} 1895 { (yyval) = (yyvsp[(2) - (2)]); ;}
1970 break; 1896 break;
1971 1897
1972 case 72: 1898 case 72:
1973 1899
1974/* Line 1455 of yacc.c */
1975#line 308 "scripts/genksyms/parse.y"
1976 { (yyval) = (yyvsp[(3) - (3)]); ;} 1900 { (yyval) = (yyvsp[(3) - (3)]); ;}
1977 break; 1901 break;
1978 1902
1979 case 73: 1903 case 73:
1980 1904
1981/* Line 1455 of yacc.c */
1982#line 310 "scripts/genksyms/parse.y"
1983 { (yyval) = (yyvsp[(3) - (3)]); ;} 1905 { (yyval) = (yyvsp[(3) - (3)]); ;}
1984 break; 1906 break;
1985 1907
1986 case 74: 1908 case 74:
1987 1909
1988/* Line 1455 of yacc.c */
1989#line 316 "scripts/genksyms/parse.y"
1990 { (yyval) = (yyvsp[(2) - (2)]); ;} 1910 { (yyval) = (yyvsp[(2) - (2)]); ;}
1991 break; 1911 break;
1992 1912
1993 case 78: 1913 case 78:
1994 1914
1995/* Line 1455 of yacc.c */
1996#line 324 "scripts/genksyms/parse.y"
1997 { (yyval) = (yyvsp[(4) - (4)]); ;} 1915 { (yyval) = (yyvsp[(4) - (4)]); ;}
1998 break; 1916 break;
1999 1917
2000 case 79: 1918 case 79:
2001 1919
2002/* Line 1455 of yacc.c */
2003#line 326 "scripts/genksyms/parse.y"
2004 { (yyval) = (yyvsp[(4) - (4)]); ;} 1920 { (yyval) = (yyvsp[(4) - (4)]); ;}
2005 break; 1921 break;
2006 1922
2007 case 80: 1923 case 80:
2008 1924
2009/* Line 1455 of yacc.c */
2010#line 328 "scripts/genksyms/parse.y"
2011 { (yyval) = (yyvsp[(2) - (2)]); ;} 1925 { (yyval) = (yyvsp[(2) - (2)]); ;}
2012 break; 1926 break;
2013 1927
2014 case 81: 1928 case 81:
2015 1929
2016/* Line 1455 of yacc.c */
2017#line 330 "scripts/genksyms/parse.y"
2018 { (yyval) = (yyvsp[(3) - (3)]); ;} 1930 { (yyval) = (yyvsp[(3) - (3)]); ;}
2019 break; 1931 break;
2020 1932
2021 case 82: 1933 case 82:
2022 1934
2023/* Line 1455 of yacc.c */
2024#line 332 "scripts/genksyms/parse.y"
2025 { (yyval) = (yyvsp[(3) - (3)]); ;} 1935 { (yyval) = (yyvsp[(3) - (3)]); ;}
2026 break; 1936 break;
2027 1937
2028 case 83: 1938 case 83:
2029 1939
2030/* Line 1455 of yacc.c */
2031#line 336 "scripts/genksyms/parse.y"
2032 { (yyval) = (yyvsp[(2) - (2)]); ;} 1940 { (yyval) = (yyvsp[(2) - (2)]); ;}
2033 break; 1941 break;
2034 1942
2035 case 85: 1943 case 85:
2036 1944
2037/* Line 1455 of yacc.c */
2038#line 338 "scripts/genksyms/parse.y"
2039 { (yyval) = (yyvsp[(3) - (3)]); ;} 1945 { (yyval) = (yyvsp[(3) - (3)]); ;}
2040 break; 1946 break;
2041 1947
2042 case 86: 1948 case 86:
2043 1949
2044/* Line 1455 of yacc.c */
2045#line 342 "scripts/genksyms/parse.y"
2046 { (yyval) = NULL; ;} 1950 { (yyval) = NULL; ;}
2047 break; 1951 break;
2048 1952
2049 case 89: 1953 case 89:
2050 1954
2051/* Line 1455 of yacc.c */
2052#line 349 "scripts/genksyms/parse.y"
2053 { (yyval) = (yyvsp[(3) - (3)]); ;} 1955 { (yyval) = (yyvsp[(3) - (3)]); ;}
2054 break; 1956 break;
2055 1957
2056 case 90: 1958 case 90:
2057 1959
2058/* Line 1455 of yacc.c */
2059#line 354 "scripts/genksyms/parse.y"
2060 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;} 1960 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;}
2061 break; 1961 break;
2062 1962
2063 case 91: 1963 case 91:
2064 1964
2065/* Line 1455 of yacc.c */
2066#line 359 "scripts/genksyms/parse.y"
2067 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;} 1965 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;}
2068 break; 1966 break;
2069 1967
2070 case 93: 1968 case 93:
2071 1969
2072/* Line 1455 of yacc.c */
2073#line 364 "scripts/genksyms/parse.y"
2074 { (yyval) = NULL; ;} 1970 { (yyval) = NULL; ;}
2075 break; 1971 break;
2076 1972
2077 case 94: 1973 case 94:
2078 1974
2079/* Line 1455 of yacc.c */
2080#line 366 "scripts/genksyms/parse.y"
2081 { /* For version 2 checksums, we don't want to remember 1975 { /* For version 2 checksums, we don't want to remember
2082 private parameter names. */ 1976 private parameter names. */
2083 remove_node((yyvsp[(1) - (1)])); 1977 remove_node((yyvsp[(1) - (1)]));
@@ -2087,8 +1981,6 @@ yyreduce:
2087 1981
2088 case 95: 1982 case 95:
2089 1983
2090/* Line 1455 of yacc.c */
2091#line 374 "scripts/genksyms/parse.y"
2092 { remove_node((yyvsp[(1) - (1)])); 1984 { remove_node((yyvsp[(1) - (1)]));
2093 (yyval) = (yyvsp[(1) - (1)]); 1985 (yyval) = (yyvsp[(1) - (1)]);
2094 ;} 1986 ;}
@@ -2096,43 +1988,31 @@ yyreduce:
2096 1988
2097 case 96: 1989 case 96:
2098 1990
2099/* Line 1455 of yacc.c */
2100#line 378 "scripts/genksyms/parse.y"
2101 { (yyval) = (yyvsp[(4) - (4)]); ;} 1991 { (yyval) = (yyvsp[(4) - (4)]); ;}
2102 break; 1992 break;
2103 1993
2104 case 97: 1994 case 97:
2105 1995
2106/* Line 1455 of yacc.c */
2107#line 380 "scripts/genksyms/parse.y"
2108 { (yyval) = (yyvsp[(4) - (4)]); ;} 1996 { (yyval) = (yyvsp[(4) - (4)]); ;}
2109 break; 1997 break;
2110 1998
2111 case 98: 1999 case 98:
2112 2000
2113/* Line 1455 of yacc.c */
2114#line 382 "scripts/genksyms/parse.y"
2115 { (yyval) = (yyvsp[(2) - (2)]); ;} 2001 { (yyval) = (yyvsp[(2) - (2)]); ;}
2116 break; 2002 break;
2117 2003
2118 case 99: 2004 case 99:
2119 2005
2120/* Line 1455 of yacc.c */
2121#line 384 "scripts/genksyms/parse.y"
2122 { (yyval) = (yyvsp[(3) - (3)]); ;} 2006 { (yyval) = (yyvsp[(3) - (3)]); ;}
2123 break; 2007 break;
2124 2008
2125 case 100: 2009 case 100:
2126 2010
2127/* Line 1455 of yacc.c */
2128#line 386 "scripts/genksyms/parse.y"
2129 { (yyval) = (yyvsp[(3) - (3)]); ;} 2011 { (yyval) = (yyvsp[(3) - (3)]); ;}
2130 break; 2012 break;
2131 2013
2132 case 101: 2014 case 101:
2133 2015
2134/* Line 1455 of yacc.c */
2135#line 391 "scripts/genksyms/parse.y"
2136 { struct string_list *decl = *(yyvsp[(2) - (3)]); 2016 { struct string_list *decl = *(yyvsp[(2) - (3)]);
2137 *(yyvsp[(2) - (3)]) = NULL; 2017 *(yyvsp[(2) - (3)]) = NULL;
2138 add_symbol(current_name, SYM_NORMAL, decl, is_extern); 2018 add_symbol(current_name, SYM_NORMAL, decl, is_extern);
@@ -2142,120 +2022,86 @@ yyreduce:
2142 2022
2143 case 102: 2023 case 102:
2144 2024
2145/* Line 1455 of yacc.c */
2146#line 399 "scripts/genksyms/parse.y"
2147 { (yyval) = NULL; ;} 2025 { (yyval) = NULL; ;}
2148 break; 2026 break;
2149 2027
2150 case 104: 2028 case 104:
2151 2029
2152/* Line 1455 of yacc.c */
2153#line 406 "scripts/genksyms/parse.y"
2154 { remove_list((yyvsp[(2) - (2)]), &(*(yyvsp[(1) - (2)]))->next); (yyval) = (yyvsp[(2) - (2)]); ;} 2030 { remove_list((yyvsp[(2) - (2)]), &(*(yyvsp[(1) - (2)]))->next); (yyval) = (yyvsp[(2) - (2)]); ;}
2155 break; 2031 break;
2156 2032
2157 case 105: 2033 case 105:
2158 2034
2159/* Line 1455 of yacc.c */
2160#line 410 "scripts/genksyms/parse.y"
2161 { (yyval) = (yyvsp[(3) - (3)]); ;} 2035 { (yyval) = (yyvsp[(3) - (3)]); ;}
2162 break; 2036 break;
2163 2037
2164 case 106: 2038 case 106:
2165 2039
2166/* Line 1455 of yacc.c */
2167#line 411 "scripts/genksyms/parse.y"
2168 { (yyval) = (yyvsp[(3) - (3)]); ;} 2040 { (yyval) = (yyvsp[(3) - (3)]); ;}
2169 break; 2041 break;
2170 2042
2171 case 107: 2043 case 107:
2172 2044
2173/* Line 1455 of yacc.c */
2174#line 415 "scripts/genksyms/parse.y"
2175 { (yyval) = NULL; ;} 2045 { (yyval) = NULL; ;}
2176 break; 2046 break;
2177 2047
2178 case 110: 2048 case 110:
2179 2049
2180/* Line 1455 of yacc.c */
2181#line 421 "scripts/genksyms/parse.y"
2182 { (yyval) = (yyvsp[(2) - (2)]); ;} 2050 { (yyval) = (yyvsp[(2) - (2)]); ;}
2183 break; 2051 break;
2184 2052
2185 case 111: 2053 case 111:
2186 2054
2187/* Line 1455 of yacc.c */
2188#line 426 "scripts/genksyms/parse.y"
2189 { (yyval) = (yyvsp[(3) - (3)]); ;} 2055 { (yyval) = (yyvsp[(3) - (3)]); ;}
2190 break; 2056 break;
2191 2057
2192 case 112: 2058 case 112:
2193 2059
2194/* Line 1455 of yacc.c */
2195#line 428 "scripts/genksyms/parse.y"
2196 { (yyval) = (yyvsp[(2) - (2)]); ;} 2060 { (yyval) = (yyvsp[(2) - (2)]); ;}
2197 break; 2061 break;
2198 2062
2199 case 113: 2063 case 113:
2200 2064
2201/* Line 1455 of yacc.c */
2202#line 432 "scripts/genksyms/parse.y"
2203 { (yyval) = NULL; ;} 2065 { (yyval) = NULL; ;}
2204 break; 2066 break;
2205 2067
2206 case 116: 2068 case 116:
2207 2069
2208/* Line 1455 of yacc.c */
2209#line 438 "scripts/genksyms/parse.y"
2210 { (yyval) = (yyvsp[(3) - (3)]); ;} 2070 { (yyval) = (yyvsp[(3) - (3)]); ;}
2211 break; 2071 break;
2212 2072
2213 case 117: 2073 case 117:
2214 2074
2215/* Line 1455 of yacc.c */
2216#line 442 "scripts/genksyms/parse.y"
2217 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;} 2075 { (yyval) = (yyvsp[(2) - (2)]) ? (yyvsp[(2) - (2)]) : (yyvsp[(1) - (2)]); ;}
2218 break; 2076 break;
2219 2077
2220 case 118: 2078 case 118:
2221 2079
2222/* Line 1455 of yacc.c */
2223#line 443 "scripts/genksyms/parse.y"
2224 { (yyval) = (yyvsp[(2) - (2)]); ;} 2080 { (yyval) = (yyvsp[(2) - (2)]); ;}
2225 break; 2081 break;
2226 2082
2227 case 120: 2083 case 120:
2228 2084
2229/* Line 1455 of yacc.c */
2230#line 448 "scripts/genksyms/parse.y"
2231 { (yyval) = (yyvsp[(2) - (2)]); ;} 2085 { (yyval) = (yyvsp[(2) - (2)]); ;}
2232 break; 2086 break;
2233 2087
2234 case 121: 2088 case 121:
2235 2089
2236/* Line 1455 of yacc.c */
2237#line 452 "scripts/genksyms/parse.y"
2238 { (yyval) = NULL; ;} 2090 { (yyval) = NULL; ;}
2239 break; 2091 break;
2240 2092
2241 case 123: 2093 case 123:
2242 2094
2243/* Line 1455 of yacc.c */
2244#line 457 "scripts/genksyms/parse.y"
2245 { (yyval) = (yyvsp[(3) - (3)]); ;} 2095 { (yyval) = (yyvsp[(3) - (3)]); ;}
2246 break; 2096 break;
2247 2097
2248 case 124: 2098 case 124:
2249 2099
2250/* Line 1455 of yacc.c */
2251#line 458 "scripts/genksyms/parse.y"
2252 { (yyval) = (yyvsp[(4) - (4)]); ;} 2100 { (yyval) = (yyvsp[(4) - (4)]); ;}
2253 break; 2101 break;
2254 2102
2255 case 127: 2103 case 127:
2256 2104
2257/* Line 1455 of yacc.c */
2258#line 467 "scripts/genksyms/parse.y"
2259 { 2105 {
2260 const char *name = strdup((*(yyvsp[(1) - (1)]))->string); 2106 const char *name = strdup((*(yyvsp[(1) - (1)]))->string);
2261 add_symbol(name, SYM_ENUM_CONST, NULL, 0); 2107 add_symbol(name, SYM_ENUM_CONST, NULL, 0);
@@ -2264,8 +2110,6 @@ yyreduce:
2264 2110
2265 case 128: 2111 case 128:
2266 2112
2267/* Line 1455 of yacc.c */
2268#line 472 "scripts/genksyms/parse.y"
2269 { 2113 {
2270 const char *name = strdup((*(yyvsp[(1) - (3)]))->string); 2114 const char *name = strdup((*(yyvsp[(1) - (3)]))->string);
2271 struct string_list *expr = copy_list_range(*(yyvsp[(3) - (3)]), *(yyvsp[(2) - (3)])); 2115 struct string_list *expr = copy_list_range(*(yyvsp[(3) - (3)]), *(yyvsp[(2) - (3)]));
@@ -2275,29 +2119,21 @@ yyreduce:
2275 2119
2276 case 129: 2120 case 129:
2277 2121
2278/* Line 1455 of yacc.c */
2279#line 479 "scripts/genksyms/parse.y"
2280 { (yyval) = (yyvsp[(2) - (2)]); ;} 2122 { (yyval) = (yyvsp[(2) - (2)]); ;}
2281 break; 2123 break;
2282 2124
2283 case 130: 2125 case 130:
2284 2126
2285/* Line 1455 of yacc.c */
2286#line 483 "scripts/genksyms/parse.y"
2287 { (yyval) = NULL; ;} 2127 { (yyval) = NULL; ;}
2288 break; 2128 break;
2289 2129
2290 case 132: 2130 case 132:
2291 2131
2292/* Line 1455 of yacc.c */
2293#line 489 "scripts/genksyms/parse.y"
2294 { export_symbol((*(yyvsp[(3) - (5)]))->string); (yyval) = (yyvsp[(5) - (5)]); ;} 2132 { export_symbol((*(yyvsp[(3) - (5)]))->string); (yyval) = (yyvsp[(5) - (5)]); ;}
2295 break; 2133 break;
2296 2134
2297 2135
2298 2136
2299/* Line 1455 of yacc.c */
2300#line 2301 "scripts/genksyms/parse.c"
2301 default: break; 2137 default: break;
2302 } 2138 }
2303 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 2139 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -2508,8 +2344,6 @@ yyreturn:
2508 2344
2509 2345
2510 2346
2511/* Line 1675 of yacc.c */
2512#line 493 "scripts/genksyms/parse.y"
2513 2347
2514 2348
2515static void 2349static void
diff --git a/scripts/genksyms/parse.h_shipped b/scripts/genksyms/parse.tab.h_shipped
index 517523669251..350c2b403e21 100644
--- a/scripts/genksyms/parse.h_shipped
+++ b/scripts/genksyms/parse.tab.h_shipped
@@ -1,10 +1,9 @@
1 1/* A Bison parser, made by GNU Bison 2.4.3. */
2/* A Bison parser, made by GNU Bison 2.4.1. */
3 2
4/* Skeleton interface for Bison's Yacc-like parsers in C 3/* Skeleton interface for Bison's Yacc-like parsers in C
5 4
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
7 Free Software Foundation, Inc. 6 2009, 2010 Free Software Foundation, Inc.
8 7
9 This program is free software: you can redistribute it and/or modify 8 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index d29a8d75cb22..eb2f1e64edf7 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -328,7 +328,8 @@ sub read_mailmap {
328 # name1 <mail1> <mail2> 328 # name1 <mail1> <mail2>
329 # name1 <mail1> name2 <mail2> 329 # name1 <mail1> name2 <mail2>
330 # (see man git-shortlog) 330 # (see man git-shortlog)
331 if (/^(.+)<(.+)>$/) { 331
332 if (/^([^<]+)<([^>]+)>$/) {
332 my $real_name = $1; 333 my $real_name = $1;
333 my $address = $2; 334 my $address = $2;
334 335
@@ -336,13 +337,13 @@ sub read_mailmap {
336 ($real_name, $address) = parse_email("$real_name <$address>"); 337 ($real_name, $address) = parse_email("$real_name <$address>");
337 $mailmap->{names}->{$address} = $real_name; 338 $mailmap->{names}->{$address} = $real_name;
338 339
339 } elsif (/^<([^\s]+)>\s*<([^\s]+)>$/) { 340 } elsif (/^<([^>]+)>\s*<([^>]+)>$/) {
340 my $real_address = $1; 341 my $real_address = $1;
341 my $wrong_address = $2; 342 my $wrong_address = $2;
342 343
343 $mailmap->{addresses}->{$wrong_address} = $real_address; 344 $mailmap->{addresses}->{$wrong_address} = $real_address;
344 345
345 } elsif (/^(.+)<([^\s]+)>\s*<([^\s]+)>$/) { 346 } elsif (/^(.+)<([^>]+)>\s*<([^>]+)>$/) {
346 my $real_name = $1; 347 my $real_name = $1;
347 my $real_address = $2; 348 my $real_address = $2;
348 my $wrong_address = $3; 349 my $wrong_address = $3;
@@ -353,7 +354,7 @@ sub read_mailmap {
353 $mailmap->{names}->{$wrong_address} = $real_name; 354 $mailmap->{names}->{$wrong_address} = $real_name;
354 $mailmap->{addresses}->{$wrong_address} = $real_address; 355 $mailmap->{addresses}->{$wrong_address} = $real_address;
355 356
356 } elsif (/^(.+)<([^\s]+)>\s*([^\s].*)<([^\s]+)>$/) { 357 } elsif (/^(.+)<([^>]+)>\s*(.+)\s*<([^>]+)>$/) {
357 my $real_name = $1; 358 my $real_name = $1;
358 my $real_address = $2; 359 my $real_address = $2;
359 my $wrong_name = $3; 360 my $wrong_name = $3;
diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
index efb3be10d428..48462be328bb 100644
--- a/scripts/headers_install.pl
+++ b/scripts/headers_install.pl
@@ -35,6 +35,7 @@ foreach my $file (@files) {
35 $line =~ s/([\s(])__iomem\s/$1/g; 35 $line =~ s/([\s(])__iomem\s/$1/g;
36 $line =~ s/\s__attribute_const__\s/ /g; 36 $line =~ s/\s__attribute_const__\s/ /g;
37 $line =~ s/\s__attribute_const__$//g; 37 $line =~ s/\s__attribute_const__$//g;
38 $line =~ s/\b__packed\b/__attribute__((packed))/g;
38 $line =~ s/^#include <linux\/compiler.h>//; 39 $line =~ s/^#include <linux\/compiler.h>//;
39 $line =~ s/(^|\s)(inline)\b/$1__$2__/g; 40 $line =~ s/(^|\s)(inline)\b/$1__$2__/g;
40 $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g; 41 $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g;
diff --git a/scripts/kconfig/.gitignore b/scripts/kconfig/.gitignore
index 624f6502e03e..ee120d441565 100644
--- a/scripts/kconfig/.gitignore
+++ b/scripts/kconfig/.gitignore
@@ -2,7 +2,7 @@
2# Generated files 2# Generated files
3# 3#
4config* 4config*
5lex.*.c 5*.lex.c
6*.tab.c 6*.tab.c
7*.tab.h 7*.tab.h
8zconf.hash.c 8zconf.hash.c
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index faa9a4701b6f..0b4276c047b2 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -204,7 +204,7 @@ ifeq ($(gconf-target),1)
204endif 204endif
205 205
206clean-files := lkc_defs.h qconf.moc .tmp_qtcheck .tmp_gtkcheck 206clean-files := lkc_defs.h qconf.moc .tmp_qtcheck .tmp_gtkcheck
207clean-files += zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h 207clean-files += zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h
208clean-files += mconf qconf gconf nconf 208clean-files += mconf qconf gconf nconf
209clean-files += config.pot linux.pot 209clean-files += config.pot linux.pot
210 210
@@ -220,9 +220,12 @@ always := dochecklxdialog
220HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS)) 220HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS))
221 221
222# generated files seem to need this to find local include files 222# generated files seem to need this to find local include files
223HOSTCFLAGS_lex.zconf.o := -I$(src) 223HOSTCFLAGS_zconf.lex.o := -I$(src)
224HOSTCFLAGS_zconf.tab.o := -I$(src) 224HOSTCFLAGS_zconf.tab.o := -I$(src)
225 225
226LEX_PREFIX_zconf := zconf
227YACC_PREFIX_zconf := zconf
228
226HOSTLOADLIBES_qconf = $(KC_QT_LIBS) -ldl 229HOSTLOADLIBES_qconf = $(KC_QT_LIBS) -ldl
227HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK 230HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK
228 231
@@ -316,7 +319,7 @@ $(obj)/.tmp_gtkcheck:
316 fi 319 fi
317endif 320endif
318 321
319$(obj)/zconf.tab.o: $(obj)/lex.zconf.c $(obj)/zconf.hash.c 322$(obj)/zconf.tab.o: $(obj)/zconf.lex.c $(obj)/zconf.hash.c
320 323
321$(obj)/kconfig_load.o: $(obj)/lkc_defs.h 324$(obj)/kconfig_load.o: $(obj)/lkc_defs.h
322 325
@@ -335,28 +338,3 @@ $(obj)/gconf.glade.h: $(obj)/gconf.glade
335 $(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \ 338 $(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \
336 $(obj)/gconf.glade 339 $(obj)/gconf.glade
337 340
338###
339# The following requires flex/bison/gperf
340# By default we use the _shipped versions, uncomment the following line if
341# you are modifying the flex/bison src.
342# LKC_GENPARSER := 1
343
344ifdef LKC_GENPARSER
345
346$(obj)/zconf.tab.c: $(src)/zconf.y
347$(obj)/lex.zconf.c: $(src)/zconf.l
348$(obj)/zconf.hash.c: $(src)/zconf.gperf
349
350%.tab.c: %.y
351 bison -l -b $* -p $(notdir $*) $<
352 cp $@ $@_shipped
353
354lex.%.c: %.l
355 flex -L -P$(notdir $*) -o$@ $<
356 cp $@ $@_shipped
357
358%.hash.c: %.gperf
359 gperf < $< > $@
360 cp $@ $@_shipped
361
362endif
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index febf0c94d558..f34a0a9b50f1 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -68,9 +68,7 @@ struct kconf_id {
68 enum symbol_type stype; 68 enum symbol_type stype;
69}; 69};
70 70
71#ifdef YYDEBUG
72extern int zconfdebug; 71extern int zconfdebug;
73#endif
74 72
75int zconfparse(void); 73int zconfparse(void);
76void zconfdump(FILE *out); 74void zconfdump(FILE *out);
diff --git a/scripts/kconfig/zconf.gperf b/scripts/kconfig/zconf.gperf
index c9e690eb7545..f14ab41154b6 100644
--- a/scripts/kconfig/zconf.gperf
+++ b/scripts/kconfig/zconf.gperf
@@ -9,7 +9,7 @@
9 9
10struct kconf_id; 10struct kconf_id;
11 11
12static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len); 12static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
13 13
14%% 14%%
15mainmenu, T_MAINMENU, TF_COMMAND 15mainmenu, T_MAINMENU, TF_COMMAND
diff --git a/scripts/kconfig/zconf.hash.c_shipped b/scripts/kconfig/zconf.hash.c_shipped
index 4055d5de1750..40df0005daa9 100644
--- a/scripts/kconfig/zconf.hash.c_shipped
+++ b/scripts/kconfig/zconf.hash.c_shipped
@@ -1,6 +1,5 @@
1/* ANSI-C code produced by gperf version 3.0.3 */ 1/* ANSI-C code produced by gperf version 3.0.4 */
2/* Command-line: gperf */ 2/* Command-line: gperf -t --output-file scripts/kconfig/zconf.hash.c_shipped -a -C -E -g -k '1,3,$' -p -t scripts/kconfig/zconf.gperf */
3/* Computed positions: -k'1,3' */
4 3
5#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ 4#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
6 && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ 5 && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
@@ -29,10 +28,11 @@
29#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>." 28#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
30#endif 29#endif
31 30
31#line 10 "scripts/kconfig/zconf.gperf"
32struct kconf_id; 32struct kconf_id;
33 33
34static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len); 34static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
35/* maximum key range = 50, duplicates = 0 */ 35/* maximum key range = 71, duplicates = 0 */
36 36
37#ifdef __GNUC__ 37#ifdef __GNUC__
38__inline 38__inline
@@ -44,34 +44,34 @@ inline
44static unsigned int 44static unsigned int
45kconf_id_hash (register const char *str, register unsigned int len) 45kconf_id_hash (register const char *str, register unsigned int len)
46{ 46{
47 static unsigned char asso_values[] = 47 static const unsigned char asso_values[] =
48 { 48 {
49 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 49 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
50 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 50 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
51 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 51 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
52 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
53 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 53 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
54 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 54 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
55 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 55 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
56 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 56 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
57 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 57 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
58 52, 52, 52, 52, 52, 52, 52, 52, 40, 5, 58 73, 73, 73, 73, 73, 73, 73, 73, 25, 25,
59 0, 0, 5, 52, 0, 20, 52, 52, 10, 20, 59 0, 0, 0, 5, 0, 0, 73, 73, 5, 0,
60 5, 0, 35, 52, 0, 30, 0, 15, 0, 52, 60 10, 5, 45, 73, 20, 20, 0, 15, 15, 73,
61 15, 52, 52, 52, 52, 52, 52, 52, 52, 52, 61 20, 73, 73, 73, 73, 73, 73, 73, 73, 73,
62 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 62 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
63 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 63 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
64 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 64 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
65 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 65 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
66 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 66 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
67 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 67 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
68 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 68 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
69 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 69 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
70 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 70 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
71 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 71 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
72 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 72 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
73 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 73 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
74 52, 52, 52, 52, 52, 52 74 73, 73, 73, 73, 73, 73
75 }; 75 };
76 register int hval = len; 76 register int hval = len;
77 77
@@ -85,87 +85,87 @@ kconf_id_hash (register const char *str, register unsigned int len)
85 hval += asso_values[(unsigned char)str[0]]; 85 hval += asso_values[(unsigned char)str[0]];
86 break; 86 break;
87 } 87 }
88 return hval; 88 return hval + asso_values[(unsigned char)str[len - 1]];
89} 89}
90 90
91struct kconf_id_strings_t 91struct kconf_id_strings_t
92 { 92 {
93 char kconf_id_strings_str2[sizeof("on")]; 93 char kconf_id_strings_str2[sizeof("if")];
94 char kconf_id_strings_str3[sizeof("env")]; 94 char kconf_id_strings_str3[sizeof("int")];
95 char kconf_id_strings_str5[sizeof("endif")]; 95 char kconf_id_strings_str5[sizeof("endif")];
96 char kconf_id_strings_str6[sizeof("option")]; 96 char kconf_id_strings_str7[sizeof("default")];
97 char kconf_id_strings_str7[sizeof("endmenu")]; 97 char kconf_id_strings_str8[sizeof("tristate")];
98 char kconf_id_strings_str8[sizeof("optional")];
99 char kconf_id_strings_str9[sizeof("endchoice")]; 98 char kconf_id_strings_str9[sizeof("endchoice")];
100 char kconf_id_strings_str10[sizeof("range")]; 99 char kconf_id_strings_str12[sizeof("def_tristate")];
101 char kconf_id_strings_str11[sizeof("choice")];
102 char kconf_id_strings_str12[sizeof("default")];
103 char kconf_id_strings_str13[sizeof("def_bool")]; 100 char kconf_id_strings_str13[sizeof("def_bool")];
104 char kconf_id_strings_str14[sizeof("help")]; 101 char kconf_id_strings_str14[sizeof("defconfig_list")];
105 char kconf_id_strings_str16[sizeof("config")]; 102 char kconf_id_strings_str17[sizeof("on")];
106 char kconf_id_strings_str17[sizeof("def_tristate")]; 103 char kconf_id_strings_str18[sizeof("optional")];
107 char kconf_id_strings_str18[sizeof("hex")]; 104 char kconf_id_strings_str21[sizeof("option")];
108 char kconf_id_strings_str19[sizeof("defconfig_list")]; 105 char kconf_id_strings_str22[sizeof("endmenu")];
109 char kconf_id_strings_str22[sizeof("if")]; 106 char kconf_id_strings_str23[sizeof("mainmenu")];
110 char kconf_id_strings_str23[sizeof("int")]; 107 char kconf_id_strings_str25[sizeof("menuconfig")];
111 char kconf_id_strings_str27[sizeof("modules")]; 108 char kconf_id_strings_str27[sizeof("modules")];
112 char kconf_id_strings_str28[sizeof("tristate")];
113 char kconf_id_strings_str29[sizeof("menu")]; 109 char kconf_id_strings_str29[sizeof("menu")];
110 char kconf_id_strings_str31[sizeof("select")];
114 char kconf_id_strings_str32[sizeof("comment")]; 111 char kconf_id_strings_str32[sizeof("comment")];
115 char kconf_id_strings_str35[sizeof("menuconfig")]; 112 char kconf_id_strings_str33[sizeof("env")];
116 char kconf_id_strings_str36[sizeof("string")]; 113 char kconf_id_strings_str35[sizeof("range")];
117 char kconf_id_strings_str37[sizeof("visible")]; 114 char kconf_id_strings_str36[sizeof("choice")];
118 char kconf_id_strings_str41[sizeof("prompt")]; 115 char kconf_id_strings_str39[sizeof("bool")];
119 char kconf_id_strings_str42[sizeof("depends")]; 116 char kconf_id_strings_str41[sizeof("source")];
120 char kconf_id_strings_str44[sizeof("bool")]; 117 char kconf_id_strings_str42[sizeof("visible")];
121 char kconf_id_strings_str46[sizeof("select")]; 118 char kconf_id_strings_str43[sizeof("hex")];
119 char kconf_id_strings_str46[sizeof("config")];
122 char kconf_id_strings_str47[sizeof("boolean")]; 120 char kconf_id_strings_str47[sizeof("boolean")];
123 char kconf_id_strings_str48[sizeof("mainmenu")]; 121 char kconf_id_strings_str51[sizeof("string")];
124 char kconf_id_strings_str51[sizeof("source")]; 122 char kconf_id_strings_str54[sizeof("help")];
123 char kconf_id_strings_str56[sizeof("prompt")];
124 char kconf_id_strings_str72[sizeof("depends")];
125 }; 125 };
126static struct kconf_id_strings_t kconf_id_strings_contents = 126static const struct kconf_id_strings_t kconf_id_strings_contents =
127 { 127 {
128 "on", 128 "if",
129 "env", 129 "int",
130 "endif", 130 "endif",
131 "option",
132 "endmenu",
133 "optional",
134 "endchoice",
135 "range",
136 "choice",
137 "default", 131 "default",
138 "def_bool", 132 "tristate",
139 "help", 133 "endchoice",
140 "config",
141 "def_tristate", 134 "def_tristate",
142 "hex", 135 "def_bool",
143 "defconfig_list", 136 "defconfig_list",
144 "if", 137 "on",
145 "int", 138 "optional",
139 "option",
140 "endmenu",
141 "mainmenu",
142 "menuconfig",
146 "modules", 143 "modules",
147 "tristate",
148 "menu", 144 "menu",
145 "select",
149 "comment", 146 "comment",
150 "menuconfig", 147 "env",
151 "string", 148 "range",
152 "visible", 149 "choice",
153 "prompt",
154 "depends",
155 "bool", 150 "bool",
156 "select", 151 "source",
152 "visible",
153 "hex",
154 "config",
157 "boolean", 155 "boolean",
158 "mainmenu", 156 "string",
159 "source" 157 "help",
158 "prompt",
159 "depends"
160 }; 160 };
161#define kconf_id_strings ((const char *) &kconf_id_strings_contents) 161#define kconf_id_strings ((const char *) &kconf_id_strings_contents)
162#ifdef __GNUC__ 162#ifdef __GNUC__
163__inline 163__inline
164#ifdef __GNUC_STDC_INLINE__ 164#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
165__attribute__ ((__gnu_inline__)) 165__attribute__ ((__gnu_inline__))
166#endif 166#endif
167#endif 167#endif
168struct kconf_id * 168const struct kconf_id *
169kconf_id_lookup (register const char *str, register unsigned int len) 169kconf_id_lookup (register const char *str, register unsigned int len)
170{ 170{
171 enum 171 enum
@@ -174,54 +174,94 @@ kconf_id_lookup (register const char *str, register unsigned int len)
174 MIN_WORD_LENGTH = 2, 174 MIN_WORD_LENGTH = 2,
175 MAX_WORD_LENGTH = 14, 175 MAX_WORD_LENGTH = 14,
176 MIN_HASH_VALUE = 2, 176 MIN_HASH_VALUE = 2,
177 MAX_HASH_VALUE = 51 177 MAX_HASH_VALUE = 72
178 }; 178 };
179 179
180 static struct kconf_id wordlist[] = 180 static const struct kconf_id wordlist[] =
181 { 181 {
182 {-1}, {-1}, 182 {-1}, {-1},
183 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_ON, TF_PARAM}, 183#line 25 "scripts/kconfig/zconf.gperf"
184 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3, T_OPT_ENV, TF_OPTION}, 184 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_IF, TF_COMMAND|TF_PARAM},
185#line 36 "scripts/kconfig/zconf.gperf"
186 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3, T_TYPE, TF_COMMAND, S_INT},
185 {-1}, 187 {-1},
188#line 26 "scripts/kconfig/zconf.gperf"
186 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str5, T_ENDIF, TF_COMMAND}, 189 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str5, T_ENDIF, TF_COMMAND},
187 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str6, T_OPTION, TF_COMMAND}, 190 {-1},
188 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_ENDMENU, TF_COMMAND}, 191#line 29 "scripts/kconfig/zconf.gperf"
189 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_OPTIONAL, TF_COMMAND}, 192 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_DEFAULT, TF_COMMAND, S_UNKNOWN},
193#line 31 "scripts/kconfig/zconf.gperf"
194 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_TYPE, TF_COMMAND, S_TRISTATE},
195#line 20 "scripts/kconfig/zconf.gperf"
190 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str9, T_ENDCHOICE, TF_COMMAND}, 196 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str9, T_ENDCHOICE, TF_COMMAND},
191 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str10, T_RANGE, TF_COMMAND}, 197 {-1}, {-1},
192 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str11, T_CHOICE, TF_COMMAND}, 198#line 32 "scripts/kconfig/zconf.gperf"
193 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_UNKNOWN}, 199 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_TRISTATE},
200#line 35 "scripts/kconfig/zconf.gperf"
194 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN}, 201 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN},
195 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_HELP, TF_COMMAND}, 202#line 45 "scripts/kconfig/zconf.gperf"
196 {-1}, 203 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_OPT_DEFCONFIG_LIST,TF_OPTION},
197 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16, T_CONFIG, TF_COMMAND},
198 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_DEFAULT, TF_COMMAND, S_TRISTATE},
199 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_TYPE, TF_COMMAND, S_HEX},
200 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str19, T_OPT_DEFCONFIG_LIST,TF_OPTION},
201 {-1}, {-1}, 204 {-1}, {-1},
202 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_IF, TF_COMMAND|TF_PARAM}, 205#line 43 "scripts/kconfig/zconf.gperf"
203 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_TYPE, TF_COMMAND, S_INT}, 206 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_ON, TF_PARAM},
204 {-1}, {-1}, {-1}, 207#line 28 "scripts/kconfig/zconf.gperf"
208 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_OPTIONAL, TF_COMMAND},
209 {-1}, {-1},
210#line 42 "scripts/kconfig/zconf.gperf"
211 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_OPTION, TF_COMMAND},
212#line 17 "scripts/kconfig/zconf.gperf"
213 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_ENDMENU, TF_COMMAND},
214#line 15 "scripts/kconfig/zconf.gperf"
215 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_MAINMENU, TF_COMMAND},
216 {-1},
217#line 23 "scripts/kconfig/zconf.gperf"
218 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str25, T_MENUCONFIG, TF_COMMAND},
219 {-1},
220#line 44 "scripts/kconfig/zconf.gperf"
205 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION}, 221 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION},
206 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_TYPE, TF_COMMAND, S_TRISTATE}, 222 {-1},
223#line 16 "scripts/kconfig/zconf.gperf"
207 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND}, 224 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND},
208 {-1}, {-1}, 225 {-1},
226#line 39 "scripts/kconfig/zconf.gperf"
227 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_SELECT, TF_COMMAND},
228#line 21 "scripts/kconfig/zconf.gperf"
209 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND}, 229 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND},
210 {-1}, {-1}, 230#line 46 "scripts/kconfig/zconf.gperf"
211 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35, T_MENUCONFIG, TF_COMMAND}, 231 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_OPT_ENV, TF_OPTION},
212 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36, T_TYPE, TF_COMMAND, S_STRING},
213 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37, T_VISIBLE, TF_COMMAND},
214 {-1}, {-1}, {-1},
215 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_PROMPT, TF_COMMAND},
216 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str42, T_DEPENDS, TF_COMMAND},
217 {-1}, 232 {-1},
218 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str44, T_TYPE, TF_COMMAND, S_BOOLEAN}, 233#line 40 "scripts/kconfig/zconf.gperf"
234 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35, T_RANGE, TF_COMMAND},
235#line 19 "scripts/kconfig/zconf.gperf"
236 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36, T_CHOICE, TF_COMMAND},
237 {-1}, {-1},
238#line 33 "scripts/kconfig/zconf.gperf"
239 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str39, T_TYPE, TF_COMMAND, S_BOOLEAN},
219 {-1}, 240 {-1},
220 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_SELECT, TF_COMMAND}, 241#line 18 "scripts/kconfig/zconf.gperf"
242 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_SOURCE, TF_COMMAND},
243#line 41 "scripts/kconfig/zconf.gperf"
244 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str42, T_VISIBLE, TF_COMMAND},
245#line 37 "scripts/kconfig/zconf.gperf"
246 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str43, T_TYPE, TF_COMMAND, S_HEX},
247 {-1}, {-1},
248#line 22 "scripts/kconfig/zconf.gperf"
249 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_CONFIG, TF_COMMAND},
250#line 34 "scripts/kconfig/zconf.gperf"
221 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str47, T_TYPE, TF_COMMAND, S_BOOLEAN}, 251 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str47, T_TYPE, TF_COMMAND, S_BOOLEAN},
222 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str48, T_MAINMENU, TF_COMMAND}, 252 {-1}, {-1}, {-1},
253#line 38 "scripts/kconfig/zconf.gperf"
254 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str51, T_TYPE, TF_COMMAND, S_STRING},
223 {-1}, {-1}, 255 {-1}, {-1},
224 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str51, T_SOURCE, TF_COMMAND} 256#line 24 "scripts/kconfig/zconf.gperf"
257 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str54, T_HELP, TF_COMMAND},
258 {-1},
259#line 30 "scripts/kconfig/zconf.gperf"
260 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str56, T_PROMPT, TF_COMMAND},
261 {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
262 {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
263#line 27 "scripts/kconfig/zconf.gperf"
264 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str72, T_DEPENDS, TF_COMMAND}
225 }; 265 };
226 266
227 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) 267 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
@@ -242,4 +282,5 @@ kconf_id_lookup (register const char *str, register unsigned int len)
242 } 282 }
243 return 0; 283 return 0;
244} 284}
285#line 47 "scripts/kconfig/zconf.gperf"
245 286
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index b22f884f9022..ddee5fc51811 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -1,5 +1,5 @@
1%option backup nostdinit noyywrap never-interactive full ecs 1%option nostdinit noyywrap never-interactive full ecs
2%option 8bit backup nodefault perf-report perf-report 2%option 8bit nodefault perf-report perf-report
3%option noinput 3%option noinput
4%x COMMAND HELP STRING PARAM 4%x COMMAND HELP STRING PARAM
5%{ 5%{
@@ -96,7 +96,7 @@ n [A-Za-z0-9_]
96 96
97<COMMAND>{ 97<COMMAND>{
98 {n}+ { 98 {n}+ {
99 struct kconf_id *id = kconf_id_lookup(yytext, yyleng); 99 const struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
100 BEGIN(PARAM); 100 BEGIN(PARAM);
101 current_pos.file = current_file; 101 current_pos.file = current_file;
102 current_pos.lineno = current_file->lineno; 102 current_pos.lineno = current_file->lineno;
@@ -132,7 +132,7 @@ n [A-Za-z0-9_]
132 \n BEGIN(INITIAL); current_file->lineno++; return T_EOL; 132 \n BEGIN(INITIAL); current_file->lineno++; return T_EOL;
133 --- /* ignore */ 133 --- /* ignore */
134 ({n}|[-/.])+ { 134 ({n}|[-/.])+ {
135 struct kconf_id *id = kconf_id_lookup(yytext, yyleng); 135 const struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
136 if (id && id->flags & TF_PARAM) { 136 if (id && id->flags & TF_PARAM) {
137 zconflval.id = id; 137 zconflval.id = id;
138 return id->token; 138 return id->token;
diff --git a/scripts/kconfig/lex.zconf.c_shipped b/scripts/kconfig/zconf.lex.c_shipped
index d9182916f724..906c09911748 100644
--- a/scripts/kconfig/lex.zconf.c_shipped
+++ b/scripts/kconfig/zconf.lex.c_shipped
@@ -1,5 +1,5 @@
1 1
2#line 3 "scripts/kconfig/lex.zconf.c" 2#line 3 "scripts/kconfig/zconf.lex.c_shipped"
3 3
4#define YY_INT_ALIGNED short int 4#define YY_INT_ALIGNED short int
5 5
@@ -72,6 +72,7 @@ typedef int flex_int32_t;
72typedef unsigned char flex_uint8_t; 72typedef unsigned char flex_uint8_t;
73typedef unsigned short int flex_uint16_t; 73typedef unsigned short int flex_uint16_t;
74typedef unsigned int flex_uint32_t; 74typedef unsigned int flex_uint32_t;
75#endif /* ! C99 */
75 76
76/* Limits of integral types. */ 77/* Limits of integral types. */
77#ifndef INT8_MIN 78#ifndef INT8_MIN
@@ -102,8 +103,6 @@ typedef unsigned int flex_uint32_t;
102#define UINT32_MAX (4294967295U) 103#define UINT32_MAX (4294967295U)
103#endif 104#endif
104 105
105#endif /* ! C99 */
106
107#endif /* ! FLEXINT_H */ 106#endif /* ! FLEXINT_H */
108 107
109#ifdef __cplusplus 108#ifdef __cplusplus
@@ -160,15 +159,7 @@ typedef unsigned int flex_uint32_t;
160 159
161/* Size of default input buffer. */ 160/* Size of default input buffer. */
162#ifndef YY_BUF_SIZE 161#ifndef YY_BUF_SIZE
163#ifdef __ia64__
164/* On IA-64, the buffer size is 16k, not 8k.
165 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
166 * Ditto for the __ia64__ case accordingly.
167 */
168#define YY_BUF_SIZE 32768
169#else
170#define YY_BUF_SIZE 16384 162#define YY_BUF_SIZE 16384
171#endif /* __ia64__ */
172#endif 163#endif
173 164
174/* The state buf must be large enough to hold one state per character in the main buffer. 165/* The state buf must be large enough to hold one state per character in the main buffer.
@@ -922,12 +913,7 @@ static int input (void );
922 913
923/* Amount of stuff to slurp up with each read. */ 914/* Amount of stuff to slurp up with each read. */
924#ifndef YY_READ_BUF_SIZE 915#ifndef YY_READ_BUF_SIZE
925#ifdef __ia64__
926/* On IA-64, the buffer size is 16k, not 8k */
927#define YY_READ_BUF_SIZE 16384
928#else
929#define YY_READ_BUF_SIZE 8192 916#define YY_READ_BUF_SIZE 8192
930#endif /* __ia64__ */
931#endif 917#endif
932 918
933/* Copy whatever the last rule matched to the standard output. */ 919/* Copy whatever the last rule matched to the standard output. */
@@ -1100,7 +1086,7 @@ YY_RULE_SETUP
1100case 6: 1086case 6:
1101YY_RULE_SETUP 1087YY_RULE_SETUP
1102{ 1088{
1103 struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng); 1089 const struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
1104 BEGIN(PARAM); 1090 BEGIN(PARAM);
1105 current_pos.file = current_file; 1091 current_pos.file = current_file;
1106 current_pos.lineno = current_file->lineno; 1092 current_pos.lineno = current_file->lineno;
@@ -1175,7 +1161,7 @@ YY_RULE_SETUP
1175case 19: 1161case 19:
1176YY_RULE_SETUP 1162YY_RULE_SETUP
1177{ 1163{
1178 struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng); 1164 const struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
1179 if (id && id->flags & TF_PARAM) { 1165 if (id && id->flags & TF_PARAM) {
1180 zconflval.id = id; 1166 zconflval.id = id;
1181 return id->token; 1167 return id->token;
@@ -2073,8 +2059,8 @@ YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
2073 2059
2074/** Setup the input buffer state to scan the given bytes. The next call to zconflex() will 2060/** Setup the input buffer state to scan the given bytes. The next call to zconflex() will
2075 * scan from a @e copy of @a bytes. 2061 * scan from a @e copy of @a bytes.
2076 * @param yybytes the byte buffer to scan 2062 * @param bytes the byte buffer to scan
2077 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. 2063 * @param len the number of bytes in the buffer pointed to by @a bytes.
2078 * 2064 *
2079 * @return the newly allocated buffer state object. 2065 * @return the newly allocated buffer state object.
2080 */ 2066 */
diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped
index 4c5495ea205e..211e1a277037 100644
--- a/scripts/kconfig/zconf.tab.c_shipped
+++ b/scripts/kconfig/zconf.tab.c_shipped
@@ -1,10 +1,9 @@
1 1/* A Bison parser, made by GNU Bison 2.4.3. */
2/* A Bison parser, made by GNU Bison 2.4.1. */
3 2
4/* Skeleton implementation for Bison's Yacc-like parsers in C 3/* Skeleton implementation for Bison's Yacc-like parsers in C
5 4
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
7 Free Software Foundation, Inc. 6 2009, 2010 Free Software Foundation, Inc.
8 7
9 This program is free software: you can redistribute it and/or modify 8 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
@@ -46,7 +45,7 @@
46#define YYBISON 1 45#define YYBISON 1
47 46
48/* Bison version. */ 47/* Bison version. */
49#define YYBISON_VERSION "2.4.1" 48#define YYBISON_VERSION "2.4.3"
50 49
51/* Skeleton name. */ 50/* Skeleton name. */
52#define YYSKELETON_NAME "yacc.c" 51#define YYSKELETON_NAME "yacc.c"
@@ -102,22 +101,18 @@ extern int zconflex(void);
102static void zconfprint(const char *err, ...); 101static void zconfprint(const char *err, ...);
103static void zconf_error(const char *err, ...); 102static void zconf_error(const char *err, ...);
104static void zconferror(const char *err); 103static void zconferror(const char *err);
105static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken); 104static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
106 105
107struct symbol *symbol_hash[SYMBOL_HASHSIZE]; 106struct symbol *symbol_hash[SYMBOL_HASHSIZE];
108 107
109static struct menu *current_menu, *current_entry; 108static struct menu *current_menu, *current_entry;
110 109
111#define YYDEBUG 0
112#if YYDEBUG
113#define YYERROR_VERBOSE
114#endif
115 110
116 111
117 112
118/* Enabling traces. */ 113/* Enabling traces. */
119#ifndef YYDEBUG 114#ifndef YYDEBUG
120# define YYDEBUG 0 115# define YYDEBUG 1
121#endif 116#endif
122 117
123/* Enabling verbose error messages. */ 118/* Enabling verbose error messages. */
@@ -188,7 +183,7 @@ typedef union YYSTYPE
188 struct symbol *symbol; 183 struct symbol *symbol;
189 struct expr *expr; 184 struct expr *expr;
190 struct menu *menu; 185 struct menu *menu;
191 struct kconf_id *id; 186 const struct kconf_id *id;
192 187
193 188
194 189
@@ -255,7 +250,7 @@ typedef short int yytype_int16;
255#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 250#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
256 251
257#ifndef YY_ 252#ifndef YY_
258# if YYENABLE_NLS 253# if defined YYENABLE_NLS && YYENABLE_NLS
259# if ENABLE_NLS 254# if ENABLE_NLS
260# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 255# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
261# define YY_(msgid) dgettext ("bison-runtime", msgid) 256# define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -535,18 +530,18 @@ static const yytype_int8 yyrhs[] =
535/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 530/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
536static const yytype_uint16 yyrline[] = 531static const yytype_uint16 yyrline[] =
537{ 532{
538 0, 108, 108, 108, 110, 110, 112, 114, 115, 116, 533 0, 104, 104, 104, 106, 106, 108, 110, 111, 112,
539 117, 118, 119, 123, 127, 127, 127, 127, 127, 127, 534 113, 114, 115, 119, 123, 123, 123, 123, 123, 123,
540 127, 127, 131, 132, 133, 134, 135, 136, 140, 141, 535 123, 123, 127, 128, 129, 130, 131, 132, 136, 137,
541 147, 155, 161, 169, 179, 181, 182, 183, 184, 185, 536 143, 151, 157, 165, 175, 177, 178, 179, 180, 181,
542 186, 189, 197, 203, 213, 219, 225, 228, 230, 241, 537 182, 185, 193, 199, 209, 215, 221, 224, 226, 237,
543 242, 247, 256, 261, 269, 272, 274, 275, 276, 277, 538 238, 243, 252, 257, 265, 268, 270, 271, 272, 273,
544 278, 281, 287, 298, 304, 314, 316, 321, 329, 337, 539 274, 277, 283, 294, 300, 310, 312, 317, 325, 333,
545 340, 342, 343, 344, 349, 356, 363, 368, 376, 379, 540 336, 338, 339, 340, 345, 352, 359, 364, 372, 375,
546 381, 382, 383, 386, 394, 401, 408, 414, 421, 423, 541 377, 378, 379, 382, 390, 397, 404, 410, 417, 419,
547 424, 425, 428, 436, 438, 439, 442, 449, 451, 456, 542 420, 421, 424, 432, 434, 435, 438, 445, 447, 452,
548 457, 460, 461, 462, 466, 467, 470, 471, 474, 475, 543 453, 456, 457, 458, 462, 463, 466, 467, 470, 471,
549 476, 477, 478, 479, 480, 483, 484, 487, 488 544 472, 473, 474, 475, 476, 479, 480, 483, 484
550}; 545};
551#endif 546#endif
552 547
@@ -806,9 +801,18 @@ static const yytype_uint8 yystos[] =
806 801
807/* Like YYERROR except do call yyerror. This remains here temporarily 802/* Like YYERROR except do call yyerror. This remains here temporarily
808 to ease the transition to the new meaning of YYERROR, for GCC. 803 to ease the transition to the new meaning of YYERROR, for GCC.
809 Once GCC version 2 has supplanted version 1, this can go. */ 804 Once GCC version 2 has supplanted version 1, this can go. However,
805 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
806 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
807 discussed. */
810 808
811#define YYFAIL goto yyerrlab 809#define YYFAIL goto yyerrlab
810#if defined YYFAIL
811 /* This is here to suppress warnings from the GCC cpp's
812 -Wunused-macros. Normally we don't worry about that warning, but
813 some users do, and we want to make it easy for users to remove
814 YYFAIL uses, which will produce warnings from Bison 2.5. */
815#endif
812 816
813#define YYRECOVERING() (!!yyerrstatus) 817#define YYRECOVERING() (!!yyerrstatus)
814 818
@@ -865,7 +869,7 @@ while (YYID (0))
865 we won't break user code: when these are the locations we know. */ 869 we won't break user code: when these are the locations we know. */
866 870
867#ifndef YY_LOCATION_PRINT 871#ifndef YY_LOCATION_PRINT
868# if YYLTYPE_IS_TRIVIAL 872# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
869# define YY_LOCATION_PRINT(File, Loc) \ 873# define YY_LOCATION_PRINT(File, Loc) \
870 fprintf (File, "%d.%d-%d.%d", \ 874 fprintf (File, "%d.%d-%d.%d", \
871 (Loc).first_line, (Loc).first_column, \ 875 (Loc).first_line, (Loc).first_column, \
@@ -1753,7 +1757,7 @@ yyreduce:
1753 case 48: 1757 case 48:
1754 1758
1755 { 1759 {
1756 struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string))); 1760 const struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
1757 if (id && id->flags & TF_OPTION) 1761 if (id && id->flags & TF_OPTION)
1758 menu_add_option(id->token, (yyvsp[(3) - (3)].string)); 1762 menu_add_option(id->token, (yyvsp[(3) - (3)].string));
1759 else 1763 else
@@ -2258,10 +2262,8 @@ void conf_parse(const char *name)
2258 modules_sym->flags |= SYMBOL_AUTO; 2262 modules_sym->flags |= SYMBOL_AUTO;
2259 rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); 2263 rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
2260 2264
2261#if YYDEBUG
2262 if (getenv("ZCONF_DEBUG")) 2265 if (getenv("ZCONF_DEBUG"))
2263 zconfdebug = 1; 2266 zconfdebug = 1;
2264#endif
2265 zconfparse(); 2267 zconfparse();
2266 if (zconfnerrs) 2268 if (zconfnerrs)
2267 exit(1); 2269 exit(1);
@@ -2300,7 +2302,7 @@ static const char *zconf_tokenname(int token)
2300 return "<token>"; 2302 return "<token>";
2301} 2303}
2302 2304
2303static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken) 2305static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken)
2304{ 2306{
2305 if (id->token != endtoken) { 2307 if (id->token != endtoken) {
2306 zconf_error("unexpected '%s' within %s block", 2308 zconf_error("unexpected '%s' within %s block",
@@ -2345,9 +2347,7 @@ static void zconf_error(const char *err, ...)
2345 2347
2346static void zconferror(const char *err) 2348static void zconferror(const char *err)
2347{ 2349{
2348#if YYDEBUG
2349 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err); 2350 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
2350#endif
2351} 2351}
2352 2352
2353static void print_quoted_string(FILE *out, const char *str) 2353static void print_quoted_string(FILE *out, const char *str)
@@ -2496,7 +2496,7 @@ void zconfdump(FILE *out)
2496 } 2496 }
2497} 2497}
2498 2498
2499#include "lex.zconf.c" 2499#include "zconf.lex.c"
2500#include "util.c" 2500#include "util.c"
2501#include "confdata.c" 2501#include "confdata.c"
2502#include "expr.c" 2502#include "expr.c"
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 49fb4ab664c3..c38cc5aa8ed1 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -25,16 +25,12 @@ extern int zconflex(void);
25static void zconfprint(const char *err, ...); 25static void zconfprint(const char *err, ...);
26static void zconf_error(const char *err, ...); 26static void zconf_error(const char *err, ...);
27static void zconferror(const char *err); 27static void zconferror(const char *err);
28static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken); 28static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
29 29
30struct symbol *symbol_hash[SYMBOL_HASHSIZE]; 30struct symbol *symbol_hash[SYMBOL_HASHSIZE];
31 31
32static struct menu *current_menu, *current_entry; 32static struct menu *current_menu, *current_entry;
33 33
34#define YYDEBUG 0
35#if YYDEBUG
36#define YYERROR_VERBOSE
37#endif
38%} 34%}
39%expect 30 35%expect 30
40 36
@@ -45,7 +41,7 @@ static struct menu *current_menu, *current_entry;
45 struct symbol *symbol; 41 struct symbol *symbol;
46 struct expr *expr; 42 struct expr *expr;
47 struct menu *menu; 43 struct menu *menu;
48 struct kconf_id *id; 44 const struct kconf_id *id;
49} 45}
50 46
51%token <id>T_MAINMENU 47%token <id>T_MAINMENU
@@ -229,7 +225,7 @@ symbol_option_list:
229 /* empty */ 225 /* empty */
230 | symbol_option_list T_WORD symbol_option_arg 226 | symbol_option_list T_WORD symbol_option_arg
231{ 227{
232 struct kconf_id *id = kconf_id_lookup($2, strlen($2)); 228 const struct kconf_id *id = kconf_id_lookup($2, strlen($2));
233 if (id && id->flags & TF_OPTION) 229 if (id && id->flags & TF_OPTION)
234 menu_add_option(id->token, $3); 230 menu_add_option(id->token, $3);
235 else 231 else
@@ -503,10 +499,8 @@ void conf_parse(const char *name)
503 modules_sym->flags |= SYMBOL_AUTO; 499 modules_sym->flags |= SYMBOL_AUTO;
504 rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); 500 rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
505 501
506#if YYDEBUG
507 if (getenv("ZCONF_DEBUG")) 502 if (getenv("ZCONF_DEBUG"))
508 zconfdebug = 1; 503 zconfdebug = 1;
509#endif
510 zconfparse(); 504 zconfparse();
511 if (zconfnerrs) 505 if (zconfnerrs)
512 exit(1); 506 exit(1);
@@ -545,7 +539,7 @@ static const char *zconf_tokenname(int token)
545 return "<token>"; 539 return "<token>";
546} 540}
547 541
548static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken) 542static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken)
549{ 543{
550 if (id->token != endtoken) { 544 if (id->token != endtoken) {
551 zconf_error("unexpected '%s' within %s block", 545 zconf_error("unexpected '%s' within %s block",
@@ -590,9 +584,7 @@ static void zconf_error(const char *err, ...)
590 584
591static void zconferror(const char *err) 585static void zconferror(const char *err)
592{ 586{
593#if YYDEBUG
594 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err); 587 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
595#endif
596} 588}
597 589
598static void print_quoted_string(FILE *out, const char *str) 590static void print_quoted_string(FILE *out, const char *str)
@@ -741,7 +733,7 @@ void zconfdump(FILE *out)
741 } 733 }
742} 734}
743 735
744#include "lex.zconf.c" 736#include "zconf.lex.c"
745#include "util.c" 737#include "util.c"
746#include "confdata.c" 738#include "confdata.c"
747#include "expr.c" 739#include "expr.c"
diff --git a/scripts/mkmakefile b/scripts/mkmakefile
index 5325423ceab4..0cc044260744 100644
--- a/scripts/mkmakefile
+++ b/scripts/mkmakefile
@@ -30,6 +30,13 @@ PATCHLEVEL = $4
30lastword = \$(word \$(words \$(1)),\$(1)) 30lastword = \$(word \$(words \$(1)),\$(1))
31makedir := \$(dir \$(call lastword,\$(MAKEFILE_LIST))) 31makedir := \$(dir \$(call lastword,\$(MAKEFILE_LIST)))
32 32
33ifeq ("\$(origin V)", "command line")
34VERBOSE := \$(V)
35endif
36ifneq (\$(VERBOSE),1)
37Q := @
38endif
39
33MAKEARGS := -C $1 40MAKEARGS := -C $1
34MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$(makedir)) 41MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$(makedir))
35 42
@@ -40,7 +47,7 @@ MAKEFLAGS += --no-print-directory
40all := \$(filter-out all Makefile,\$(MAKECMDGOALS)) 47all := \$(filter-out all Makefile,\$(MAKECMDGOALS))
41 48
42all: 49all:
43 \$(MAKE) \$(MAKEARGS) \$(all) 50 \$(Q)\$(MAKE) \$(MAKEARGS) \$(all)
44 51
45Makefile:; 52Makefile:;
46 53
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 413c53693e62..a509ff8f32fa 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -254,6 +254,28 @@ static enum export export_no(const char *s)
254 return export_unknown; 254 return export_unknown;
255} 255}
256 256
257static const char *sec_name(struct elf_info *elf, int secindex);
258
259#define strstarts(str, prefix) (strncmp(str, prefix, strlen(prefix)) == 0)
260
261static enum export export_from_secname(struct elf_info *elf, unsigned int sec)
262{
263 const char *secname = sec_name(elf, sec);
264
265 if (strstarts(secname, "___ksymtab+"))
266 return export_plain;
267 else if (strstarts(secname, "___ksymtab_unused+"))
268 return export_unused;
269 else if (strstarts(secname, "___ksymtab_gpl+"))
270 return export_gpl;
271 else if (strstarts(secname, "___ksymtab_unused_gpl+"))
272 return export_unused_gpl;
273 else if (strstarts(secname, "___ksymtab_gpl_future+"))
274 return export_gpl_future;
275 else
276 return export_unknown;
277}
278
257static enum export export_from_sec(struct elf_info *elf, unsigned int sec) 279static enum export export_from_sec(struct elf_info *elf, unsigned int sec)
258{ 280{
259 if (sec == elf->export_sec) 281 if (sec == elf->export_sec)
@@ -563,7 +585,12 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
563 Elf_Sym *sym, const char *symname) 585 Elf_Sym *sym, const char *symname)
564{ 586{
565 unsigned int crc; 587 unsigned int crc;
566 enum export export = export_from_sec(info, get_secindex(info, sym)); 588 enum export export;
589
590 if (!is_vmlinux(mod->name) && strncmp(symname, "__ksymtab", 9) == 0)
591 export = export_from_secname(info, get_secindex(info, sym));
592 else
593 export = export_from_sec(info, get_secindex(info, sym));
567 594
568 switch (sym->st_shndx) { 595 switch (sym->st_shndx) {
569 case SHN_COMMON: 596 case SHN_COMMON:
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 006960ebbce9..bc6aa003860e 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -118,10 +118,12 @@ perf-tar=perf-$(KERNELVERSION)
118 118
119quiet_cmd_perf_tar = TAR 119quiet_cmd_perf_tar = TAR
120 cmd_perf_tar = \ 120 cmd_perf_tar = \
121git archive --prefix=$(perf-tar)/ HEAD^{tree} \ 121git --git-dir=$(srctree)/.git archive --prefix=$(perf-tar)/ \
122 $$(cat $(srctree)/tools/perf/MANIFEST) -o $(perf-tar).tar; \ 122 HEAD^{tree} $$(cd $(srctree); \
123 echo $$(cat $(srctree)/tools/perf/MANIFEST)) \
124 -o $(perf-tar).tar; \
123mkdir -p $(perf-tar); \ 125mkdir -p $(perf-tar); \
124git rev-parse HEAD > $(perf-tar)/HEAD; \ 126git --git-dir=$(srctree)/.git rev-parse HEAD > $(perf-tar)/HEAD; \
125tar rf $(perf-tar).tar $(perf-tar)/HEAD; \ 127tar rf $(perf-tar).tar $(perf-tar)/HEAD; \
126rm -r $(perf-tar); \ 128rm -r $(perf-tar); \
127$(if $(findstring tar-src,$@),, \ 129$(if $(findstring tar-src,$@),, \