aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-04-19 21:32:26 -0400
committerDave Airlie <airlied@redhat.com>2015-04-19 23:05:20 -0400
commit2c33ce009ca2389dbf0535d0672214d09738e35e (patch)
tree6186a6458c3c160385d794a23eaf07c786a9e61b /scripts
parentcec32a47010647e8b0603726ebb75b990a4057a4 (diff)
parent09d51602cf84a1264946711dd4ea0dddbac599a1 (diff)
Merge Linus master into drm-next
The merge is clean, but the arm build fails afterwards, due to API changes in the regulator tree. I've included the patch into the merge to fix the build. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.dtbinst2
-rw-r--r--scripts/Makefile.fwinst2
-rw-r--r--scripts/Makefile.kasan8
-rwxr-xr-xscripts/checkpatch.pl164
-rw-r--r--scripts/coccinelle/misc/bugon.cocci2
-rw-r--r--scripts/kallsyms.c29
-rw-r--r--scripts/kconfig/Makefile80
-rw-r--r--scripts/kconfig/conf.c8
-rw-r--r--scripts/kconfig/confdata.c5
-rw-r--r--scripts/kconfig/expr.c22
-rw-r--r--scripts/kconfig/expr.h5
-rw-r--r--scripts/kconfig/gconf.c29
-rw-r--r--scripts/kconfig/lkc.h14
-rw-r--r--scripts/kconfig/lkc_proto.h85
-rw-r--r--scripts/kconfig/mconf.c31
-rw-r--r--scripts/kconfig/menu.c4
-rwxr-xr-xscripts/kconfig/merge_config.sh27
-rw-r--r--scripts/kconfig/nconf.c5
-rw-r--r--scripts/kconfig/qconf.cc5
-rw-r--r--scripts/kconfig/symbol.c42
-rw-r--r--scripts/kconfig/util.c10
-rw-r--r--scripts/mod/devicetable-offsets.c3
-rw-r--r--scripts/mod/file2alias.c16
-rw-r--r--scripts/spelling.txt1
-rw-r--r--scripts/xen-hypercalls.sh12
25 files changed, 376 insertions, 235 deletions
diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst
index 909ed7a2ac61..1c15717e0d56 100644
--- a/scripts/Makefile.dtbinst
+++ b/scripts/Makefile.dtbinst
@@ -18,7 +18,7 @@ export dtbinst-root ?= $(obj)
18 18
19include include/config/auto.conf 19include include/config/auto.conf
20include scripts/Kbuild.include 20include scripts/Kbuild.include
21include $(srctree)/$(obj)/Makefile 21include $(src)/Makefile
22 22
23PHONY += __dtbs_install_prep 23PHONY += __dtbs_install_prep
24__dtbs_install_prep: 24__dtbs_install_prep:
diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst
index 5b698add4f31..b27290035253 100644
--- a/scripts/Makefile.fwinst
+++ b/scripts/Makefile.fwinst
@@ -13,7 +13,7 @@ src := $(obj)
13-include $(objtree)/.config 13-include $(objtree)/.config
14 14
15include scripts/Kbuild.include 15include scripts/Kbuild.include
16include $(srctree)/$(obj)/Makefile 16include $(src)/Makefile
17 17
18include scripts/Makefile.host 18include scripts/Makefile.host
19 19
diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan
index 631619b2b118..3f874d24234f 100644
--- a/scripts/Makefile.kasan
+++ b/scripts/Makefile.kasan
@@ -13,12 +13,16 @@ CFLAGS_KASAN := $(call cc-option, -fsanitize=kernel-address \
13 --param asan-instrumentation-with-call-threshold=$(call_threshold)) 13 --param asan-instrumentation-with-call-threshold=$(call_threshold))
14 14
15ifeq ($(call cc-option, $(CFLAGS_KASAN_MINIMAL) -Werror),) 15ifeq ($(call cc-option, $(CFLAGS_KASAN_MINIMAL) -Werror),)
16 ifneq ($(CONFIG_COMPILE_TEST),y)
16 $(warning Cannot use CONFIG_KASAN: \ 17 $(warning Cannot use CONFIG_KASAN: \
17 -fsanitize=kernel-address is not supported by compiler) 18 -fsanitize=kernel-address is not supported by compiler)
19 endif
18else 20else
19 ifeq ($(CFLAGS_KASAN),) 21 ifeq ($(CFLAGS_KASAN),)
20 $(warning CONFIG_KASAN: compiler does not support all options.\ 22 ifneq ($(CONFIG_COMPILE_TEST),y)
21 Trying minimal configuration) 23 $(warning CONFIG_KASAN: compiler does not support all options.\
24 Trying minimal configuration)
25 endif
22 CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL) 26 CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL)
23 endif 27 endif
24endif 28endif
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d12435992dea..89b1df4e72ab 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -47,6 +47,8 @@ my $ignore_perl_version = 0;
47my $minimum_perl_version = 5.10.0; 47my $minimum_perl_version = 5.10.0;
48my $min_conf_desc_length = 4; 48my $min_conf_desc_length = 4;
49my $spelling_file = "$D/spelling.txt"; 49my $spelling_file = "$D/spelling.txt";
50my $codespell = 0;
51my $codespellfile = "/usr/local/share/codespell/dictionary.txt";
50 52
51sub help { 53sub help {
52 my ($exitcode) = @_; 54 my ($exitcode) = @_;
@@ -88,6 +90,9 @@ Options:
88 file. It's your fault if there's no backup or git 90 file. It's your fault if there's no backup or git
89 --ignore-perl-version override checking of perl version. expect 91 --ignore-perl-version override checking of perl version. expect
90 runtime errors. 92 runtime errors.
93 --codespell Use the codespell dictionary for spelling/typos
94 (default:/usr/local/share/codespell/dictionary.txt)
95 --codespellfile Use this codespell dictionary
91 -h, --help, --version display this help and exit 96 -h, --help, --version display this help and exit
92 97
93When FILE is - read standard input. 98When FILE is - read standard input.
@@ -146,6 +151,8 @@ GetOptions(
146 'ignore-perl-version!' => \$ignore_perl_version, 151 'ignore-perl-version!' => \$ignore_perl_version,
147 'debug=s' => \%debug, 152 'debug=s' => \%debug,
148 'test-only=s' => \$tst_only, 153 'test-only=s' => \$tst_only,
154 'codespell!' => \$codespell,
155 'codespellfile=s' => \$codespellfile,
149 'h|help' => \$help, 156 'h|help' => \$help,
150 'version' => \$help 157 'version' => \$help
151) or help(1); 158) or help(1);
@@ -316,6 +323,7 @@ our $Operators = qr{
316 323
317our $c90_Keywords = qr{do|for|while|if|else|return|goto|continue|switch|default|case|break}x; 324our $c90_Keywords = qr{do|for|while|if|else|return|goto|continue|switch|default|case|break}x;
318 325
326our $BasicType;
319our $NonptrType; 327our $NonptrType;
320our $NonptrTypeMisordered; 328our $NonptrTypeMisordered;
321our $NonptrTypeWithAttr; 329our $NonptrTypeWithAttr;
@@ -436,6 +444,14 @@ foreach my $entry (@mode_permission_funcs) {
436 $mode_perms_search .= $entry->[0]; 444 $mode_perms_search .= $entry->[0];
437} 445}
438 446
447our $mode_perms_world_writable = qr{
448 S_IWUGO |
449 S_IWOTH |
450 S_IRWXUGO |
451 S_IALLUGO |
452 0[0-7][0-7][2367]
453}x;
454
439our $allowed_asm_includes = qr{(?x: 455our $allowed_asm_includes = qr{(?x:
440 irq| 456 irq|
441 memory| 457 memory|
@@ -449,7 +465,6 @@ my $misspellings;
449my %spelling_fix; 465my %spelling_fix;
450 466
451if (open(my $spelling, '<', $spelling_file)) { 467if (open(my $spelling, '<', $spelling_file)) {
452 my @spelling_list;
453 while (<$spelling>) { 468 while (<$spelling>) {
454 my $line = $_; 469 my $line = $_;
455 470
@@ -461,21 +476,50 @@ if (open(my $spelling, '<', $spelling_file)) {
461 476
462 my ($suspect, $fix) = split(/\|\|/, $line); 477 my ($suspect, $fix) = split(/\|\|/, $line);
463 478
464 push(@spelling_list, $suspect);
465 $spelling_fix{$suspect} = $fix; 479 $spelling_fix{$suspect} = $fix;
466 } 480 }
467 close($spelling); 481 close($spelling);
468 $misspellings = join("|", @spelling_list);
469} else { 482} else {
470 warn "No typos will be found - file '$spelling_file': $!\n"; 483 warn "No typos will be found - file '$spelling_file': $!\n";
471} 484}
472 485
486if ($codespell) {
487 if (open(my $spelling, '<', $codespellfile)) {
488 while (<$spelling>) {
489 my $line = $_;
490
491 $line =~ s/\s*\n?$//g;
492 $line =~ s/^\s*//g;
493
494 next if ($line =~ m/^\s*#/);
495 next if ($line =~ m/^\s*$/);
496 next if ($line =~ m/, disabled/i);
497
498 $line =~ s/,.*$//;
499
500 my ($suspect, $fix) = split(/->/, $line);
501
502 $spelling_fix{$suspect} = $fix;
503 }
504 close($spelling);
505 } else {
506 warn "No codespell typos will be found - file '$codespellfile': $!\n";
507 }
508}
509
510$misspellings = join("|", sort keys %spelling_fix) if keys %spelling_fix;
511
473sub build_types { 512sub build_types {
474 my $mods = "(?x: \n" . join("|\n ", @modifierList) . "\n)"; 513 my $mods = "(?x: \n" . join("|\n ", @modifierList) . "\n)";
475 my $all = "(?x: \n" . join("|\n ", @typeList) . "\n)"; 514 my $all = "(?x: \n" . join("|\n ", @typeList) . "\n)";
476 my $Misordered = "(?x: \n" . join("|\n ", @typeListMisordered) . "\n)"; 515 my $Misordered = "(?x: \n" . join("|\n ", @typeListMisordered) . "\n)";
477 my $allWithAttr = "(?x: \n" . join("|\n ", @typeListWithAttr) . "\n)"; 516 my $allWithAttr = "(?x: \n" . join("|\n ", @typeListWithAttr) . "\n)";
478 $Modifier = qr{(?:$Attribute|$Sparse|$mods)}; 517 $Modifier = qr{(?:$Attribute|$Sparse|$mods)};
518 $BasicType = qr{
519 (?:$typeOtherOSTypedefs\b)|
520 (?:$typeTypedefs\b)|
521 (?:${all}\b)
522 }x;
479 $NonptrType = qr{ 523 $NonptrType = qr{
480 (?:$Modifier\s+|const\s+)* 524 (?:$Modifier\s+|const\s+)*
481 (?: 525 (?:
@@ -1646,7 +1690,7 @@ sub fix_inserted_deleted_lines {
1646 foreach my $old_line (@{$linesRef}) { 1690 foreach my $old_line (@{$linesRef}) {
1647 my $save_line = 1; 1691 my $save_line = 1;
1648 my $line = $old_line; #don't modify the array 1692 my $line = $old_line; #don't modify the array
1649 if ($line =~ /^(?:\+\+\+\|\-\-\-)\s+\S+/) { #new filename 1693 if ($line =~ /^(?:\+\+\+|\-\-\-)\s+\S+/) { #new filename
1650 $delta_offset = 0; 1694 $delta_offset = 0;
1651 } elsif ($line =~ /^\@\@ -\d+,\d+ \+\d+,\d+ \@\@/) { #new hunk 1695 } elsif ($line =~ /^\@\@ -\d+,\d+ \+\d+,\d+ \@\@/) { #new hunk
1652 $range_last_linenr = $new_linenr; 1696 $range_last_linenr = $new_linenr;
@@ -1854,6 +1898,7 @@ sub process {
1854 1898
1855 my $in_header_lines = $file ? 0 : 1; 1899 my $in_header_lines = $file ? 0 : 1;
1856 my $in_commit_log = 0; #Scanning lines before patch 1900 my $in_commit_log = 0; #Scanning lines before patch
1901 my $commit_log_long_line = 0;
1857 my $reported_maintainer_file = 0; 1902 my $reported_maintainer_file = 0;
1858 my $non_utf8_charset = 0; 1903 my $non_utf8_charset = 0;
1859 1904
@@ -2189,6 +2234,14 @@ sub process {
2189 "Remove Gerrit Change-Id's before submitting upstream.\n" . $herecurr); 2234 "Remove Gerrit Change-Id's before submitting upstream.\n" . $herecurr);
2190 } 2235 }
2191 2236
2237# Check for line lengths > 75 in commit log, warn once
2238 if ($in_commit_log && !$commit_log_long_line &&
2239 length($line) > 75) {
2240 WARN("COMMIT_LOG_LONG_LINE",
2241 "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr);
2242 $commit_log_long_line = 1;
2243 }
2244
2192# Check for git id commit length and improperly formed commit descriptions 2245# Check for git id commit length and improperly formed commit descriptions
2193 if ($in_commit_log && $line =~ /\b(c)ommit\s+([0-9a-f]{5,})/i) { 2246 if ($in_commit_log && $line =~ /\b(c)ommit\s+([0-9a-f]{5,})/i) {
2194 my $init_char = $1; 2247 my $init_char = $1;
@@ -2303,8 +2356,9 @@ sub process {
2303 } 2356 }
2304 2357
2305# Check for various typo / spelling mistakes 2358# Check for various typo / spelling mistakes
2306 if (defined($misspellings) && ($in_commit_log || $line =~ /^\+/)) { 2359 if (defined($misspellings) &&
2307 while ($rawline =~ /(?:^|[^a-z@])($misspellings)(?:$|[^a-z@])/gi) { 2360 ($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) {
2361 while ($rawline =~ /(?:^|[^a-z@])($misspellings)(?:\b|$|[^a-z@])/gi) {
2308 my $typo = $1; 2362 my $typo = $1;
2309 my $typo_fix = $spelling_fix{lc($typo)}; 2363 my $typo_fix = $spelling_fix{lc($typo)};
2310 $typo_fix = ucfirst($typo_fix) if ($typo =~ /^[A-Z]/); 2364 $typo_fix = ucfirst($typo_fix) if ($typo =~ /^[A-Z]/);
@@ -2459,8 +2513,9 @@ sub process {
2459#line length limit 2513#line length limit
2460 if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ && 2514 if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
2461 $rawline !~ /^.\s*\*\s*\@$Ident\s/ && 2515 $rawline !~ /^.\s*\*\s*\@$Ident\s/ &&
2462 !($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(KERN_\S+\s*|[^"]*))?"[X\t]*"\s*(?:|,|\)\s*;)\s*$/ || 2516 !($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(KERN_\S+\s*|[^"]*))?$String\s*(?:|,|\)\s*;)\s*$/ ||
2463 $line =~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) && 2517 $line =~ /^\+\s*$String\s*(?:\s*|,|\)\s*;)\s*$/ ||
2518 $line =~ /^\+\s*#\s*define\s+\w+\s+$String$/) &&
2464 $length > $max_line_length) 2519 $length > $max_line_length)
2465 { 2520 {
2466 WARN("LONG_LINE", 2521 WARN("LONG_LINE",
@@ -2552,8 +2607,15 @@ sub process {
2552 } 2607 }
2553 } 2608 }
2554 2609
2555 if ($line =~ /^\+.*(\w+\s*)?\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic|[,;:\?\(\{\}\[\<\>]|&&|\|\||\\$)/ && 2610# check for space after cast like "(int) foo" or "(struct foo) bar"
2556 (!defined($1) || $1 !~ /sizeof\s*/)) { 2611# avoid checking a few false positives:
2612# "sizeof(<type>)" or "__alignof__(<type>)"
2613# function pointer declarations like "(*foo)(int) = bar;"
2614# structure definitions like "(struct foo) { 0 };"
2615# multiline macros that define functions
2616# known attributes or the __attribute__ keyword
2617 if ($line =~ /^\+(.*)\(\s*$Type\s*\)([ \t]++)((?![={]|\\$|$Attribute|__attribute__))/ &&
2618 (!defined($1) || $1 !~ /\b(?:sizeof|__alignof__)\s*$/)) {
2557 if (CHK("SPACING", 2619 if (CHK("SPACING",
2558 "No space is necessary after a cast\n" . $herecurr) && 2620 "No space is necessary after a cast\n" . $herecurr) &&
2559 $fix) { 2621 $fix) {
@@ -3146,6 +3208,18 @@ sub process {
3146 $herecurr); 3208 $herecurr);
3147 } 3209 }
3148 3210
3211# check for const <foo> const where <foo> is not a pointer or array type
3212 if ($sline =~ /\bconst\s+($BasicType)\s+const\b/) {
3213 my $found = $1;
3214 if ($sline =~ /\bconst\s+\Q$found\E\s+const\b\s*\*/) {
3215 WARN("CONST_CONST",
3216 "'const $found const *' should probably be 'const $found * const'\n" . $herecurr);
3217 } elsif ($sline !~ /\bconst\s+\Q$found\E\s+const\s+\w+\s*\[/) {
3218 WARN("CONST_CONST",
3219 "'const $found const' should probably be 'const $found'\n" . $herecurr);
3220 }
3221 }
3222
3149# check for non-global char *foo[] = {"bar", ...} declarations. 3223# check for non-global char *foo[] = {"bar", ...} declarations.
3150 if ($line =~ /^.\s+(?:static\s+|const\s+)?char\s+\*\s*\w+\s*\[\s*\]\s*=\s*\{/) { 3224 if ($line =~ /^.\s+(?:static\s+|const\s+)?char\s+\*\s*\w+\s*\[\s*\]\s*=\s*\{/) {
3151 WARN("STATIC_CONST_CHAR_ARRAY", 3225 WARN("STATIC_CONST_CHAR_ARRAY",
@@ -3153,6 +3227,19 @@ sub process {
3153 $herecurr); 3227 $herecurr);
3154 } 3228 }
3155 3229
3230# check for sizeof(foo)/sizeof(foo[0]) that could be ARRAY_SIZE(foo)
3231 if ($line =~ m@\bsizeof\s*\(\s*($Lval)\s*\)@) {
3232 my $array = $1;
3233 if ($line =~ m@\b(sizeof\s*\(\s*\Q$array\E\s*\)\s*/\s*sizeof\s*\(\s*\Q$array\E\s*\[\s*0\s*\]\s*\))@) {
3234 my $array_div = $1;
3235 if (WARN("ARRAY_SIZE",
3236 "Prefer ARRAY_SIZE($array)\n" . $herecurr) &&
3237 $fix) {
3238 $fixed[$fixlinenr] =~ s/\Q$array_div\E/ARRAY_SIZE($array)/;
3239 }
3240 }
3241 }
3242
3156# check for function declarations without arguments like "int foo()" 3243# check for function declarations without arguments like "int foo()"
3157 if ($line =~ /(\b$Type\s+$Ident)\s*\(\s*\)/) { 3244 if ($line =~ /(\b$Type\s+$Ident)\s*\(\s*\)/) {
3158 if (ERROR("FUNCTION_WITHOUT_ARGS", 3245 if (ERROR("FUNCTION_WITHOUT_ARGS",
@@ -3309,6 +3396,14 @@ sub process {
3309 "Prefer dev_$level(... to dev_printk(KERN_$orig, ...\n" . $herecurr); 3396 "Prefer dev_$level(... to dev_printk(KERN_$orig, ...\n" . $herecurr);
3310 } 3397 }
3311 3398
3399# ENOSYS means "bad syscall nr" and nothing else. This will have a small
3400# number of false positives, but assembly files are not checked, so at
3401# least the arch entry code will not trigger this warning.
3402 if ($line =~ /\bENOSYS\b/) {
3403 WARN("ENOSYS",
3404 "ENOSYS means 'invalid syscall nr' and nothing else\n" . $herecurr);
3405 }
3406
3312# function brace can't be on same line, except for #defines of do while, 3407# function brace can't be on same line, except for #defines of do while,
3313# or if closed on same line 3408# or if closed on same line
3314 if (($line=~/$Type\s*$Ident\(.*\).*\s*{/) and 3409 if (($line=~/$Type\s*$Ident\(.*\).*\s*{/) and
@@ -3565,7 +3660,7 @@ sub process {
3565 3660
3566 # Ignore operators passed as parameters. 3661 # Ignore operators passed as parameters.
3567 if ($op_type ne 'V' && 3662 if ($op_type ne 'V' &&
3568 $ca =~ /\s$/ && $cc =~ /^\s*,/) { 3663 $ca =~ /\s$/ && $cc =~ /^\s*[,\)]/) {
3569 3664
3570# # Ignore comments 3665# # Ignore comments
3571# } elsif ($op =~ /^$;+$/) { 3666# } elsif ($op =~ /^$;+$/) {
@@ -3750,6 +3845,14 @@ sub process {
3750 $ok = 1; 3845 $ok = 1;
3751 } 3846 }
3752 3847
3848 # for asm volatile statements
3849 # ignore a colon with another
3850 # colon immediately before or after
3851 if (($op eq ':') &&
3852 ($ca =~ /:$/ || $cc =~ /^:/)) {
3853 $ok = 1;
3854 }
3855
3753 # messages are ERROR, but ?: are CHK 3856 # messages are ERROR, but ?: are CHK
3754 if ($ok == 0) { 3857 if ($ok == 0) {
3755 my $msg_type = \&ERROR; 3858 my $msg_type = \&ERROR;
@@ -3963,12 +4066,12 @@ sub process {
3963 } 4066 }
3964 } 4067 }
3965 4068
3966# Return of what appears to be an errno should normally be -'ve 4069# Return of what appears to be an errno should normally be negative
3967 if ($line =~ /^.\s*return\s*(E[A-Z]*)\s*;/) { 4070 if ($sline =~ /\breturn(?:\s*\(+\s*|\s+)(E[A-Z]+)(?:\s*\)+\s*|\s*)[;:,]/) {
3968 my $name = $1; 4071 my $name = $1;
3969 if ($name ne 'EOF' && $name ne 'ERROR') { 4072 if ($name ne 'EOF' && $name ne 'ERROR') {
3970 WARN("USE_NEGATIVE_ERRNO", 4073 WARN("USE_NEGATIVE_ERRNO",
3971 "return of an errno should typically be -ve (return -$1)\n" . $herecurr); 4074 "return of an errno should typically be negative (ie: return -$1)\n" . $herecurr);
3972 } 4075 }
3973 } 4076 }
3974 4077
@@ -4178,7 +4281,8 @@ sub process {
4178 } 4281 }
4179 } 4282 }
4180 4283
4181#warn if <asm/foo.h> is #included and <linux/foo.h> is available (uses RAW line) 4284# warn if <asm/foo.h> is #included and <linux/foo.h> is available and includes
4285# itself <asm/foo.h> (uses RAW line)
4182 if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\<asm\/(.*)\.h\>}) { 4286 if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\<asm\/(.*)\.h\>}) {
4183 my $file = "$1.h"; 4287 my $file = "$1.h";
4184 my $checkfile = "include/linux/$file"; 4288 my $checkfile = "include/linux/$file";
@@ -4186,12 +4290,15 @@ sub process {
4186 $realfile ne $checkfile && 4290 $realfile ne $checkfile &&
4187 $1 !~ /$allowed_asm_includes/) 4291 $1 !~ /$allowed_asm_includes/)
4188 { 4292 {
4189 if ($realfile =~ m{^arch/}) { 4293 my $asminclude = `grep -Ec "#include\\s+<asm/$file>" $root/$checkfile`;
4190 CHK("ARCH_INCLUDE_LINUX", 4294 if ($asminclude > 0) {
4191 "Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr); 4295 if ($realfile =~ m{^arch/}) {
4192 } else { 4296 CHK("ARCH_INCLUDE_LINUX",
4193 WARN("INCLUDE_LINUX", 4297 "Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr);
4194 "Use #include <linux/$file> instead of <asm/$file>\n" . $herecurr); 4298 } else {
4299 WARN("INCLUDE_LINUX",
4300 "Use #include <linux/$file> instead of <asm/$file>\n" . $herecurr);
4301 }
4195 } 4302 }
4196 } 4303 }
4197 } 4304 }
@@ -4700,6 +4807,16 @@ sub process {
4700 } 4807 }
4701 } 4808 }
4702 4809
4810# check for __read_mostly with const non-pointer (should just be const)
4811 if ($line =~ /\b__read_mostly\b/ &&
4812 $line =~ /($Type)\s*$Ident/ && $1 !~ /\*\s*$/ && $1 =~ /\bconst\b/) {
4813 if (ERROR("CONST_READ_MOSTLY",
4814 "Invalid use of __read_mostly with const type\n" . $herecurr) &&
4815 $fix) {
4816 $fixed[$fixlinenr] =~ s/\s+__read_mostly\b//;
4817 }
4818 }
4819
4703# don't use __constant_<foo> functions outside of include/uapi/ 4820# don't use __constant_<foo> functions outside of include/uapi/
4704 if ($realfile !~ m@^include/uapi/@ && 4821 if ($realfile !~ m@^include/uapi/@ &&
4705 $line =~ /(__constant_(?:htons|ntohs|[bl]e(?:16|32|64)_to_cpu|cpu_to_[bl]e(?:16|32|64)))\s*\(/) { 4822 $line =~ /(__constant_(?:htons|ntohs|[bl]e(?:16|32|64)_to_cpu|cpu_to_[bl]e(?:16|32|64)))\s*\(/) {
@@ -5261,6 +5378,7 @@ sub process {
5261 stacktrace_ops| 5378 stacktrace_ops|
5262 sysfs_ops| 5379 sysfs_ops|
5263 tty_operations| 5380 tty_operations|
5381 uart_ops|
5264 usb_mon_operations| 5382 usb_mon_operations|
5265 wd_ops}x; 5383 wd_ops}x;
5266 if ($line !~ /\bconst\b/ && 5384 if ($line !~ /\bconst\b/ &&
@@ -5318,8 +5436,8 @@ sub process {
5318 } 5436 }
5319 } 5437 }
5320 5438
5321 if ($line =~ /debugfs_create_file.*S_IWUGO/ || 5439 if ($line =~ /debugfs_create_\w+.*\b$mode_perms_world_writable\b/ ||
5322 $line =~ /DEVICE_ATTR.*S_IWUGO/ ) { 5440 $line =~ /DEVICE_ATTR.*\b$mode_perms_world_writable\b/) {
5323 WARN("EXPORTED_WORLD_WRITABLE", 5441 WARN("EXPORTED_WORLD_WRITABLE",
5324 "Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr); 5442 "Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr);
5325 } 5443 }
diff --git a/scripts/coccinelle/misc/bugon.cocci b/scripts/coccinelle/misc/bugon.cocci
index 3b7eec24fb5a..27c97f1f2767 100644
--- a/scripts/coccinelle/misc/bugon.cocci
+++ b/scripts/coccinelle/misc/bugon.cocci
@@ -57,6 +57,6 @@ coccilib.org.print_todo(p[0], "WARNING use BUG_ON")
57p << r.p; 57p << r.p;
58@@ 58@@
59 59
60msg="WARNING: Use BUG_ON" 60msg="WARNING: Use BUG_ON instead of if condition followed by BUG.\nPlease make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h)"
61coccilib.report.print_report(p[0], msg) 61coccilib.report.print_report(p[0], msg)
62 62
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index c6d33bd15b04..8fa81e84e295 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -212,15 +212,22 @@ static int symbol_valid(struct sym_entry *s)
212 "_SDA_BASE_", /* ppc */ 212 "_SDA_BASE_", /* ppc */
213 "_SDA2_BASE_", /* ppc */ 213 "_SDA2_BASE_", /* ppc */
214 NULL }; 214 NULL };
215
216 static char *special_suffixes[] = {
217 "_veneer", /* arm */
218 NULL };
219
215 int i; 220 int i;
216 int offset = 1; 221 char *sym_name = (char *)s->sym + 1;
222
217 223
218 if (s->addr < kernel_start_addr) 224 if (s->addr < kernel_start_addr)
219 return 0; 225 return 0;
220 226
221 /* skip prefix char */ 227 /* skip prefix char */
222 if (symbol_prefix_char && *(s->sym + 1) == symbol_prefix_char) 228 if (symbol_prefix_char && *sym_name == symbol_prefix_char)
223 offset++; 229 sym_name++;
230
224 231
225 /* if --all-symbols is not specified, then symbols outside the text 232 /* if --all-symbols is not specified, then symbols outside the text
226 * and inittext sections are discarded */ 233 * and inittext sections are discarded */
@@ -235,22 +242,26 @@ static int symbol_valid(struct sym_entry *s)
235 * rules. 242 * rules.
236 */ 243 */
237 if ((s->addr == text_range_text->end && 244 if ((s->addr == text_range_text->end &&
238 strcmp((char *)s->sym + offset, 245 strcmp(sym_name,
239 text_range_text->end_sym)) || 246 text_range_text->end_sym)) ||
240 (s->addr == text_range_inittext->end && 247 (s->addr == text_range_inittext->end &&
241 strcmp((char *)s->sym + offset, 248 strcmp(sym_name,
242 text_range_inittext->end_sym))) 249 text_range_inittext->end_sym)))
243 return 0; 250 return 0;
244 } 251 }
245 252
246 /* Exclude symbols which vary between passes. */ 253 /* Exclude symbols which vary between passes. */
247 if (strstr((char *)s->sym + offset, "_compiled."))
248 return 0;
249
250 for (i = 0; special_symbols[i]; i++) 254 for (i = 0; special_symbols[i]; i++)
251 if( strcmp((char *)s->sym + offset, special_symbols[i]) == 0 ) 255 if (strcmp(sym_name, special_symbols[i]) == 0)
252 return 0; 256 return 0;
253 257
258 for (i = 0; special_suffixes[i]; i++) {
259 int l = strlen(sym_name) - strlen(special_suffixes[i]);
260
261 if (l >= 0 && strcmp(sym_name + l, special_suffixes[i]) == 0)
262 return 0;
263 }
264
254 return 1; 265 return 1;
255} 266}
256 267
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 9645c0739386..d9b1fef0c67e 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -2,7 +2,7 @@
2# Kernel configuration targets 2# Kernel configuration targets
3# These targets are used from top-level makefile 3# These targets are used from top-level makefile
4 4
5PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config \ 5PHONY += xconfig gconfig menuconfig config silentoldconfig update-po-config \
6 localmodconfig localyesconfig 6 localmodconfig localyesconfig
7 7
8ifdef KBUILD_KCONFIG 8ifdef KBUILD_KCONFIG
@@ -11,30 +11,31 @@ else
11Kconfig := Kconfig 11Kconfig := Kconfig
12endif 12endif
13 13
14ifeq ($(quiet),silent_)
15silent := -s
16endif
17
14# We need this, in case the user has it in its environment 18# We need this, in case the user has it in its environment
15unexport CONFIG_ 19unexport CONFIG_
16 20
17xconfig: $(obj)/qconf 21xconfig: $(obj)/qconf
18 $< $(Kconfig) 22 $< $(silent) $(Kconfig)
19 23
20gconfig: $(obj)/gconf 24gconfig: $(obj)/gconf
21 $< $(Kconfig) 25 $< $(silent) $(Kconfig)
22 26
23menuconfig: $(obj)/mconf 27menuconfig: $(obj)/mconf
24 $< $(Kconfig) 28 $< $(silent) $(Kconfig)
25 29
26config: $(obj)/conf 30config: $(obj)/conf
27 $< --oldaskconfig $(Kconfig) 31 $< $(silent) --oldaskconfig $(Kconfig)
28 32
29nconfig: $(obj)/nconf 33nconfig: $(obj)/nconf
30 $< $(Kconfig) 34 $< $(silent) $(Kconfig)
31
32oldconfig: $(obj)/conf
33 $< --$@ $(Kconfig)
34 35
35silentoldconfig: $(obj)/conf 36silentoldconfig: $(obj)/conf
36 $(Q)mkdir -p include/config include/generated 37 $(Q)mkdir -p include/config include/generated
37 $< --$@ $(Kconfig) 38 $< $(silent) --$@ $(Kconfig)
38 39
39localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf 40localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
40 $(Q)mkdir -p include/config include/generated 41 $(Q)mkdir -p include/config include/generated
@@ -43,18 +44,18 @@ localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
43 cmp -s .tmp.config .config || \ 44 cmp -s .tmp.config .config || \
44 (mv -f .config .config.old.1; \ 45 (mv -f .config .config.old.1; \
45 mv -f .tmp.config .config; \ 46 mv -f .tmp.config .config; \
46 $(obj)/conf --silentoldconfig $(Kconfig); \ 47 $(obj)/conf $(silent) --silentoldconfig $(Kconfig); \
47 mv -f .config.old.1 .config.old) \ 48 mv -f .config.old.1 .config.old) \
48 else \ 49 else \
49 mv -f .tmp.config .config; \ 50 mv -f .tmp.config .config; \
50 $(obj)/conf --silentoldconfig $(Kconfig); \ 51 $(obj)/conf $(silent) --silentoldconfig $(Kconfig); \
51 fi 52 fi
52 $(Q)rm -f .tmp.config 53 $(Q)rm -f .tmp.config
53 54
54# Create new linux.pot file 55# Create new linux.pot file
55# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files 56# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
56update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h 57update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
57 $(Q)echo " GEN config.pot" 58 $(Q)$(kecho) " GEN config.pot"
58 $(Q)xgettext --default-domain=linux \ 59 $(Q)xgettext --default-domain=linux \
59 --add-comments --keyword=_ --keyword=N_ \ 60 --add-comments --keyword=_ --keyword=N_ \
60 --from-code=UTF-8 \ 61 --from-code=UTF-8 \
@@ -65,61 +66,58 @@ update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
65 $(Q)(for i in `ls $(srctree)/arch/*/Kconfig \ 66 $(Q)(for i in `ls $(srctree)/arch/*/Kconfig \
66 $(srctree)/arch/*/um/Kconfig`; \ 67 $(srctree)/arch/*/um/Kconfig`; \
67 do \ 68 do \
68 echo " GEN $$i"; \ 69 $(kecho) " GEN $$i"; \
69 $(obj)/kxgettext $$i \ 70 $(obj)/kxgettext $$i \
70 >> $(obj)/config.pot; \ 71 >> $(obj)/config.pot; \
71 done ) 72 done )
72 $(Q)echo " GEN linux.pot" 73 $(Q)$(kecho) " GEN linux.pot"
73 $(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \ 74 $(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \
74 --output $(obj)/linux.pot 75 --output $(obj)/linux.pot
75 $(Q)rm -f $(obj)/config.pot 76 $(Q)rm -f $(obj)/config.pot
76 77
77PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig 78# These targets map 1:1 to the commandline options of 'conf'
78 79simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \
79allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf 80 alldefconfig randconfig listnewconfig olddefconfig
80 $< --$@ $(Kconfig) 81PHONY += $(simple-targets)
81 82
82PHONY += listnewconfig olddefconfig oldnoconfig savedefconfig defconfig 83$(simple-targets): $(obj)/conf
84 $< $(silent) --$@ $(Kconfig)
83 85
84listnewconfig olddefconfig: $(obj)/conf 86PHONY += oldnoconfig savedefconfig defconfig
85 $< --$@ $(Kconfig)
86 87
87# oldnoconfig is an alias of olddefconfig, because people already are dependent 88# oldnoconfig is an alias of olddefconfig, because people already are dependent
88# on its behavior(sets new symbols to their default value but not 'n') with the 89# on its behavior(sets new symbols to their default value but not 'n') with the
89# counter-intuitive name. 90# counter-intuitive name.
90oldnoconfig: $(obj)/conf 91oldnoconfig: olddefconfig
91 $< --olddefconfig $(Kconfig)
92 92
93savedefconfig: $(obj)/conf 93savedefconfig: $(obj)/conf
94 $< --$@=defconfig $(Kconfig) 94 $< $(silent) --$@=defconfig $(Kconfig)
95 95
96defconfig: $(obj)/conf 96defconfig: $(obj)/conf
97ifeq ($(KBUILD_DEFCONFIG),) 97ifeq ($(KBUILD_DEFCONFIG),)
98 $< --defconfig $(Kconfig) 98 $< $(silent) --defconfig $(Kconfig)
99else 99else
100 @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" 100 @$(kecho) "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
101 $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) 101 $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
102endif 102endif
103 103
104%_defconfig: $(obj)/conf 104%_defconfig: $(obj)/conf
105 $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) 105 $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
106 106
107configfiles=$(wildcard $(srctree)/kernel/configs/$(1).config $(srctree)/arch/$(SRCARCH)/configs/$(1).config) 107configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/configs/$@)
108 108
109define mergeconfig 109%.config: $(obj)/conf
110$(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target)) 110 $(if $(call configfiles),, $(error No configuration exists for this target on this architecture))
111$(if $(call configfiles,$(1)),, $(error No configuration exists for this target on this architecture)) 111 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m .config $(configfiles)
112$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(call configfiles,$(1)) 112 +$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
113$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
114endef
115 113
116PHONY += kvmconfig 114PHONY += kvmconfig
117kvmconfig: 115kvmconfig: kvm_guest.config
118 $(call mergeconfig,kvm_guest) 116 @:
119 117
120PHONY += tinyconfig 118PHONY += tinyconfig
121tinyconfig: allnoconfig 119tinyconfig:
122 $(call mergeconfig,tiny) 120 $(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config
123 121
124# Help text used by make help 122# Help text used by make help
125help: 123help:
@@ -221,7 +219,7 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile
221 219
222# QT needs some extra effort... 220# QT needs some extra effort...
223$(obj)/.tmp_qtcheck: 221$(obj)/.tmp_qtcheck:
224 @set -e; echo " CHECK qt"; dir=""; pkg=""; \ 222 @set -e; $(kecho) " CHECK qt"; dir=""; pkg=""; \
225 if ! pkg-config --exists QtCore 2> /dev/null; then \ 223 if ! pkg-config --exists QtCore 2> /dev/null; then \
226 echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \ 224 echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \
227 pkg-config --exists qt 2> /dev/null && pkg=qt; \ 225 pkg-config --exists qt 2> /dev/null && pkg=qt; \
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index fef75fc756f4..6c204318bc94 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -471,7 +471,7 @@ static struct option long_opts[] = {
471static void conf_usage(const char *progname) 471static void conf_usage(const char *progname)
472{ 472{
473 473
474 printf("Usage: %s [option] <kconfig-file>\n", progname); 474 printf("Usage: %s [-s] [option] <kconfig-file>\n", progname);
475 printf("[option] is _one_ of the following:\n"); 475 printf("[option] is _one_ of the following:\n");
476 printf(" --listnewconfig List new options\n"); 476 printf(" --listnewconfig List new options\n");
477 printf(" --oldaskconfig Start a new configuration using a line-oriented program\n"); 477 printf(" --oldaskconfig Start a new configuration using a line-oriented program\n");
@@ -501,7 +501,11 @@ int main(int ac, char **av)
501 501
502 tty_stdio = isatty(0) && isatty(1) && isatty(2); 502 tty_stdio = isatty(0) && isatty(1) && isatty(2);
503 503
504 while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) { 504 while ((opt = getopt_long(ac, av, "s", long_opts, NULL)) != -1) {
505 if (opt == 's') {
506 conf_set_message_callback(NULL);
507 continue;
508 }
505 input_mode = (enum input_mode)opt; 509 input_mode = (enum input_mode)opt;
506 switch (opt) { 510 switch (opt) {
507 case silentoldconfig: 511 case silentoldconfig:
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 28df18dd1147..c814f57672fc 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -16,6 +16,11 @@
16 16
17#include "lkc.h" 17#include "lkc.h"
18 18
19struct conf_printer {
20 void (*print_symbol)(FILE *, struct symbol *, const char *, void *);
21 void (*print_comment)(FILE *, const char *, void *);
22};
23
19static void conf_warning(const char *fmt, ...) 24static void conf_warning(const char *fmt, ...)
20 __attribute__ ((format (printf, 1, 2))); 25 __attribute__ ((format (printf, 1, 2)));
21 26
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
index d6626521f9b9..fb0a2a286dca 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -11,6 +11,12 @@
11 11
12#define DEBUG_EXPR 0 12#define DEBUG_EXPR 0
13 13
14static int expr_eq(struct expr *e1, struct expr *e2);
15static struct expr *expr_eliminate_yn(struct expr *e);
16static struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2);
17static struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2);
18static void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2);
19
14struct expr *expr_alloc_symbol(struct symbol *sym) 20struct expr *expr_alloc_symbol(struct symbol *sym)
15{ 21{
16 struct expr *e = xcalloc(1, sizeof(*e)); 22 struct expr *e = xcalloc(1, sizeof(*e));
@@ -186,7 +192,7 @@ void expr_eliminate_eq(struct expr **ep1, struct expr **ep2)
186#undef e1 192#undef e1
187#undef e2 193#undef e2
188 194
189int expr_eq(struct expr *e1, struct expr *e2) 195static int expr_eq(struct expr *e1, struct expr *e2)
190{ 196{
191 int res, old_count; 197 int res, old_count;
192 198
@@ -228,7 +234,7 @@ int expr_eq(struct expr *e1, struct expr *e2)
228 return 0; 234 return 0;
229} 235}
230 236
231struct expr *expr_eliminate_yn(struct expr *e) 237static struct expr *expr_eliminate_yn(struct expr *e)
232{ 238{
233 struct expr *tmp; 239 struct expr *tmp;
234 240
@@ -823,7 +829,7 @@ bool expr_depends_symbol(struct expr *dep, struct symbol *sym)
823 return false; 829 return false;
824} 830}
825 831
826struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2) 832static struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2)
827{ 833{
828 struct expr *tmp = NULL; 834 struct expr *tmp = NULL;
829 expr_extract_eq(E_AND, &tmp, ep1, ep2); 835 expr_extract_eq(E_AND, &tmp, ep1, ep2);
@@ -834,7 +840,7 @@ struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2)
834 return tmp; 840 return tmp;
835} 841}
836 842
837struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2) 843static struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2)
838{ 844{
839 struct expr *tmp = NULL; 845 struct expr *tmp = NULL;
840 expr_extract_eq(E_OR, &tmp, ep1, ep2); 846 expr_extract_eq(E_OR, &tmp, ep1, ep2);
@@ -845,7 +851,7 @@ struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2)
845 return tmp; 851 return tmp;
846} 852}
847 853
848void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2) 854static void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2)
849{ 855{
850#define e1 (*ep1) 856#define e1 (*ep1)
851#define e2 (*ep2) 857#define e2 (*ep2)
@@ -976,11 +982,8 @@ tristate expr_calc_value(struct expr *e)
976 } 982 }
977} 983}
978 984
979int expr_compare_type(enum expr_type t1, enum expr_type t2) 985static int expr_compare_type(enum expr_type t1, enum expr_type t2)
980{ 986{
981#if 0
982 return 1;
983#else
984 if (t1 == t2) 987 if (t1 == t2)
985 return 0; 988 return 0;
986 switch (t1) { 989 switch (t1) {
@@ -1005,7 +1008,6 @@ int expr_compare_type(enum expr_type t1, enum expr_type t2)
1005 } 1008 }
1006 printf("[%dgt%d?]", t1, t2); 1009 printf("[%dgt%d?]", t1, t2);
1007 return 0; 1010 return 0;
1008#endif
1009} 1011}
1010 1012
1011static inline struct expr * 1013static inline struct expr *
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
index 412ea8a2abb8..a2fc96a2bd2c 100644
--- a/scripts/kconfig/expr.h
+++ b/scripts/kconfig/expr.h
@@ -205,18 +205,13 @@ struct expr *expr_alloc_and(struct expr *e1, struct expr *e2);
205struct expr *expr_alloc_or(struct expr *e1, struct expr *e2); 205struct expr *expr_alloc_or(struct expr *e1, struct expr *e2);
206struct expr *expr_copy(const struct expr *org); 206struct expr *expr_copy(const struct expr *org);
207void expr_free(struct expr *e); 207void expr_free(struct expr *e);
208int expr_eq(struct expr *e1, struct expr *e2);
209void expr_eliminate_eq(struct expr **ep1, struct expr **ep2); 208void expr_eliminate_eq(struct expr **ep1, struct expr **ep2);
210tristate expr_calc_value(struct expr *e); 209tristate expr_calc_value(struct expr *e);
211struct expr *expr_eliminate_yn(struct expr *e);
212struct expr *expr_trans_bool(struct expr *e); 210struct expr *expr_trans_bool(struct expr *e);
213struct expr *expr_eliminate_dups(struct expr *e); 211struct expr *expr_eliminate_dups(struct expr *e);
214struct expr *expr_transform(struct expr *e); 212struct expr *expr_transform(struct expr *e);
215int expr_contains_symbol(struct expr *dep, struct symbol *sym); 213int expr_contains_symbol(struct expr *dep, struct symbol *sym);
216bool expr_depends_symbol(struct expr *dep, struct symbol *sym); 214bool expr_depends_symbol(struct expr *dep, struct symbol *sym);
217struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2);
218struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2);
219void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2);
220struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym); 215struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym);
221struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2); 216struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2);
222 217
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index d0a35b21f308..26d208b435a0 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -169,14 +169,6 @@ void init_main_window(const gchar * glade_file)
169 style = gtk_widget_get_style(main_wnd); 169 style = gtk_widget_get_style(main_wnd);
170 widget = glade_xml_get_widget(xml, "toolbar1"); 170 widget = glade_xml_get_widget(xml, "toolbar1");
171 171
172#if 0 /* Use stock Gtk icons instead */
173 replace_button_icon(xml, main_wnd->window, style,
174 "button1", (gchar **) xpm_back);
175 replace_button_icon(xml, main_wnd->window, style,
176 "button2", (gchar **) xpm_load);
177 replace_button_icon(xml, main_wnd->window, style,
178 "button3", (gchar **) xpm_save);
179#endif
180 replace_button_icon(xml, main_wnd->window, style, 172 replace_button_icon(xml, main_wnd->window, style,
181 "button4", (gchar **) xpm_single_view); 173 "button4", (gchar **) xpm_single_view);
182 replace_button_icon(xml, main_wnd->window, style, 174 replace_button_icon(xml, main_wnd->window, style,
@@ -184,22 +176,6 @@ void init_main_window(const gchar * glade_file)
184 replace_button_icon(xml, main_wnd->window, style, 176 replace_button_icon(xml, main_wnd->window, style,
185 "button6", (gchar **) xpm_tree_view); 177 "button6", (gchar **) xpm_tree_view);
186 178
187#if 0
188 switch (view_mode) {
189 case SINGLE_VIEW:
190 widget = glade_xml_get_widget(xml, "button4");
191 g_signal_emit_by_name(widget, "clicked");
192 break;
193 case SPLIT_VIEW:
194 widget = glade_xml_get_widget(xml, "button5");
195 g_signal_emit_by_name(widget, "clicked");
196 break;
197 case FULL_VIEW:
198 widget = glade_xml_get_widget(xml, "button6");
199 g_signal_emit_by_name(widget, "clicked");
200 break;
201 }
202#endif
203 txtbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w)); 179 txtbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w));
204 tag1 = gtk_text_buffer_create_tag(txtbuf, "mytag1", 180 tag1 = gtk_text_buffer_create_tag(txtbuf, "mytag1",
205 "foreground", "red", 181 "foreground", "red",
@@ -1498,9 +1474,12 @@ int main(int ac, char *av[])
1498 case 'a': 1474 case 'a':
1499 //showAll = 1; 1475 //showAll = 1;
1500 break; 1476 break;
1477 case 's':
1478 conf_set_message_callback(NULL);
1479 break;
1501 case 'h': 1480 case 'h':
1502 case '?': 1481 case '?':
1503 printf("%s <config>\n", av[0]); 1482 printf("%s [-s] <config>\n", av[0]);
1504 exit(0); 1483 exit(0);
1505 } 1484 }
1506 name = av[2]; 1485 name = av[2];
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index d5daa7af8b49..91ca126ea080 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -21,9 +21,7 @@ static inline char *bind_textdomain_codeset(const char *dn, char *c) { return c;
21extern "C" { 21extern "C" {
22#endif 22#endif
23 23
24#define P(name,type,arg) extern type name arg
25#include "lkc_proto.h" 24#include "lkc_proto.h"
26#undef P
27 25
28#define SRCTREE "srctree" 26#define SRCTREE "srctree"
29 27
@@ -70,9 +68,6 @@ struct kconf_id {
70 enum symbol_type stype; 68 enum symbol_type stype;
71}; 69};
72 70
73extern int zconfdebug;
74
75int zconfparse(void);
76void zconfdump(FILE *out); 71void zconfdump(FILE *out);
77void zconf_starthelp(void); 72void zconf_starthelp(void);
78FILE *zconf_fopen(const char *name); 73FILE *zconf_fopen(const char *name);
@@ -90,11 +85,6 @@ void sym_add_change_count(int count);
90bool conf_set_all_new_symbols(enum conf_def_mode mode); 85bool conf_set_all_new_symbols(enum conf_def_mode mode);
91void set_all_choice_values(struct symbol *csym); 86void set_all_choice_values(struct symbol *csym);
92 87
93struct conf_printer {
94 void (*print_symbol)(FILE *, struct symbol *, const char *, void *);
95 void (*print_comment)(FILE *, const char *, void *);
96};
97
98/* confdata.c and expr.c */ 88/* confdata.c and expr.c */
99static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out) 89static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out)
100{ 90{
@@ -113,7 +103,6 @@ void menu_add_entry(struct symbol *sym);
113void menu_end_entry(void); 103void menu_end_entry(void);
114void menu_add_dep(struct expr *dep); 104void menu_add_dep(struct expr *dep);
115void menu_add_visibility(struct expr *dep); 105void menu_add_visibility(struct expr *dep);
116struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep);
117struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); 106struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
118void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep); 107void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);
119void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep); 108void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);
@@ -137,7 +126,6 @@ struct gstr {
137 int max_width; 126 int max_width;
138}; 127};
139struct gstr str_new(void); 128struct gstr str_new(void);
140struct gstr str_assign(const char *s);
141void str_free(struct gstr *gs); 129void str_free(struct gstr *gs);
142void str_append(struct gstr *gs, const char *s); 130void str_append(struct gstr *gs, const char *s);
143void str_printf(struct gstr *gs, const char *fmt, ...); 131void str_printf(struct gstr *gs, const char *fmt, ...);
@@ -148,8 +136,6 @@ extern struct expr *sym_env_list;
148 136
149void sym_init(void); 137void sym_init(void);
150void sym_clear_all_valid(void); 138void sym_clear_all_valid(void);
151void sym_set_all_changed(void);
152void sym_set_changed(struct symbol *sym);
153struct symbol *sym_choice_default(struct symbol *sym); 139struct symbol *sym_choice_default(struct symbol *sym);
154const char *sym_get_string_default(struct symbol *sym); 140const char *sym_get_string_default(struct symbol *sym);
155struct symbol *sym_check_deps(struct symbol *sym); 141struct symbol *sym_check_deps(struct symbol *sym);
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h
index ecdb9659b67d..d5398718ec2a 100644
--- a/scripts/kconfig/lkc_proto.h
+++ b/scripts/kconfig/lkc_proto.h
@@ -1,57 +1,52 @@
1#include <stdarg.h> 1#include <stdarg.h>
2 2
3/* confdata.c */ 3/* confdata.c */
4P(conf_parse,void,(const char *name)); 4void conf_parse(const char *name);
5P(conf_read,int,(const char *name)); 5int conf_read(const char *name);
6P(conf_read_simple,int,(const char *name, int)); 6int conf_read_simple(const char *name, int);
7P(conf_write_defconfig,int,(const char *name)); 7int conf_write_defconfig(const char *name);
8P(conf_write,int,(const char *name)); 8int conf_write(const char *name);
9P(conf_write_autoconf,int,(void)); 9int conf_write_autoconf(void);
10P(conf_get_changed,bool,(void)); 10bool conf_get_changed(void);
11P(conf_set_changed_callback, void,(void (*fn)(void))); 11void conf_set_changed_callback(void (*fn)(void));
12P(conf_set_message_callback, void,(void (*fn)(const char *fmt, va_list ap))); 12void conf_set_message_callback(void (*fn)(const char *fmt, va_list ap));
13 13
14/* menu.c */ 14/* menu.c */
15P(rootmenu,struct menu,); 15extern struct menu rootmenu;
16 16
17P(menu_is_empty, bool, (struct menu *menu)); 17bool menu_is_empty(struct menu *menu);
18P(menu_is_visible, bool, (struct menu *menu)); 18bool menu_is_visible(struct menu *menu);
19P(menu_has_prompt, bool, (struct menu *menu)); 19bool menu_has_prompt(struct menu *menu);
20P(menu_get_prompt,const char *,(struct menu *menu)); 20const char * menu_get_prompt(struct menu *menu);
21P(menu_get_root_menu,struct menu *,(struct menu *menu)); 21struct menu * menu_get_root_menu(struct menu *menu);
22P(menu_get_parent_menu,struct menu *,(struct menu *menu)); 22struct menu * menu_get_parent_menu(struct menu *menu);
23P(menu_has_help,bool,(struct menu *menu)); 23bool menu_has_help(struct menu *menu);
24P(menu_get_help,const char *,(struct menu *menu)); 24const char * menu_get_help(struct menu *menu);
25P(get_symbol_str, void, (struct gstr *r, struct symbol *sym, struct list_head 25struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head);
26 *head)); 26void menu_get_ext_help(struct menu *menu, struct gstr *help);
27P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct list_head
28 *head));
29P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help));
30 27
31/* symbol.c */ 28/* symbol.c */
32P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); 29extern struct symbol * symbol_hash[SYMBOL_HASHSIZE];
33 30
34P(sym_lookup,struct symbol *,(const char *name, int flags)); 31struct symbol * sym_lookup(const char *name, int flags);
35P(sym_find,struct symbol *,(const char *name)); 32struct symbol * sym_find(const char *name);
36P(sym_expand_string_value,const char *,(const char *in)); 33const char * sym_expand_string_value(const char *in);
37P(sym_escape_string_value, const char *,(const char *in)); 34const char * sym_escape_string_value(const char *in);
38P(sym_re_search,struct symbol **,(const char *pattern)); 35struct symbol ** sym_re_search(const char *pattern);
39P(sym_type_name,const char *,(enum symbol_type type)); 36const char * sym_type_name(enum symbol_type type);
40P(sym_calc_value,void,(struct symbol *sym)); 37void sym_calc_value(struct symbol *sym);
41P(sym_get_type,enum symbol_type,(struct symbol *sym)); 38enum symbol_type sym_get_type(struct symbol *sym);
42P(sym_tristate_within_range,bool,(struct symbol *sym,tristate tri)); 39bool sym_tristate_within_range(struct symbol *sym,tristate tri);
43P(sym_set_tristate_value,bool,(struct symbol *sym,tristate tri)); 40bool sym_set_tristate_value(struct symbol *sym,tristate tri);
44P(sym_toggle_tristate_value,tristate,(struct symbol *sym)); 41tristate sym_toggle_tristate_value(struct symbol *sym);
45P(sym_string_valid,bool,(struct symbol *sym, const char *newval)); 42bool sym_string_valid(struct symbol *sym, const char *newval);
46P(sym_string_within_range,bool,(struct symbol *sym, const char *str)); 43bool sym_string_within_range(struct symbol *sym, const char *str);
47P(sym_set_string_value,bool,(struct symbol *sym, const char *newval)); 44bool sym_set_string_value(struct symbol *sym, const char *newval);
48P(sym_is_changable,bool,(struct symbol *sym)); 45bool sym_is_changable(struct symbol *sym);
49P(sym_get_choice_prop,struct property *,(struct symbol *sym)); 46struct property * sym_get_choice_prop(struct symbol *sym);
50P(sym_get_default_prop,struct property *,(struct symbol *sym)); 47const char * sym_get_string_value(struct symbol *sym);
51P(sym_get_string_value,const char *,(struct symbol *sym));
52 48
53P(prop_get_type_name,const char *,(enum prop_type type)); 49const char * prop_get_type_name(enum prop_type type);
54 50
55/* expr.c */ 51/* expr.c */
56P(expr_compare_type,int,(enum expr_type t1, enum expr_type t2)); 52void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken);
57P(expr_print,void,(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken));
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 4dd37552abc2..315ce2c7cb9d 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -279,6 +279,7 @@ static int child_count;
279static int single_menu_mode; 279static int single_menu_mode;
280static int show_all_options; 280static int show_all_options;
281static int save_and_exit; 281static int save_and_exit;
282static int silent;
282 283
283static void conf(struct menu *menu, struct menu *active_menu); 284static void conf(struct menu *menu, struct menu *active_menu);
284static void conf_choice(struct menu *menu); 285static void conf_choice(struct menu *menu);
@@ -777,10 +778,12 @@ static void conf_message_callback(const char *fmt, va_list ap)
777 char buf[PATH_MAX+1]; 778 char buf[PATH_MAX+1];
778 779
779 vsnprintf(buf, sizeof(buf), fmt, ap); 780 vsnprintf(buf, sizeof(buf), fmt, ap);
780 if (save_and_exit) 781 if (save_and_exit) {
781 printf("%s", buf); 782 if (!silent)
782 else 783 printf("%s", buf);
784 } else {
783 show_textbox(NULL, buf, 6, 60); 785 show_textbox(NULL, buf, 6, 60);
786 }
784} 787}
785 788
786static void show_help(struct menu *menu) 789static void show_help(struct menu *menu)
@@ -977,16 +980,18 @@ static int handle_exit(void)
977 } 980 }
978 /* fall through */ 981 /* fall through */
979 case -1: 982 case -1:
980 printf(_("\n\n" 983 if (!silent)
981 "*** End of the configuration.\n" 984 printf(_("\n\n"
982 "*** Execute 'make' to start the build or try 'make help'." 985 "*** End of the configuration.\n"
983 "\n\n")); 986 "*** Execute 'make' to start the build or try 'make help'."
987 "\n\n"));
984 res = 0; 988 res = 0;
985 break; 989 break;
986 default: 990 default:
987 fprintf(stderr, _("\n\n" 991 if (!silent)
988 "Your configuration changes were NOT saved." 992 fprintf(stderr, _("\n\n"
989 "\n\n")); 993 "Your configuration changes were NOT saved."
994 "\n\n"));
990 if (res != KEY_ESC) 995 if (res != KEY_ESC)
991 res = 0; 996 res = 0;
992 } 997 }
@@ -1010,6 +1015,12 @@ int main(int ac, char **av)
1010 1015
1011 signal(SIGINT, sig_handler); 1016 signal(SIGINT, sig_handler);
1012 1017
1018 if (ac > 1 && strcmp(av[1], "-s") == 0) {
1019 silent = 1;
1020 /* Silence conf_read() until the real callback is set up */
1021 conf_set_message_callback(NULL);
1022 av++;
1023 }
1013 conf_parse(av[1]); 1024 conf_parse(av[1]);
1014 conf_read(NULL); 1025 conf_read(NULL);
1015 1026
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 72c9dba84c5d..b05cc3d4a9be 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -125,7 +125,7 @@ void menu_set_type(int type)
125 sym_type_name(sym->type), sym_type_name(type)); 125 sym_type_name(sym->type), sym_type_name(type));
126} 126}
127 127
128struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep) 128static struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep)
129{ 129{
130 struct property *prop = prop_alloc(type, current_entry->sym); 130 struct property *prop = prop_alloc(type, current_entry->sym);
131 131
@@ -615,7 +615,7 @@ static struct property *get_symbol_prop(struct symbol *sym)
615/* 615/*
616 * head is optional and may be NULL 616 * head is optional and may be NULL
617 */ 617 */
618void get_symbol_str(struct gstr *r, struct symbol *sym, 618static void get_symbol_str(struct gstr *r, struct symbol *sym,
619 struct list_head *head) 619 struct list_head *head)
620{ 620{
621 bool hit; 621 bool hit;
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index 2ab91b9b100d..ec8e20350a64 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -35,7 +35,7 @@ usage() {
35 echo " -O dir to put generated output files" 35 echo " -O dir to put generated output files"
36} 36}
37 37
38MAKE=true 38RUNMAKE=true
39ALLTARGET=alldefconfig 39ALLTARGET=alldefconfig
40WARNREDUN=false 40WARNREDUN=false
41OUTPUT=. 41OUTPUT=.
@@ -48,7 +48,7 @@ while true; do
48 continue 48 continue
49 ;; 49 ;;
50 "-m") 50 "-m")
51 MAKE=false 51 RUNMAKE=false
52 shift 52 shift
53 continue 53 continue
54 ;; 54 ;;
@@ -85,6 +85,11 @@ fi
85INITFILE=$1 85INITFILE=$1
86shift; 86shift;
87 87
88if [ ! -r "$INITFILE" ]; then
89 echo "The base file '$INITFILE' does not exist. Exit." >&2
90 exit 1
91fi
92
88MERGE_LIST=$* 93MERGE_LIST=$*
89SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p" 94SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
90TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX) 95TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
@@ -92,31 +97,29 @@ TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
92echo "Using $INITFILE as base" 97echo "Using $INITFILE as base"
93cat $INITFILE > $TMP_FILE 98cat $INITFILE > $TMP_FILE
94 99
95# Merge files, printing warnings on overrided values 100# Merge files, printing warnings on overridden values
96for MERGE_FILE in $MERGE_LIST ; do 101for MERGE_FILE in $MERGE_LIST ; do
97 echo "Merging $MERGE_FILE" 102 echo "Merging $MERGE_FILE"
98 CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE) 103 CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE)
99 104
100 for CFG in $CFG_LIST ; do 105 for CFG in $CFG_LIST ; do
101 grep -q -w $CFG $TMP_FILE 106 grep -q -w $CFG $TMP_FILE || continue
102 if [ $? -eq 0 ] ; then 107 PREV_VAL=$(grep -w $CFG $TMP_FILE)
103 PREV_VAL=$(grep -w $CFG $TMP_FILE) 108 NEW_VAL=$(grep -w $CFG $MERGE_FILE)
104 NEW_VAL=$(grep -w $CFG $MERGE_FILE) 109 if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then
105 if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then
106 echo Value of $CFG is redefined by fragment $MERGE_FILE: 110 echo Value of $CFG is redefined by fragment $MERGE_FILE:
107 echo Previous value: $PREV_VAL 111 echo Previous value: $PREV_VAL
108 echo New value: $NEW_VAL 112 echo New value: $NEW_VAL
109 echo 113 echo
110 elif [ "$WARNREDUN" = "true" ]; then 114 elif [ "$WARNREDUN" = "true" ]; then
111 echo Value of $CFG is redundant by fragment $MERGE_FILE: 115 echo Value of $CFG is redundant by fragment $MERGE_FILE:
112 fi
113 sed -i "/$CFG[ =]/d" $TMP_FILE
114 fi 116 fi
117 sed -i "/$CFG[ =]/d" $TMP_FILE
115 done 118 done
116 cat $MERGE_FILE >> $TMP_FILE 119 cat $MERGE_FILE >> $TMP_FILE
117done 120done
118 121
119if [ "$MAKE" = "false" ]; then 122if [ "$RUNMAKE" = "false" ]; then
120 cp $TMP_FILE $OUTPUT/.config 123 cp $TMP_FILE $OUTPUT/.config
121 echo "#" 124 echo "#"
122 echo "# merged configuration written to $OUTPUT/.config (needs make)" 125 echo "# merged configuration written to $OUTPUT/.config (needs make)"
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
index 984489ef2b46..d42d534a66cd 100644
--- a/scripts/kconfig/nconf.c
+++ b/scripts/kconfig/nconf.c
@@ -1482,6 +1482,11 @@ int main(int ac, char **av)
1482 bindtextdomain(PACKAGE, LOCALEDIR); 1482 bindtextdomain(PACKAGE, LOCALEDIR);
1483 textdomain(PACKAGE); 1483 textdomain(PACKAGE);
1484 1484
1485 if (ac > 1 && strcmp(av[1], "-s") == 0) {
1486 /* Silence conf_read() until the real callback is set up */
1487 conf_set_message_callback(NULL);
1488 av++;
1489 }
1485 conf_parse(av[1]); 1490 conf_parse(av[1]);
1486 conf_read(NULL); 1491 conf_read(NULL);
1487 1492
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 9d3b04b0769c..c3bb7fe8dfa6 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -1746,7 +1746,7 @@ static const char *progname;
1746 1746
1747static void usage(void) 1747static void usage(void)
1748{ 1748{
1749 printf(_("%s <config>\n"), progname); 1749 printf(_("%s [-s] <config>\n"), progname);
1750 exit(0); 1750 exit(0);
1751} 1751}
1752 1752
@@ -1762,6 +1762,9 @@ int main(int ac, char** av)
1762 configApp = new QApplication(ac, av); 1762 configApp = new QApplication(ac, av);
1763 if (ac > 1 && av[1][0] == '-') { 1763 if (ac > 1 && av[1][0] == '-') {
1764 switch (av[1][1]) { 1764 switch (av[1][1]) {
1765 case 's':
1766 conf_set_message_callback(NULL);
1767 break;
1765 case 'h': 1768 case 'h':
1766 case '?': 1769 case '?':
1767 usage(); 1770 usage();
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 7caabdb51c64..6731377f9bb2 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -112,7 +112,7 @@ struct property *sym_get_env_prop(struct symbol *sym)
112 return NULL; 112 return NULL;
113} 113}
114 114
115struct property *sym_get_default_prop(struct symbol *sym) 115static struct property *sym_get_default_prop(struct symbol *sym)
116{ 116{
117 struct property *prop; 117 struct property *prop;
118 118
@@ -186,6 +186,26 @@ static void sym_validate_range(struct symbol *sym)
186 sym->curr.val = strdup(str); 186 sym->curr.val = strdup(str);
187} 187}
188 188
189static void sym_set_changed(struct symbol *sym)
190{
191 struct property *prop;
192
193 sym->flags |= SYMBOL_CHANGED;
194 for (prop = sym->prop; prop; prop = prop->next) {
195 if (prop->menu)
196 prop->menu->flags |= MENU_CHANGED;
197 }
198}
199
200static void sym_set_all_changed(void)
201{
202 struct symbol *sym;
203 int i;
204
205 for_all_symbols(i, sym)
206 sym_set_changed(sym);
207}
208
189static void sym_calc_visibility(struct symbol *sym) 209static void sym_calc_visibility(struct symbol *sym)
190{ 210{
191 struct property *prop; 211 struct property *prop;
@@ -451,26 +471,6 @@ void sym_clear_all_valid(void)
451 sym_calc_value(modules_sym); 471 sym_calc_value(modules_sym);
452} 472}
453 473
454void sym_set_changed(struct symbol *sym)
455{
456 struct property *prop;
457
458 sym->flags |= SYMBOL_CHANGED;
459 for (prop = sym->prop; prop; prop = prop->next) {
460 if (prop->menu)
461 prop->menu->flags |= MENU_CHANGED;
462 }
463}
464
465void sym_set_all_changed(void)
466{
467 struct symbol *sym;
468 int i;
469
470 for_all_symbols(i, sym)
471 sym_set_changed(sym);
472}
473
474bool sym_tristate_within_range(struct symbol *sym, tristate val) 474bool sym_tristate_within_range(struct symbol *sym, tristate val)
475{ 475{
476 int type = sym_get_type(sym); 476 int type = sym_get_type(sym);
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index 94f9c83e324f..0e76042473cc 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -88,16 +88,6 @@ struct gstr str_new(void)
88 return gs; 88 return gs;
89} 89}
90 90
91/* Allocate and assign growable string */
92struct gstr str_assign(const char *s)
93{
94 struct gstr gs;
95 gs.s = strdup(s);
96 gs.len = strlen(s) + 1;
97 gs.max_width = 0;
98 return gs;
99}
100
101/* Free storage for growable string */ 91/* Free storage for growable string */
102void str_free(struct gstr *gs) 92void str_free(struct gstr *gs)
103{ 93{
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index f282516acc7b..fce36d0f6898 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -168,6 +168,9 @@ int main(void)
168 DEVID_FIELD(amba_id, id); 168 DEVID_FIELD(amba_id, id);
169 DEVID_FIELD(amba_id, mask); 169 DEVID_FIELD(amba_id, mask);
170 170
171 DEVID(mips_cdmm_device_id);
172 DEVID_FIELD(mips_cdmm_device_id, type);
173
171 DEVID(x86_cpu_id); 174 DEVID(x86_cpu_id);
172 DEVID_FIELD(x86_cpu_id, feature); 175 DEVID_FIELD(x86_cpu_id, feature);
173 DEVID_FIELD(x86_cpu_id, family); 176 DEVID_FIELD(x86_cpu_id, family);
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index e614ef689eee..78691d51a479 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -1109,6 +1109,22 @@ static int do_amba_entry(const char *filename,
1109} 1109}
1110ADD_TO_DEVTABLE("amba", amba_id, do_amba_entry); 1110ADD_TO_DEVTABLE("amba", amba_id, do_amba_entry);
1111 1111
1112/*
1113 * looks like: "mipscdmm:tN"
1114 *
1115 * N is exactly 2 digits, where each is an upper-case hex digit, or
1116 * a ? or [] pattern matching exactly one digit.
1117 */
1118static int do_mips_cdmm_entry(const char *filename,
1119 void *symval, char *alias)
1120{
1121 DEF_FIELD(symval, mips_cdmm_device_id, type);
1122
1123 sprintf(alias, "mipscdmm:t%02X*", type);
1124 return 1;
1125}
1126ADD_TO_DEVTABLE("mipscdmm", mips_cdmm_device_id, do_mips_cdmm_entry);
1127
1112/* LOOKS like cpu:type:x86,venVVVVfamFFFFmodMMMM:feature:*,FEAT,* 1128/* LOOKS like cpu:type:x86,venVVVVfamFFFFmodMMMM:feature:*,FEAT,*
1113 * All fields are numbers. It would be nicer to use strings for vendor 1129 * All fields are numbers. It would be nicer to use strings for vendor
1114 * and feature, but getting those out of the build system here is too 1130 * and feature, but getting those out of the build system here is too
diff --git a/scripts/spelling.txt b/scripts/spelling.txt
index fc7fd52b5e03..bb8e4d0a1911 100644
--- a/scripts/spelling.txt
+++ b/scripts/spelling.txt
@@ -825,6 +825,7 @@ retreived||retrieved
825retreive||retrieve 825retreive||retrieve
826retrive||retrieve 826retrive||retrieve
827retuned||returned 827retuned||returned
828reudce||reduce
828reuest||request 829reuest||request
829reuqest||request 830reuqest||request
830reutnred||returned 831reutnred||returned
diff --git a/scripts/xen-hypercalls.sh b/scripts/xen-hypercalls.sh
new file mode 100644
index 000000000000..676d9226814f
--- /dev/null
+++ b/scripts/xen-hypercalls.sh
@@ -0,0 +1,12 @@
1#!/bin/sh
2out="$1"
3shift
4in="$@"
5
6for i in $in; do
7 eval $CPP $LINUXINCLUDE -dD -imacros "$i" -x c /dev/null
8done | \
9awk '$1 == "#define" && $2 ~ /__HYPERVISOR_[a-z][a-z_0-9]*/ { v[$3] = $2 }
10 END { print "/* auto-generated by scripts/xen-hypercall.sh */"
11 for (i in v) if (!(v[i] in v))
12 print "HYPERCALL("substr(v[i], 14)")"}' | sort -u >$out