aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.lib14
-rw-r--r--scripts/basic/fixdep.c2
-rwxr-xr-xscripts/checkpatch.pl36
-rwxr-xr-xscripts/checkstack.pl8
-rwxr-xr-xscripts/coccicheck39
-rw-r--r--scripts/coccinelle/api/devm_ioremap_resource.cocci90
-rw-r--r--scripts/coccinelle/misc/memcpy-assign.cocci103
-rw-r--r--scripts/coccinelle/misc/orplus.cocci55
-rw-r--r--scripts/coccinelle/misc/semicolon.cocci83
-rw-r--r--scripts/genksyms/genksyms.c3
-rwxr-xr-xscripts/get_maintainer.pl6
-rw-r--r--scripts/headers_install.pl6
-rw-r--r--scripts/kconfig/Makefile3
-rw-r--r--scripts/kconfig/conf.c7
-rw-r--r--scripts/kconfig/expr.c10
-rw-r--r--scripts/kconfig/gconf.c2
-rw-r--r--scripts/kconfig/lkc.h8
-rw-r--r--scripts/kconfig/lxdialog/check-lxdialog.sh1
-rw-r--r--scripts/kconfig/lxdialog/dialog.h1
-rw-r--r--scripts/kconfig/lxdialog/inputbox.c121
-rw-r--r--scripts/kconfig/lxdialog/menubox.c20
-rw-r--r--scripts/kconfig/mconf.c54
-rw-r--r--scripts/kconfig/menu.c4
-rwxr-xr-xscripts/kconfig/merge_config.sh20
-rw-r--r--scripts/kconfig/nconf.c340
-rw-r--r--scripts/kconfig/nconf.gui.c2
-rw-r--r--scripts/kconfig/qconf.cc1
-rw-r--r--scripts/kconfig/symbol.c12
-rw-r--r--scripts/kconfig/util.c23
-rw-r--r--scripts/kconfig/zconf.l8
-rw-r--r--scripts/kconfig/zconf.lex.c_shipped8
-rwxr-xr-xscripts/kernel-doc3
-rw-r--r--scripts/mod/modpost.c2
-rwxr-xr-xscripts/package/mkspec2
-rw-r--r--scripts/recordmcount.c13
-rwxr-xr-xscripts/sign-file134
-rw-r--r--scripts/sortextable.h2
-rwxr-xr-xscripts/tags.sh74
38 files changed, 933 insertions, 387 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index bdf42fdf64c9..07125e697d7a 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -156,6 +156,11 @@ cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
156 156
157ld_flags = $(LDFLAGS) $(ldflags-y) 157ld_flags = $(LDFLAGS) $(ldflags-y)
158 158
159dtc_cpp_flags = -Wp,-MD,$(depfile) -nostdinc \
160 -I$(srctree)/arch/$(SRCARCH)/boot/dts \
161 -I$(srctree)/arch/$(SRCARCH)/include/dts \
162 -undef -D__DTS__
163
159# Finds the multi-part object the current object will be linked into 164# Finds the multi-part object the current object will be linked into
160modname-multi = $(sort $(foreach m,$(multi-used),\ 165modname-multi = $(sort $(foreach m,$(multi-used),\
161 $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=)))) 166 $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=))))
@@ -269,6 +274,15 @@ cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile
269$(obj)/%.dtb: $(src)/%.dts FORCE 274$(obj)/%.dtb: $(src)/%.dts FORCE
270 $(call if_changed_dep,dtc) 275 $(call if_changed_dep,dtc)
271 276
277dtc-tmp = $(subst $(comma),_,$(dot-target).dts)
278
279quiet_cmd_dtc_cpp = DTC+CPP $@
280cmd_dtc_cpp = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
281 $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) $(dtc-tmp)
282
283$(obj)/%.dtb: $(src)/%.dtsp FORCE
284 $(call if_changed_dep,dtc_cpp)
285
272# Bzip2 286# Bzip2
273# --------------------------------------------------------------------------- 287# ---------------------------------------------------------------------------
274 288
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index cb1f50cf12e3..7f6425e24ce3 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -409,7 +409,7 @@ static void traps(void)
409 int *p = (int *)test; 409 int *p = (int *)test;
410 410
411 if (*p != INT_CONF) { 411 if (*p != INT_CONF) {
412 fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", 412 fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianness? %#x\n",
413 *p); 413 *p);
414 exit(2); 414 exit(2);
415 } 415 }
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 4d2c7dfdaabd..b28cc384a5bc 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -230,12 +230,12 @@ our $Inline = qr{inline|__always_inline|noinline};
230our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]}; 230our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]};
231our $Lval = qr{$Ident(?:$Member)*}; 231our $Lval = qr{$Ident(?:$Member)*};
232 232
233our $Float_hex = qr{(?i:0x[0-9a-f]+p-?[0-9]+[fl]?)}; 233our $Float_hex = qr{(?i)0x[0-9a-f]+p-?[0-9]+[fl]?};
234our $Float_dec = qr{(?i:((?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?))}; 234our $Float_dec = qr{(?i)(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?};
235our $Float_int = qr{(?i:[0-9]+e-?[0-9]+[fl]?)}; 235our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?};
236our $Float = qr{$Float_hex|$Float_dec|$Float_int}; 236our $Float = qr{$Float_hex|$Float_dec|$Float_int};
237our $Constant = qr{(?:$Float|(?i:(?:0x[0-9a-f]+|[0-9]+)[ul]*))}; 237our $Constant = qr{$Float|(?i)(?:0x[0-9a-f]+|[0-9]+)[ul]*};
238our $Assignment = qr{(?:\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=)}; 238our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=};
239our $Compare = qr{<=|>=|==|!=|<|>}; 239our $Compare = qr{<=|>=|==|!=|<|>};
240our $Operators = qr{ 240our $Operators = qr{
241 <=|>=|==|!=| 241 <=|>=|==|!=|
@@ -1931,6 +1931,12 @@ sub process {
1931 "use the SSYNC() macro in asm/blackfin.h\n" . $herevet); 1931 "use the SSYNC() macro in asm/blackfin.h\n" . $herevet);
1932 } 1932 }
1933 1933
1934# check for old HOTPLUG __dev<foo> section markings
1935 if ($line =~ /\b(__dev(init|exit)(data|const|))\b/) {
1936 WARN("HOTPLUG_SECTION",
1937 "Using $1 is unnecessary\n" . $herecurr);
1938 }
1939
1934# Check for potential 'bare' types 1940# Check for potential 'bare' types
1935 my ($stat, $cond, $line_nr_next, $remain_next, $off_next, 1941 my ($stat, $cond, $line_nr_next, $remain_next, $off_next,
1936 $realline_next); 1942 $realline_next);
@@ -2430,6 +2436,15 @@ sub process {
2430 "Prefer pr_warn(... to pr_warning(...\n" . $herecurr); 2436 "Prefer pr_warn(... to pr_warning(...\n" . $herecurr);
2431 } 2437 }
2432 2438
2439 if ($line =~ /\bdev_printk\s*\(\s*KERN_([A-Z]+)/) {
2440 my $orig = $1;
2441 my $level = lc($orig);
2442 $level = "warn" if ($level eq "warning");
2443 $level = "dbg" if ($level eq "debug");
2444 WARN("PREFER_DEV_LEVEL",
2445 "Prefer dev_$level(... to dev_printk(KERN_$orig, ...\n" . $herecurr);
2446 }
2447
2433# function brace can't be on same line, except for #defines of do while, 2448# function brace can't be on same line, except for #defines of do while,
2434# or if closed on same line 2449# or if closed on same line
2435 if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and 2450 if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and
@@ -2915,6 +2930,7 @@ sub process {
2915 my $var = $1; 2930 my $var = $1;
2916 if ($var !~ /$Constant/ && 2931 if ($var !~ /$Constant/ &&
2917 $var =~ /[A-Z]\w*[a-z]|[a-z]\w*[A-Z]/ && 2932 $var =~ /[A-Z]\w*[a-z]|[a-z]\w*[A-Z]/ &&
2933 $var !~ /"^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&
2918 !defined $camelcase{$var}) { 2934 !defined $camelcase{$var}) {
2919 $camelcase{$var} = 1; 2935 $camelcase{$var} = 1;
2920 WARN("CAMELCASE", 2936 WARN("CAMELCASE",
@@ -3237,9 +3253,9 @@ sub process {
3237 } 3253 }
3238 3254
3239# prefer usleep_range over udelay 3255# prefer usleep_range over udelay
3240 if ($line =~ /\budelay\s*\(\s*(\w+)\s*\)/) { 3256 if ($line =~ /\budelay\s*\(\s*(\d+)\s*\)/) {
3241 # ignore udelay's < 10, however 3257 # ignore udelay's < 10, however
3242 if (! (($1 =~ /(\d+)/) && ($1 < 10)) ) { 3258 if (! ($1 < 10) ) {
3243 CHK("USLEEP_RANGE", 3259 CHK("USLEEP_RANGE",
3244 "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt\n" . $line); 3260 "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt\n" . $line);
3245 } 3261 }
@@ -3460,6 +3476,12 @@ sub process {
3460 "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr); 3476 "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr);
3461 } 3477 }
3462 3478
3479# check for alloc argument mismatch
3480 if ($line =~ /\b(kcalloc|kmalloc_array)\s*\(\s*sizeof\b/) {
3481 WARN("ALLOC_ARRAY_ARGS",
3482 "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr);
3483 }
3484
3463# check for multiple semicolons 3485# check for multiple semicolons
3464 if ($line =~ /;\s*;\s*$/) { 3486 if ($line =~ /;\s*;\s*$/) {
3465 WARN("ONE_SEMICOLON", 3487 WARN("ONE_SEMICOLON",
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index 17e384396705..544aa56b6200 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -34,7 +34,7 @@ use strict;
34# $1 (first bracket) matches the dynamic amount of the stack growth 34# $1 (first bracket) matches the dynamic amount of the stack growth
35# 35#
36# use anything else and feel the pain ;) 36# use anything else and feel the pain ;)
37my (@stack, $re, $dre, $x, $xs); 37my (@stack, $re, $dre, $x, $xs, $funcre);
38{ 38{
39 my $arch = shift; 39 my $arch = shift;
40 if ($arch eq "") { 40 if ($arch eq "") {
@@ -44,6 +44,7 @@ my (@stack, $re, $dre, $x, $xs);
44 44
45 $x = "[0-9a-f]"; # hex character 45 $x = "[0-9a-f]"; # hex character
46 $xs = "[0-9a-f ]"; # hex character or space 46 $xs = "[0-9a-f ]"; # hex character or space
47 $funcre = qr/^$x* <(.*)>:$/;
47 if ($arch eq 'arm') { 48 if ($arch eq 'arm') {
48 #c0008ffc: e24dd064 sub sp, sp, #100 ; 0x64 49 #c0008ffc: e24dd064 sub sp, sp, #100 ; 0x64
49 $re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o; 50 $re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o;
@@ -66,6 +67,10 @@ my (@stack, $re, $dre, $x, $xs);
66 # 2b6c: 4e56 fb70 linkw %fp,#-1168 67 # 2b6c: 4e56 fb70 linkw %fp,#-1168
67 # 1df770: defc ffe4 addaw #-28,%sp 68 # 1df770: defc ffe4 addaw #-28,%sp
68 $re = qr/.*(?:linkw %fp,|addaw )#-([0-9]{1,4})(?:,%sp)?$/o; 69 $re = qr/.*(?:linkw %fp,|addaw )#-([0-9]{1,4})(?:,%sp)?$/o;
70 } elsif ($arch eq 'metag') {
71 #400026fc: 40 00 00 82 ADD A0StP,A0StP,#0x8
72 $re = qr/.*ADD.*A0StP,A0StP,\#(0x$x{1,8})/o;
73 $funcre = qr/^$x* <[^\$](.*)>:$/;
69 } elsif ($arch eq 'mips64') { 74 } elsif ($arch eq 'mips64') {
70 #8800402c: 67bdfff0 daddiu sp,sp,-16 75 #8800402c: 67bdfff0 daddiu sp,sp,-16
71 $re = qr/.*daddiu.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o; 76 $re = qr/.*daddiu.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o;
@@ -109,7 +114,6 @@ my (@stack, $re, $dre, $x, $xs);
109# 114#
110# main() 115# main()
111# 116#
112my $funcre = qr/^$x* <(.*)>:$/;
113my ($func, $file, $lastslash); 117my ($func, $file, $lastslash);
114 118
115while (my $line = <STDIN>) { 119while (my $line = <STDIN>) {
diff --git a/scripts/coccicheck b/scripts/coccicheck
index 1a49d1c7ecfe..85d31899ad98 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -2,6 +2,15 @@
2 2
3SPATCH="`which ${SPATCH:=spatch}`" 3SPATCH="`which ${SPATCH:=spatch}`"
4 4
5# The verbosity may be set by the environmental parameter V=
6# as for example with 'make V=1 coccicheck'
7
8if [ -n "$V" -a "$V" != "0" ]; then
9 VERBOSE=1
10else
11 VERBOSE=0
12fi
13
5if [ "$C" = "1" -o "$C" = "2" ]; then 14if [ "$C" = "1" -o "$C" = "2" ]; then
6 ONLINE=1 15 ONLINE=1
7 16
@@ -46,6 +55,14 @@ if [ "$ONLINE" = "0" ] ; then
46 echo '' 55 echo ''
47fi 56fi
48 57
58run_cmd() {
59 if [ $VERBOSE -ne 0 ] ; then
60 echo "Running: $@"
61 fi
62 eval $@
63}
64
65
49coccinelle () { 66coccinelle () {
50 COCCI="$1" 67 COCCI="$1"
51 68
@@ -55,7 +72,7 @@ coccinelle () {
55# 72#
56# $SPATCH -D $MODE $FLAGS -parse_cocci $COCCI $OPT > /dev/null 73# $SPATCH -D $MODE $FLAGS -parse_cocci $COCCI $OPT > /dev/null
57 74
58 if [ "$ONLINE" = "0" ] ; then 75 if [ $VERBOSE -ne 0 ] ; then
59 76
60 FILE=`echo $COCCI | sed "s|$srctree/||"` 77 FILE=`echo $COCCI | sed "s|$srctree/||"`
61 78
@@ -91,15 +108,21 @@ coccinelle () {
91 fi 108 fi
92 109
93 if [ "$MODE" = "chain" ] ; then 110 if [ "$MODE" = "chain" ] ; then
94 $SPATCH -D patch $FLAGS -sp_file $COCCI $OPT $OPTIONS || \ 111 run_cmd $SPATCH -D patch \
95 $SPATCH -D report $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || \ 112 $FLAGS -sp_file $COCCI $OPT $OPTIONS || \
96 $SPATCH -D context $FLAGS -sp_file $COCCI $OPT $OPTIONS || \ 113 run_cmd $SPATCH -D report \
97 $SPATCH -D org $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || exit 1 114 $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || \
115 run_cmd $SPATCH -D context \
116 $FLAGS -sp_file $COCCI $OPT $OPTIONS || \
117 run_cmd $SPATCH -D org \
118 $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || exit 1
98 elif [ "$MODE" = "rep+ctxt" ] ; then 119 elif [ "$MODE" = "rep+ctxt" ] ; then
99 $SPATCH -D report $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff && \ 120 run_cmd $SPATCH -D report \
100 $SPATCH -D context $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1 121 $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff && \
122 run_cmd $SPATCH -D context \
123 $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
101 else 124 else
102 $SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1 125 run_cmd $SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
103 fi 126 fi
104 127
105} 128}
diff --git a/scripts/coccinelle/api/devm_ioremap_resource.cocci b/scripts/coccinelle/api/devm_ioremap_resource.cocci
new file mode 100644
index 000000000000..495daa3dbf77
--- /dev/null
+++ b/scripts/coccinelle/api/devm_ioremap_resource.cocci
@@ -0,0 +1,90 @@
1virtual patch
2virtual report
3
4@depends on patch@
5expression base, dev, res;
6@@
7
8-base = devm_request_and_ioremap(dev, res);
9+base = devm_ioremap_resource(dev, res);
10 ...
11 if (
12-base == NULL
13+IS_ERR(base)
14 || ...) {
15<...
16- return ...;
17+ return PTR_ERR(base);
18...>
19 }
20
21@depends on patch@
22expression e, E, ret;
23identifier l;
24@@
25
26 e = devm_ioremap_resource(...);
27 ...
28 if (IS_ERR(e) || ...) {
29 ... when any
30- ret = E;
31+ ret = PTR_ERR(e);
32 ...
33(
34 return ret;
35|
36 goto l;
37)
38 }
39
40@depends on patch@
41expression e;
42@@
43
44 e = devm_ioremap_resource(...);
45 ...
46 if (IS_ERR(e) || ...) {
47 ...
48- \(dev_dbg\|dev_err\|pr_debug\|pr_err\|DRM_ERROR\)(...);
49 ...
50 }
51
52@depends on patch@
53expression e;
54identifier l;
55@@
56
57 e = devm_ioremap_resource(...);
58 ...
59 if (IS_ERR(e) || ...)
60-{
61(
62 return ...;
63|
64 goto l;
65)
66-}
67
68@r depends on report@
69expression e;
70identifier l;
71position p1;
72@@
73
74*e = devm_request_and_ioremap@p1(...);
75 ...
76 if (e == NULL || ...) {
77 ...
78(
79 return ...;
80|
81 goto l;
82)
83 }
84
85@script:python depends on r@
86p1 << r.p1;
87@@
88
89msg = "ERROR: deprecated devm_request_and_ioremap() API used on line %s" % (p1[0].line)
90coccilib.report.print_report(p1[0], msg)
diff --git a/scripts/coccinelle/misc/memcpy-assign.cocci b/scripts/coccinelle/misc/memcpy-assign.cocci
new file mode 100644
index 000000000000..afd058be497f
--- /dev/null
+++ b/scripts/coccinelle/misc/memcpy-assign.cocci
@@ -0,0 +1,103 @@
1//
2// Replace memcpy with struct assignment.
3//
4// Confidence: High
5// Copyright: (C) 2012 Peter Senna Tschudin, INRIA/LIP6. GPLv2.
6// URL: http://coccinelle.lip6.fr/
7// Comments:
8// Options: --no-includes --include-headers
9
10virtual patch
11virtual report
12virtual context
13virtual org
14
15@r1 depends on !patch@
16identifier struct_name;
17struct struct_name to;
18struct struct_name from;
19struct struct_name *top;
20struct struct_name *fromp;
21position p;
22@@
23memcpy@p(\(&(to)\|top\), \(&(from)\|fromp\), \(sizeof(to)\|sizeof(from)\|sizeof(struct struct_name)\|sizeof(*top)\|sizeof(*fromp)\))
24
25@script:python depends on report@
26p << r1.p;
27@@
28coccilib.report.print_report(p[0],"Replace memcpy with struct assignment")
29
30@depends on context@
31position r1.p;
32@@
33*memcpy@p(...);
34
35@script:python depends on org@
36p << r1.p;
37@@
38cocci.print_main("Replace memcpy with struct assignment",p)
39
40@depends on patch@
41identifier struct_name;
42struct struct_name to;
43struct struct_name from;
44@@
45(
46-memcpy(&(to), &(from), sizeof(to));
47+to = from;
48|
49-memcpy(&(to), &(from), sizeof(from));
50+to = from;
51|
52-memcpy(&(to), &(from), sizeof(struct struct_name));
53+to = from;
54)
55
56@depends on patch@
57identifier struct_name;
58struct struct_name to;
59struct struct_name *from;
60@@
61(
62-memcpy(&(to), from, sizeof(to));
63+to = *from;
64|
65-memcpy(&(to), from, sizeof(*from));
66+to = *from;
67|
68-memcpy(&(to), from, sizeof(struct struct_name));
69+to = *from;
70)
71
72@depends on patch@
73identifier struct_name;
74struct struct_name *to;
75struct struct_name from;
76@@
77(
78-memcpy(to, &(from), sizeof(*to));
79+ *to = from;
80|
81-memcpy(to, &(from), sizeof(from));
82+ *to = from;
83|
84-memcpy(to, &(from), sizeof(struct struct_name));
85+ *to = from;
86)
87
88@depends on patch@
89identifier struct_name;
90struct struct_name *to;
91struct struct_name *from;
92@@
93(
94-memcpy(to, from, sizeof(*to));
95+ *to = *from;
96|
97-memcpy(to, from, sizeof(*from));
98+ *to = *from;
99|
100-memcpy(to, from, sizeof(struct struct_name));
101+ *to = *from;
102)
103
diff --git a/scripts/coccinelle/misc/orplus.cocci b/scripts/coccinelle/misc/orplus.cocci
new file mode 100644
index 000000000000..4a28cef1484e
--- /dev/null
+++ b/scripts/coccinelle/misc/orplus.cocci
@@ -0,0 +1,55 @@
1/// Check for constants that are added but are used elsewhere as bitmasks
2/// The results should be checked manually to ensure that the nonzero
3/// bits in the two constants are actually disjoint.
4///
5// Confidence: Moderate
6// Copyright: (C) 2013 Julia Lawall, INRIA/LIP6. GPLv2.
7// Copyright: (C) 2013 Gilles Muller, INRIA/LIP6. GPLv2.
8// URL: http://coccinelle.lip6.fr/
9// Comments:
10// Options: -no_includes -include_headers
11
12virtual org
13virtual report
14virtual context
15
16@r@
17constant c;
18identifier i;
19expression e;
20@@
21
22(
23e | c@i
24|
25e & c@i
26|
27e |= c@i
28|
29e &= c@i
30)
31
32@s@
33constant r.c,c1;
34identifier i1;
35position p;
36@@
37
38(
39 c1 + c - 1
40|
41*c1@i1 +@p c
42)
43
44@script:python depends on org@
45p << s.p;
46@@
47
48cocci.print_main("sum of probable bitmasks, consider |",p)
49
50@script:python depends on report@
51p << s.p;
52@@
53
54msg = "WARNING: sum of probable bitmasks, consider |"
55coccilib.report.print_report(p[0],msg)
diff --git a/scripts/coccinelle/misc/semicolon.cocci b/scripts/coccinelle/misc/semicolon.cocci
new file mode 100644
index 000000000000..a47eba2edc9e
--- /dev/null
+++ b/scripts/coccinelle/misc/semicolon.cocci
@@ -0,0 +1,83 @@
1///
2/// Removes unneeded semicolon.
3///
4// Confidence: Moderate
5// Copyright: (C) 2012 Peter Senna Tschudin, INRIA/LIP6. GPLv2.
6// URL: http://coccinelle.lip6.fr/
7// Comments: Some false positives on empty default cases in switch statements.
8// Options: --no-includes --include-headers
9
10virtual patch
11virtual report
12virtual context
13virtual org
14
15@r_default@
16position p;
17@@
18switch (...)
19{
20default: ...;@p
21}
22
23@r_case@
24position p;
25@@
26(
27switch (...)
28{
29case ...:;@p
30}
31|
32switch (...)
33{
34case ...:...
35case ...:;@p
36}
37|
38switch (...)
39{
40case ...:...
41case ...:
42case ...:;@p
43}
44)
45
46@r1@
47statement S;
48position p1;
49position p != {r_default.p, r_case.p};
50identifier label;
51@@
52(
53label:;
54|
55S@p1;@p
56)
57
58@script:python@
59p << r1.p;
60p1 << r1.p1;
61@@
62if p[0].line != p1[0].line_end:
63 cocci.include_match(False)
64
65@depends on patch@
66position r1.p;
67@@
68-;@p
69
70@script:python depends on report@
71p << r1.p;
72@@
73coccilib.report.print_report(p[0],"Unneeded semicolon")
74
75@depends on context@
76position r1.p;
77@@
78*;@p
79
80@script:python depends on org@
81p << r1.p;
82@@
83cocci.print_main("Unneeded semicolon",p)
diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c
index 8a106499ec4f..d25e4a118d37 100644
--- a/scripts/genksyms/genksyms.c
+++ b/scripts/genksyms/genksyms.c
@@ -826,7 +826,8 @@ int main(int argc, char **argv)
826 genksyms_usage(); 826 genksyms_usage();
827 return 1; 827 return 1;
828 } 828 }
829 if ((strcmp(arch, "h8300") == 0) || (strcmp(arch, "blackfin") == 0)) 829 if ((strcmp(arch, "h8300") == 0) || (strcmp(arch, "blackfin") == 0) ||
830 (strcmp(arch, "metag") == 0))
830 mod_prefix = "_"; 831 mod_prefix = "_";
831 { 832 {
832 extern int yydebug; 833 extern int yydebug;
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 8b673dd4627f..ce4cc837b748 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -433,7 +433,7 @@ foreach my $file (@ARGV) {
433 433
434 while (<$patch>) { 434 while (<$patch>) {
435 my $patch_line = $_; 435 my $patch_line = $_;
436 if (m/^\+\+\+\s+(\S+)/) { 436 if (m/^\+\+\+\s+(\S+)/ or m/^---\s+(\S+)/) {
437 my $filename = $1; 437 my $filename = $1;
438 $filename =~ s@^[^/]*/@@; 438 $filename =~ s@^[^/]*/@@;
439 $filename =~ s@\n@@; 439 $filename =~ s@\n@@;
@@ -611,6 +611,10 @@ sub get_maintainers {
611 $hash{$tvi} = $value_pd; 611 $hash{$tvi} = $value_pd;
612 } 612 }
613 } 613 }
614 } elsif ($type eq 'K') {
615 if ($file =~ m/$value/x) {
616 $hash{$tvi} = 0;
617 }
614 } 618 }
615 } 619 }
616 } 620 }
diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
index 6c353ae8a451..581ca99c96f2 100644
--- a/scripts/headers_install.pl
+++ b/scripts/headers_install.pl
@@ -42,9 +42,9 @@ foreach my $filename (@files) {
42 $line =~ s/(^|\s)(inline)\b/$1__$2__/g; 42 $line =~ s/(^|\s)(inline)\b/$1__$2__/g;
43 $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g; 43 $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g;
44 $line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g; 44 $line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g;
45 $line =~ s/#ifndef _UAPI/#ifndef /; 45 $line =~ s/#ifndef\s+_UAPI/#ifndef /;
46 $line =~ s/#define _UAPI/#define /; 46 $line =~ s/#define\s+_UAPI/#define /;
47 $line =~ s!#endif /[*] _UAPI!#endif /* !; 47 $line =~ s!#endif\s+/[*]\s*_UAPI!#endif /* !;
48 printf {$out} "%s", $line; 48 printf {$out} "%s", $line;
49 } 49 }
50 close $out; 50 close $out;
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 3091794e9354..231b4759c714 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -11,6 +11,9 @@ else
11Kconfig := Kconfig 11Kconfig := Kconfig
12endif 12endif
13 13
14# We need this, in case the user has it in its environment
15unexport CONFIG_
16
14xconfig: $(obj)/qconf 17xconfig: $(obj)/qconf
15 $< $(Kconfig) 18 $< $(Kconfig)
16 19
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 4da3b4adfad2..e39fcd8143ea 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -36,6 +36,7 @@ enum input_mode {
36} input_mode = oldaskconfig; 36} input_mode = oldaskconfig;
37 37
38static int indent = 1; 38static int indent = 1;
39static int tty_stdio;
39static int valid_stdin = 1; 40static int valid_stdin = 1;
40static int sync_kconfig; 41static int sync_kconfig;
41static int conf_cnt; 42static int conf_cnt;
@@ -108,6 +109,8 @@ static int conf_askvalue(struct symbol *sym, const char *def)
108 case oldaskconfig: 109 case oldaskconfig:
109 fflush(stdout); 110 fflush(stdout);
110 xfgets(line, 128, stdin); 111 xfgets(line, 128, stdin);
112 if (!tty_stdio)
113 printf("\n");
111 return 1; 114 return 1;
112 default: 115 default:
113 break; 116 break;
@@ -495,6 +498,8 @@ int main(int ac, char **av)
495 bindtextdomain(PACKAGE, LOCALEDIR); 498 bindtextdomain(PACKAGE, LOCALEDIR);
496 textdomain(PACKAGE); 499 textdomain(PACKAGE);
497 500
501 tty_stdio = isatty(0) && isatty(1) && isatty(2);
502
498 while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) { 503 while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) {
499 input_mode = (enum input_mode)opt; 504 input_mode = (enum input_mode)opt;
500 switch (opt) { 505 switch (opt) {
@@ -621,7 +626,7 @@ int main(int ac, char **av)
621 return 1; 626 return 1;
622 } 627 }
623 } 628 }
624 valid_stdin = isatty(0) && isatty(1) && isatty(2); 629 valid_stdin = tty_stdio;
625 } 630 }
626 631
627 switch (input_mode) { 632 switch (input_mode) {
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
index 290ce41f8ba4..d6626521f9b9 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -13,7 +13,7 @@
13 13
14struct expr *expr_alloc_symbol(struct symbol *sym) 14struct expr *expr_alloc_symbol(struct symbol *sym)
15{ 15{
16 struct expr *e = calloc(1, sizeof(*e)); 16 struct expr *e = xcalloc(1, sizeof(*e));
17 e->type = E_SYMBOL; 17 e->type = E_SYMBOL;
18 e->left.sym = sym; 18 e->left.sym = sym;
19 return e; 19 return e;
@@ -21,7 +21,7 @@ struct expr *expr_alloc_symbol(struct symbol *sym)
21 21
22struct expr *expr_alloc_one(enum expr_type type, struct expr *ce) 22struct expr *expr_alloc_one(enum expr_type type, struct expr *ce)
23{ 23{
24 struct expr *e = calloc(1, sizeof(*e)); 24 struct expr *e = xcalloc(1, sizeof(*e));
25 e->type = type; 25 e->type = type;
26 e->left.expr = ce; 26 e->left.expr = ce;
27 return e; 27 return e;
@@ -29,7 +29,7 @@ struct expr *expr_alloc_one(enum expr_type type, struct expr *ce)
29 29
30struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2) 30struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2)
31{ 31{
32 struct expr *e = calloc(1, sizeof(*e)); 32 struct expr *e = xcalloc(1, sizeof(*e));
33 e->type = type; 33 e->type = type;
34 e->left.expr = e1; 34 e->left.expr = e1;
35 e->right.expr = e2; 35 e->right.expr = e2;
@@ -38,7 +38,7 @@ struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e
38 38
39struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2) 39struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2)
40{ 40{
41 struct expr *e = calloc(1, sizeof(*e)); 41 struct expr *e = xcalloc(1, sizeof(*e));
42 e->type = type; 42 e->type = type;
43 e->left.sym = s1; 43 e->left.sym = s1;
44 e->right.sym = s2; 44 e->right.sym = s2;
@@ -66,7 +66,7 @@ struct expr *expr_copy(const struct expr *org)
66 if (!org) 66 if (!org)
67 return NULL; 67 return NULL;
68 68
69 e = malloc(sizeof(*org)); 69 e = xmalloc(sizeof(*org));
70 memcpy(e, org, sizeof(*org)); 70 memcpy(e, org, sizeof(*org));
71 switch (org->type) { 71 switch (org->type) {
72 case E_SYMBOL: 72 case E_SYMBOL:
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index adc230638c5b..f2bee70e26f4 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -10,6 +10,7 @@
10# include <config.h> 10# include <config.h>
11#endif 11#endif
12 12
13#include <stdlib.h>
13#include "lkc.h" 14#include "lkc.h"
14#include "images.c" 15#include "images.c"
15 16
@@ -22,7 +23,6 @@
22#include <string.h> 23#include <string.h>
23#include <unistd.h> 24#include <unistd.h>
24#include <time.h> 25#include <time.h>
25#include <stdlib.h>
26 26
27//#define DEBUG 27//#define DEBUG
28 28
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index c18f2bd9c095..f8aee5fc6d5e 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -39,6 +39,12 @@ extern "C" {
39#ifndef CONFIG_ 39#ifndef CONFIG_
40#define CONFIG_ "CONFIG_" 40#define CONFIG_ "CONFIG_"
41#endif 41#endif
42static inline const char *CONFIG_prefix(void)
43{
44 return getenv( "CONFIG_" ) ?: CONFIG_;
45}
46#undef CONFIG_
47#define CONFIG_ CONFIG_prefix()
42 48
43#define TF_COMMAND 0x0001 49#define TF_COMMAND 0x0001
44#define TF_PARAM 0x0002 50#define TF_PARAM 0x0002
@@ -116,6 +122,8 @@ void menu_set_type(int type);
116/* util.c */ 122/* util.c */
117struct file *file_lookup(const char *name); 123struct file *file_lookup(const char *name);
118int file_write_dep(const char *name); 124int file_write_dep(const char *name);
125void *xmalloc(size_t size);
126void *xcalloc(size_t nmemb, size_t size);
119 127
120struct gstr { 128struct gstr {
121 size_t len; 129 size_t len;
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index c8e8a7154753..80788137c670 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -21,6 +21,7 @@ ccflags()
21{ 21{
22 if [ -f /usr/include/ncursesw/curses.h ]; then 22 if [ -f /usr/include/ncursesw/curses.h ]; then
23 echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"' 23 echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"'
24 echo ' -DNCURSES_WIDECHAR=1'
24 elif [ -f /usr/include/ncurses/ncurses.h ]; then 25 elif [ -f /usr/include/ncurses/ncurses.h ]; then
25 echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"' 26 echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
26 elif [ -f /usr/include/ncurses/curses.h ]; then 27 elif [ -f /usr/include/ncurses/curses.h ]; then
diff --git a/scripts/kconfig/lxdialog/dialog.h b/scripts/kconfig/lxdialog/dialog.h
index ee17a5264d5b..307022a8beef 100644
--- a/scripts/kconfig/lxdialog/dialog.h
+++ b/scripts/kconfig/lxdialog/dialog.h
@@ -221,7 +221,6 @@ int dialog_menu(const char *title, const char *prompt,
221 const void *selected, int *s_scroll); 221 const void *selected, int *s_scroll);
222int dialog_checklist(const char *title, const char *prompt, int height, 222int dialog_checklist(const char *title, const char *prompt, int height,
223 int width, int list_height); 223 int width, int list_height);
224extern char dialog_input_result[];
225int dialog_inputbox(const char *title, const char *prompt, int height, 224int dialog_inputbox(const char *title, const char *prompt, int height,
226 int width, const char *init); 225 int width, const char *init);
227 226
diff --git a/scripts/kconfig/lxdialog/inputbox.c b/scripts/kconfig/lxdialog/inputbox.c
index dd8e587c50e2..21404a04d7c3 100644
--- a/scripts/kconfig/lxdialog/inputbox.c
+++ b/scripts/kconfig/lxdialog/inputbox.c
@@ -45,7 +45,8 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
45 const char *init) 45 const char *init)
46{ 46{
47 int i, x, y, box_y, box_x, box_width; 47 int i, x, y, box_y, box_x, box_width;
48 int input_x = 0, scroll = 0, key = 0, button = -1; 48 int input_x = 0, key = 0, button = -1;
49 int show_x, len, pos;
49 char *instr = dialog_input_result; 50 char *instr = dialog_input_result;
50 WINDOW *dialog; 51 WINDOW *dialog;
51 52
@@ -97,14 +98,17 @@ do_resize:
97 wmove(dialog, box_y, box_x); 98 wmove(dialog, box_y, box_x);
98 wattrset(dialog, dlg.inputbox.atr); 99 wattrset(dialog, dlg.inputbox.atr);
99 100
100 input_x = strlen(instr); 101 len = strlen(instr);
102 pos = len;
101 103
102 if (input_x >= box_width) { 104 if (len >= box_width) {
103 scroll = input_x - box_width + 1; 105 show_x = len - box_width + 1;
104 input_x = box_width - 1; 106 input_x = box_width - 1;
105 for (i = 0; i < box_width - 1; i++) 107 for (i = 0; i < box_width - 1; i++)
106 waddch(dialog, instr[scroll + i]); 108 waddch(dialog, instr[show_x + i]);
107 } else { 109 } else {
110 show_x = 0;
111 input_x = len;
108 waddstr(dialog, instr); 112 waddstr(dialog, instr);
109 } 113 }
110 114
@@ -121,45 +125,104 @@ do_resize:
121 case KEY_UP: 125 case KEY_UP:
122 case KEY_DOWN: 126 case KEY_DOWN:
123 break; 127 break;
124 case KEY_LEFT:
125 continue;
126 case KEY_RIGHT:
127 continue;
128 case KEY_BACKSPACE: 128 case KEY_BACKSPACE:
129 case 127: 129 case 127:
130 if (input_x || scroll) { 130 if (pos) {
131 wattrset(dialog, dlg.inputbox.atr); 131 wattrset(dialog, dlg.inputbox.atr);
132 if (!input_x) { 132 if (input_x == 0) {
133 scroll = scroll < box_width - 1 ? 0 : scroll - (box_width - 1); 133 show_x--;
134 wmove(dialog, box_y, box_x);
135 for (i = 0; i < box_width; i++)
136 waddch(dialog,
137 instr[scroll + input_x + i] ?
138 instr[scroll + input_x + i] : ' ');
139 input_x = strlen(instr) - scroll;
140 } else 134 } else
141 input_x--; 135 input_x--;
142 instr[scroll + input_x] = '\0'; 136
143 mvwaddch(dialog, box_y, input_x + box_x, ' '); 137 if (pos < len) {
138 for (i = pos - 1; i < len; i++) {
139 instr[i] = instr[i+1];
140 }
141 }
142
143 pos--;
144 len--;
145 instr[len] = '\0';
146 wmove(dialog, box_y, box_x);
147 for (i = 0; i < box_width; i++) {
148 if (!instr[show_x + i]) {
149 waddch(dialog, ' ');
150 break;
151 }
152 waddch(dialog, instr[show_x + i]);
153 }
144 wmove(dialog, box_y, input_x + box_x); 154 wmove(dialog, box_y, input_x + box_x);
145 wrefresh(dialog); 155 wrefresh(dialog);
146 } 156 }
147 continue; 157 continue;
158 case KEY_LEFT:
159 if (pos > 0) {
160 if (input_x > 0) {
161 wmove(dialog, box_y, --input_x + box_x);
162 } else if (input_x == 0) {
163 show_x--;
164 wmove(dialog, box_y, box_x);
165 for (i = 0; i < box_width; i++) {
166 if (!instr[show_x + i]) {
167 waddch(dialog, ' ');
168 break;
169 }
170 waddch(dialog, instr[show_x + i]);
171 }
172 wmove(dialog, box_y, box_x);
173 }
174 pos--;
175 }
176 continue;
177 case KEY_RIGHT:
178 if (pos < len) {
179 if (input_x < box_width - 1) {
180 wmove(dialog, box_y, ++input_x + box_x);
181 } else if (input_x == box_width - 1) {
182 show_x++;
183 wmove(dialog, box_y, box_x);
184 for (i = 0; i < box_width; i++) {
185 if (!instr[show_x + i]) {
186 waddch(dialog, ' ');
187 break;
188 }
189 waddch(dialog, instr[show_x + i]);
190 }
191 wmove(dialog, box_y, input_x + box_x);
192 }
193 pos++;
194 }
195 continue;
148 default: 196 default:
149 if (key < 0x100 && isprint(key)) { 197 if (key < 0x100 && isprint(key)) {
150 if (scroll + input_x < MAX_LEN) { 198 if (len < MAX_LEN) {
151 wattrset(dialog, dlg.inputbox.atr); 199 wattrset(dialog, dlg.inputbox.atr);
152 instr[scroll + input_x] = key; 200 if (pos < len) {
153 instr[scroll + input_x + 1] = '\0'; 201 for (i = len; i > pos; i--)
202 instr[i] = instr[i-1];
203 instr[pos] = key;
204 } else {
205 instr[len] = key;
206 }
207 pos++;
208 len++;
209 instr[len] = '\0';
210
154 if (input_x == box_width - 1) { 211 if (input_x == box_width - 1) {
155 scroll++; 212 show_x++;
156 wmove(dialog, box_y, box_x);
157 for (i = 0; i < box_width - 1; i++)
158 waddch(dialog, instr [scroll + i]);
159 } else { 213 } else {
160 wmove(dialog, box_y, input_x++ + box_x); 214 input_x++;
161 waddch(dialog, key); 215 }
216
217 wmove(dialog, box_y, box_x);
218 for (i = 0; i < box_width; i++) {
219 if (!instr[show_x + i]) {
220 waddch(dialog, ' ');
221 break;
222 }
223 waddch(dialog, instr[show_x + i]);
162 } 224 }
225 wmove(dialog, box_y, input_x + box_x);
163 wrefresh(dialog); 226 wrefresh(dialog);
164 } else 227 } else
165 flash(); /* Alarm user about overflow */ 228 flash(); /* Alarm user about overflow */
diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c
index 1d604738fa13..48d382e7e374 100644
--- a/scripts/kconfig/lxdialog/menubox.c
+++ b/scripts/kconfig/lxdialog/menubox.c
@@ -26,7 +26,7 @@
26 * 26 *
27 * *) A bugfix for the Page-Down problem 27 * *) A bugfix for the Page-Down problem
28 * 28 *
29 * *) Formerly when I used Page Down and Page Up, the cursor would be set 29 * *) Formerly when I used Page Down and Page Up, the cursor would be set
30 * to the first position in the menu box. Now lxdialog is a bit 30 * to the first position in the menu box. Now lxdialog is a bit
31 * smarter and works more like other menu systems (just have a look at 31 * smarter and works more like other menu systems (just have a look at
32 * it). 32 * it).
@@ -154,12 +154,14 @@ static void print_arrows(WINDOW * win, int item_no, int scroll, int y, int x,
154 */ 154 */
155static void print_buttons(WINDOW * win, int height, int width, int selected) 155static void print_buttons(WINDOW * win, int height, int width, int selected)
156{ 156{
157 int x = width / 2 - 16; 157 int x = width / 2 - 28;
158 int y = height - 2; 158 int y = height - 2;
159 159
160 print_button(win, gettext("Select"), y, x, selected == 0); 160 print_button(win, gettext("Select"), y, x, selected == 0);
161 print_button(win, gettext(" Exit "), y, x + 12, selected == 1); 161 print_button(win, gettext(" Exit "), y, x + 12, selected == 1);
162 print_button(win, gettext(" Help "), y, x + 24, selected == 2); 162 print_button(win, gettext(" Help "), y, x + 24, selected == 2);
163 print_button(win, gettext(" Save "), y, x + 36, selected == 3);
164 print_button(win, gettext(" Load "), y, x + 48, selected == 4);
163 165
164 wmove(win, y, x + 1 + 12 * selected); 166 wmove(win, y, x + 1 + 12 * selected);
165 wrefresh(win); 167 wrefresh(win);
@@ -372,7 +374,7 @@ do_resize:
372 case TAB: 374 case TAB:
373 case KEY_RIGHT: 375 case KEY_RIGHT:
374 button = ((key == KEY_LEFT ? --button : ++button) < 0) 376 button = ((key == KEY_LEFT ? --button : ++button) < 0)
375 ? 2 : (button > 2 ? 0 : button); 377 ? 4 : (button > 4 ? 0 : button);
376 378
377 print_buttons(dialog, height, width, button); 379 print_buttons(dialog, height, width, button);
378 wrefresh(menu); 380 wrefresh(menu);
@@ -399,17 +401,17 @@ do_resize:
399 return 2; 401 return 2;
400 case 's': 402 case 's':
401 case 'y': 403 case 'y':
402 return 3; 404 return 5;
403 case 'n': 405 case 'n':
404 return 4; 406 return 6;
405 case 'm': 407 case 'm':
406 return 5; 408 return 7;
407 case ' ': 409 case ' ':
408 return 6; 410 return 8;
409 case '/': 411 case '/':
410 return 7; 412 return 9;
411 case 'z': 413 case 'z':
412 return 8; 414 return 10;
413 case '\n': 415 case '\n':
414 return button; 416 return button;
415 } 417 }
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 53975cf87608..566288a76370 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -280,6 +280,7 @@ static struct menu *current_menu;
280static int child_count; 280static int child_count;
281static int single_menu_mode; 281static int single_menu_mode;
282static int show_all_options; 282static int show_all_options;
283static int save_and_exit;
283 284
284static void conf(struct menu *menu, struct menu *active_menu); 285static void conf(struct menu *menu, struct menu *active_menu);
285static void conf_choice(struct menu *menu); 286static void conf_choice(struct menu *menu);
@@ -348,15 +349,19 @@ static void search_conf(void)
348{ 349{
349 struct symbol **sym_arr; 350 struct symbol **sym_arr;
350 struct gstr res; 351 struct gstr res;
352 struct gstr title;
351 char *dialog_input; 353 char *dialog_input;
352 int dres, vscroll = 0, hscroll = 0; 354 int dres, vscroll = 0, hscroll = 0;
353 bool again; 355 bool again;
354 356
357 title = str_new();
358 str_printf( &title, _("Enter %s (sub)string to search for "
359 "(with or without \"%s\")"), CONFIG_, CONFIG_);
360
355again: 361again:
356 dialog_clear(); 362 dialog_clear();
357 dres = dialog_inputbox(_("Search Configuration Parameter"), 363 dres = dialog_inputbox(_("Search Configuration Parameter"),
358 _("Enter " CONFIG_ " (sub)string to search for " 364 str_get(&title),
359 "(with or without \"" CONFIG_ "\")"),
360 10, 75, ""); 365 10, 75, "");
361 switch (dres) { 366 switch (dres) {
362 case 0: 367 case 0:
@@ -365,6 +370,7 @@ again:
365 show_helptext(_("Search Configuration"), search_help); 370 show_helptext(_("Search Configuration"), search_help);
366 goto again; 371 goto again;
367 default: 372 default:
373 str_free(&title);
368 return; 374 return;
369 } 375 }
370 376
@@ -398,6 +404,7 @@ again:
398 str_free(&res); 404 str_free(&res);
399 } while (again); 405 } while (again);
400 free(sym_arr); 406 free(sym_arr);
407 str_free(&title);
401} 408}
402 409
403static void build_conf(struct menu *menu) 410static void build_conf(struct menu *menu)
@@ -592,14 +599,6 @@ static void conf(struct menu *menu, struct menu *active_menu)
592 build_conf(menu); 599 build_conf(menu);
593 if (!child_count) 600 if (!child_count)
594 break; 601 break;
595 if (menu == &rootmenu) {
596 item_make("--- ");
597 item_set_tag(':');
598 item_make(_(" Load an Alternate Configuration File"));
599 item_set_tag('L');
600 item_make(_(" Save an Alternate Configuration File"));
601 item_set_tag('S');
602 }
603 dialog_clear(); 602 dialog_clear();
604 res = dialog_menu(prompt ? _(prompt) : _("Main Menu"), 603 res = dialog_menu(prompt ? _(prompt) : _("Main Menu"),
605 _(menu_instructions), 604 _(menu_instructions),
@@ -636,12 +635,6 @@ static void conf(struct menu *menu, struct menu *active_menu)
636 case 's': 635 case 's':
637 conf_string(submenu); 636 conf_string(submenu);
638 break; 637 break;
639 case 'L':
640 conf_load();
641 break;
642 case 'S':
643 conf_save();
644 break;
645 } 638 }
646 break; 639 break;
647 case 2: 640 case 2:
@@ -651,6 +644,12 @@ static void conf(struct menu *menu, struct menu *active_menu)
651 show_helptext(_("README"), _(mconf_readme)); 644 show_helptext(_("README"), _(mconf_readme));
652 break; 645 break;
653 case 3: 646 case 3:
647 conf_save();
648 break;
649 case 4:
650 conf_load();
651 break;
652 case 5:
654 if (item_is_tag('t')) { 653 if (item_is_tag('t')) {
655 if (sym_set_tristate_value(sym, yes)) 654 if (sym_set_tristate_value(sym, yes))
656 break; 655 break;
@@ -658,24 +657,24 @@ static void conf(struct menu *menu, struct menu *active_menu)
658 show_textbox(NULL, setmod_text, 6, 74); 657 show_textbox(NULL, setmod_text, 6, 74);
659 } 658 }
660 break; 659 break;
661 case 4: 660 case 6:
662 if (item_is_tag('t')) 661 if (item_is_tag('t'))
663 sym_set_tristate_value(sym, no); 662 sym_set_tristate_value(sym, no);
664 break; 663 break;
665 case 5: 664 case 7:
666 if (item_is_tag('t')) 665 if (item_is_tag('t'))
667 sym_set_tristate_value(sym, mod); 666 sym_set_tristate_value(sym, mod);
668 break; 667 break;
669 case 6: 668 case 8:
670 if (item_is_tag('t')) 669 if (item_is_tag('t'))
671 sym_toggle_tristate_value(sym); 670 sym_toggle_tristate_value(sym);
672 else if (item_is_tag('m')) 671 else if (item_is_tag('m'))
673 conf(submenu, NULL); 672 conf(submenu, NULL);
674 break; 673 break;
675 case 7: 674 case 9:
676 search_conf(); 675 search_conf();
677 break; 676 break;
678 case 8: 677 case 10:
679 show_all_options = !show_all_options; 678 show_all_options = !show_all_options;
680 break; 679 break;
681 } 680 }
@@ -702,6 +701,17 @@ static void show_helptext(const char *title, const char *text)
702 show_textbox(title, text, 0, 0); 701 show_textbox(title, text, 0, 0);
703} 702}
704 703
704static void conf_message_callback(const char *fmt, va_list ap)
705{
706 char buf[PATH_MAX+1];
707
708 vsnprintf(buf, sizeof(buf), fmt, ap);
709 if (save_and_exit)
710 printf("%s", buf);
711 else
712 show_textbox(NULL, buf, 6, 60);
713}
714
705static void show_help(struct menu *menu) 715static void show_help(struct menu *menu)
706{ 716{
707 struct gstr help = str_new(); 717 struct gstr help = str_new();
@@ -870,6 +880,7 @@ static int handle_exit(void)
870{ 880{
871 int res; 881 int res;
872 882
883 save_and_exit = 1;
873 dialog_clear(); 884 dialog_clear();
874 if (conf_get_changed()) 885 if (conf_get_changed())
875 res = dialog_yesno(NULL, 886 res = dialog_yesno(NULL,
@@ -941,6 +952,7 @@ int main(int ac, char **av)
941 } 952 }
942 953
943 set_config_filename(conf_get_configname()); 954 set_config_filename(conf_get_configname());
955 conf_set_message_callback(conf_message_callback);
944 do { 956 do {
945 conf(&rootmenu, NULL); 957 conf(&rootmenu, NULL);
946 res = handle_exit(); 958 res = handle_exit();
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index e98a05c8e508..f3bffa309333 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -48,7 +48,7 @@ void menu_add_entry(struct symbol *sym)
48{ 48{
49 struct menu *menu; 49 struct menu *menu;
50 50
51 menu = malloc(sizeof(*menu)); 51 menu = xmalloc(sizeof(*menu));
52 memset(menu, 0, sizeof(*menu)); 52 memset(menu, 0, sizeof(*menu));
53 menu->sym = sym; 53 menu->sym = sym;
54 menu->parent = current_menu; 54 menu->parent = current_menu;
@@ -531,7 +531,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
531 location = menu; 531 location = menu;
532 } 532 }
533 if (head && location) { 533 if (head && location) {
534 jump = malloc(sizeof(struct jump_key)); 534 jump = xmalloc(sizeof(struct jump_key));
535 535
536 if (menu_is_visible(prop->menu)) { 536 if (menu_is_visible(prop->menu)) {
537 /* 537 /*
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index 974d5cb7e30a..05274fccb88e 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -32,11 +32,13 @@ usage() {
32 echo " -m only merge the fragments, do not execute the make command" 32 echo " -m only merge the fragments, do not execute the make command"
33 echo " -n use allnoconfig instead of alldefconfig" 33 echo " -n use allnoconfig instead of alldefconfig"
34 echo " -r list redundant entries when merging fragments" 34 echo " -r list redundant entries when merging fragments"
35 echo " -O dir to put generated output files"
35} 36}
36 37
37MAKE=true 38MAKE=true
38ALLTARGET=alldefconfig 39ALLTARGET=alldefconfig
39WARNREDUN=false 40WARNREDUN=false
41OUTPUT=.
40 42
41while true; do 43while true; do
42 case $1 in 44 case $1 in
@@ -59,6 +61,16 @@ while true; do
59 shift 61 shift
60 continue 62 continue
61 ;; 63 ;;
64 "-O")
65 if [ -d $2 ];then
66 OUTPUT=$(echo $2 | sed 's/\/*$//')
67 else
68 echo "output directory $2 does not exist" 1>&2
69 exit 1
70 fi
71 shift 2
72 continue
73 ;;
62 *) 74 *)
63 break 75 break
64 ;; 76 ;;
@@ -100,9 +112,9 @@ for MERGE_FILE in $MERGE_LIST ; do
100done 112done
101 113
102if [ "$MAKE" = "false" ]; then 114if [ "$MAKE" = "false" ]; then
103 cp $TMP_FILE .config 115 cp $TMP_FILE $OUTPUT/.config
104 echo "#" 116 echo "#"
105 echo "# merged configuration written to .config (needs make)" 117 echo "# merged configuration written to $OUTPUT/.config (needs make)"
106 echo "#" 118 echo "#"
107 clean_up 119 clean_up
108 exit 120 exit
@@ -111,14 +123,14 @@ fi
111# Use the merged file as the starting point for: 123# Use the merged file as the starting point for:
112# alldefconfig: Fills in any missing symbols with Kconfig default 124# alldefconfig: Fills in any missing symbols with Kconfig default
113# allnoconfig: Fills in any missing symbols with # CONFIG_* is not set 125# allnoconfig: Fills in any missing symbols with # CONFIG_* is not set
114make KCONFIG_ALLCONFIG=$TMP_FILE $ALLTARGET 126make KCONFIG_ALLCONFIG=$TMP_FILE O=$OUTPUT $ALLTARGET
115 127
116 128
117# Check all specified config values took (might have missed-dependency issues) 129# Check all specified config values took (might have missed-dependency issues)
118for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do 130for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do
119 131
120 REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE) 132 REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE)
121 ACTUAL_VAL=$(grep -w -e "$CFG" .config) 133 ACTUAL_VAL=$(grep -w -e "$CFG" $OUTPUT/.config)
122 if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then 134 if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then
123 echo "Value requested for $CFG not in final .config" 135 echo "Value requested for $CFG not in final .config"
124 echo "Requested value: $REQUESTED_VAL" 136 echo "Requested value: $REQUESTED_VAL"
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
index 87d4b15da951..dbf31edd22b2 100644
--- a/scripts/kconfig/nconf.c
+++ b/scripts/kconfig/nconf.c
@@ -7,215 +7,208 @@
7 */ 7 */
8#define _GNU_SOURCE 8#define _GNU_SOURCE
9#include <string.h> 9#include <string.h>
10#include <stdlib.h>
10 11
11#include "lkc.h" 12#include "lkc.h"
12#include "nconf.h" 13#include "nconf.h"
13#include <ctype.h> 14#include <ctype.h>
14 15
15static const char nconf_readme[] = N_( 16static const char nconf_global_help[] = N_(
16"Overview\n" 17"Help windows\n"
17"--------\n" 18"------------\n"
18"This interface let you select features and parameters for the build.\n" 19"o Global help: Unless in a data entry window, pressing <F1> will give \n"
19"Features can either be built-in, modularized, or ignored. Parameters\n" 20" you the global help window, which you are just reading.\n"
20"must be entered in as decimal or hexadecimal numbers or text.\n"
21"\n" 21"\n"
22"Menu items beginning with following braces represent features that\n" 22"o A short version of the global help is available by pressing <F3>.\n"
23" [ ] can be built in or removed\n"
24" < > can be built in, modularized or removed\n"
25" { } can be built in or modularized (selected by other feature)\n"
26" - - are selected by other feature,\n"
27" XXX cannot be selected. Use Symbol Info to find out why,\n"
28"while *, M or whitespace inside braces means to build in, build as\n"
29"a module or to exclude the feature respectively.\n"
30"\n" 23"\n"
31"To change any of these features, highlight it with the cursor\n" 24"o Local help: To get help related to the current menu entry, use any\n"
32"keys and press <Y> to build it in, <M> to make it a module or\n" 25" of <?> <h>, or if in a data entry window then press <F1>.\n"
33"<N> to removed it. You may also press the <Space Bar> to cycle\n"
34"through the available options (ie. Y->N->M->Y).\n"
35"\n" 26"\n"
36"Some additional keyboard hints:\n"
37"\n" 27"\n"
38"Menus\n" 28"Menu entries\n"
39"----------\n" 29"------------\n"
40"o Use the Up/Down arrow keys (cursor keys) to highlight the item\n" 30"This interface lets you select features and parameters for the kernel\n"
41" you wish to change use <Enter> or <Space>. Goto submenu by \n" 31"build. Kernel features can either be built-in, modularized, or removed.\n"
42" pressing <Enter> of <right-arrow>. Use <Esc> or <left-arrow> to go back.\n" 32"Parameters must be entered as text or decimal or hexadecimal numbers.\n"
43" Submenus are designated by \"--->\".\n"
44"\n"
45" Searching: pressing '/' triggers interactive search mode.\n"
46" nconfig performs a case insensitive search for the string\n"
47" in the menu prompts (no regex support).\n"
48" Pressing the up/down keys highlights the previous/next\n"
49" matching item. Backspace removes one character from the\n"
50" match string. Pressing either '/' again or ESC exits\n"
51" search mode. All other keys behave normally.\n"
52"\n" 33"\n"
53" You may also use the <PAGE UP> and <PAGE DOWN> keys to scroll\n" 34"Menu entries beginning with following braces represent features that\n"
54" unseen options into view.\n" 35" [ ] can be built in or removed\n"
36" < > can be built in, modularized or removed\n"
37" { } can be built in or modularized, are selected by another feature\n"
38" - - are selected by another feature\n"
39" XXX cannot be selected. Symbol Info <F2> tells you why.\n"
40"*, M or whitespace inside braces means to build in, build as a module\n"
41"or to exclude the feature respectively.\n"
55"\n" 42"\n"
56"o To exit a menu use the just press <ESC> <F5> <F8> or <left-arrow>.\n" 43"To change any of these features, highlight it with the movement keys\n"
44"listed below and press <y> to build it in, <m> to make it a module or\n"
45"<n> to remove it. You may press the <Space> key to cycle through the\n"
46"available options.\n"
57"\n" 47"\n"
58"o To get help with an item, press <F1>\n" 48"A trailing \"--->\" designates a submenu.\n"
59" Shortcut: Press <h> or <?>.\n"
60"\n" 49"\n"
61"\n" 50"\n"
62"Radiolists (Choice lists)\n" 51"Menu navigation keys\n"
63"-----------\n" 52"----------------------------------------------------------------------\n"
64"o Use the cursor keys to select the option you wish to set and press\n" 53"Linewise up <Up>\n"
65" <S> or the <SPACE BAR>.\n" 54"Linewise down <Down>\n"
55"Pagewise up <Page Up>\n"
56"Pagewise down <Page Down>\n"
57"First entry <Home>\n"
58"Last entry <End>\n"
59"Enter a submenu <Right> <Enter>\n"
60"Go back to parent menu <Left> <Esc> <F5>\n"
61"Close a help window <Enter> <Esc> <F5>\n"
62"Close entry window, apply <Enter>\n"
63"Close entry window, forget <Esc> <F5>\n"
64"Start incremental, case-insensitive search for STRING in menu entries,\n"
65" no regex support, STRING is displayed in upper left corner\n"
66" </>STRING\n"
67" Remove last character <Backspace>\n"
68" Jump to next hit <Down>\n"
69" Jump to previous hit <Up>\n"
70"Exit menu search mode </> <Esc>\n"
71"Search for configuration variables with or without leading CONFIG_\n"
72" <F8>RegExpr<Enter>\n"
73"Verbose search help <F8><F1>\n"
74"----------------------------------------------------------------------\n"
66"\n" 75"\n"
67" Shortcut: Press the first letter of the option you wish to set then\n" 76"Unless in a data entry window, key <1> may be used instead of <F1>,\n"
68" press <S> or <SPACE BAR>.\n" 77"<2> instead of <F2>, etc.\n"
69"\n" 78"\n"
70"o To see available help for the item, press <F1>\n"
71" Shortcut: Press <H> or <?>.\n"
72"\n" 79"\n"
80"Radiolist (Choice list)\n"
81"-----------------------\n"
82"Use the movement keys listed above to select the option you wish to set\n"
83"and press <Space>.\n"
73"\n" 84"\n"
74"Data Entry\n"
75"-----------\n"
76"o Enter the requested information and press <ENTER>\n"
77" If you are entering hexadecimal values, it is not necessary to\n"
78" add the '0x' prefix to the entry.\n"
79"\n" 85"\n"
80"o For help, press <F1>.\n" 86"Data entry\n"
87"----------\n"
88"Enter the requested information and press <Enter>. Hexadecimal values\n"
89"may be entered without the \"0x\" prefix.\n"
81"\n" 90"\n"
82"\n" 91"\n"
83"Text Box (Help Window)\n" 92"Text Box (Help Window)\n"
84"--------\n" 93"----------------------\n"
85"o Use the cursor keys to scroll up/down/left/right. The VI editor\n" 94"Use movement keys as listed in table above.\n"
86" keys h,j,k,l function here as do <u>, <d> and <SPACE BAR> for\n"
87" those who are familiar with less and lynx.\n"
88"\n" 95"\n"
89"o Press <Enter>, <F1>, <F5>, <F9>, <q> or <Esc> to exit.\n" 96"Press any of <Enter> <Esc> <q> <F5> <F9> to exit.\n"
90"\n" 97"\n"
91"\n" 98"\n"
92"Alternate Configuration Files\n" 99"Alternate configuration files\n"
93"-----------------------------\n" 100"-----------------------------\n"
94"nconfig supports the use of alternate configuration files for\n" 101"nconfig supports switching between different configurations.\n"
95"those who, for various reasons, find it necessary to switch\n" 102"Press <F6> to save your current configuration. Press <F7> and enter\n"
96"between different configurations.\n" 103"a file name to load a previously saved configuration.\n"
97"\n" 104"\n"
98"At the end of the main menu you will find two options. One is\n"
99"for saving the current configuration to a file of your choosing.\n"
100"The other option is for loading a previously saved alternate\n"
101"configuration.\n"
102"\n" 105"\n"
103"Even if you don't use alternate configuration files, but you\n" 106"Terminal configuration\n"
104"find during a nconfig session that you have completely messed\n" 107"----------------------\n"
105"up your settings, you may use the \"Load Alternate...\" option to\n" 108"If you use nconfig in a xterm window, make sure your TERM environment\n"
106"restore your previously saved settings from \".config\" without\n" 109"variable specifies a terminal configuration which supports at least\n"
107"restarting nconfig.\n" 110"16 colors. Otherwise nconfig will look rather bad.\n"
108"\n" 111"\n"
109"Other information\n" 112"If the \"stty size\" command reports the current terminalsize correctly,\n"
110"-----------------\n" 113"nconfig will adapt to sizes larger than the traditional 80x25 \"standard\"\n"
111"If you use nconfig in an XTERM window make sure you have your\n" 114"and display longer menus properly.\n"
112"$TERM variable set to point to a xterm definition which supports color.\n"
113"Otherwise, nconfig will look rather bad. nconfig will not\n"
114"display correctly in a RXVT window because rxvt displays only one\n"
115"intensity of color, bright.\n"
116"\n" 115"\n"
117"nconfig will display larger menus on screens or xterms which are\n"
118"set to display more than the standard 25 row by 80 column geometry.\n"
119"In order for this to work, the \"stty size\" command must be able to\n"
120"display the screen's current row and column geometry. I STRONGLY\n"
121"RECOMMEND that you make sure you do NOT have the shell variables\n"
122"LINES and COLUMNS exported into your environment. Some distributions\n"
123"export those variables via /etc/profile. Some ncurses programs can\n"
124"become confused when those variables (LINES & COLUMNS) don't reflect\n"
125"the true screen size.\n"
126"\n" 116"\n"
127"Optional personality available\n" 117"Single menu mode\n"
128"------------------------------\n" 118"----------------\n"
129"If you prefer to have all of the options listed in a single menu, rather\n" 119"If you prefer to have all of the menu entries listed in a single menu,\n"
130"than the default multimenu hierarchy, run the nconfig with NCONFIG_MODE\n" 120"rather than the default multimenu hierarchy, run nconfig with\n"
131"environment variable set to single_menu. Example:\n" 121"NCONFIG_MODE environment variable set to single_menu. Example:\n"
132"\n" 122"\n"
133"make NCONFIG_MODE=single_menu nconfig\n" 123"make NCONFIG_MODE=single_menu nconfig\n"
134"\n" 124"\n"
135"<Enter> will then unroll the appropriate category, or enfold it if it\n" 125"<Enter> will then unfold the appropriate category, or fold it if it\n"
136"is already unrolled.\n" 126"is already unfolded. Folded menu entries will be designated by a\n"
127"leading \"++>\" and unfolded entries by a leading \"-->\".\n"
137"\n" 128"\n"
138"Note that this mode can eventually be a little more CPU expensive\n" 129"Note that this mode can eventually be a little more CPU expensive than\n"
139"(especially with a larger number of unrolled categories) than the\n" 130"the default mode, especially with a larger number of unfolded submenus.\n"
140"default mode.\n"
141"\n"), 131"\n"),
142menu_no_f_instructions[] = N_( 132menu_no_f_instructions[] = N_(
143" You do not have function keys support. Please follow the\n" 133"Legend: [*] built-in [ ] excluded <M> module < > module capable.\n"
144" following instructions:\n" 134"Submenus are designated by a trailing \"--->\".\n"
145" Arrow keys navigate the menu.\n" 135"\n"
146" <Enter> or <right-arrow> selects submenus --->.\n" 136"Use the following keys to navigate the menus:\n"
147" Capital Letters are hotkeys.\n" 137"Move up or down with <Up> and <Down>.\n"
148" Pressing <Y> includes, <N> excludes, <M> modularizes features.\n" 138"Enter a submenu with <Enter> or <Right>.\n"
149" Pressing SpaceBar toggles between the above options.\n" 139"Exit a submenu to its parent menu with <Esc> or <Left>.\n"
150" Press <Esc> or <left-arrow> to go back one menu,\n" 140"Pressing <y> includes, <n> excludes, <m> modularizes features.\n"
151" <?> or <h> for Help, </> for Search.\n" 141"Pressing <Space> cycles through the available options.\n"
152" <1> is interchangeable with <F1>, <2> with <F2>, etc.\n" 142"To search for menu entries press </>.\n"
153" Legend: [*] built-in [ ] excluded <M> module < > module capable.\n" 143"<Esc> always leaves the current window.\n"
154" <Esc> always leaves the current window.\n"), 144"\n"
145"You do not have function keys support.\n"
146"Press <1> instead of <F1>, <2> instead of <F2>, etc.\n"
147"For verbose global help use key <1>.\n"
148"For help related to the current menu entry press <?> or <h>.\n"),
155menu_instructions[] = N_( 149menu_instructions[] = N_(
156" Arrow keys navigate the menu.\n" 150"Legend: [*] built-in [ ] excluded <M> module < > module capable.\n"
157" <Enter> or <right-arrow> selects submenus --->.\n" 151"Submenus are designated by a trailing \"--->\".\n"
158" Capital Letters are hotkeys.\n" 152"\n"
159" Pressing <Y> includes, <N> excludes, <M> modularizes features.\n" 153"Use the following keys to navigate the menus:\n"
160" Pressing SpaceBar toggles between the above options\n" 154"Move up or down with <Up> or <Down>.\n"
161" Press <Esc>, <F5> or <left-arrow> to go back one menu,\n" 155"Enter a submenu with <Enter> or <Right>.\n"
162" <?>, <F1> or <h> for Help, </> for Search.\n" 156"Exit a submenu to its parent menu with <Esc> or <Left>.\n"
163" <1> is interchangeable with <F1>, <2> with <F2>, etc.\n" 157"Pressing <y> includes, <n> excludes, <m> modularizes features.\n"
164" Legend: [*] built-in [ ] excluded <M> module < > module capable.\n" 158"Pressing <Space> cycles through the available options.\n"
165" <Esc> always leaves the current window\n"), 159"To search for menu entries press </>.\n"
160"<Esc> always leaves the current window.\n"
161"\n"
162"Pressing <1> may be used instead of <F1>, <2> instead of <F2>, etc.\n"
163"For verbose global help press <F1>.\n"
164"For help related to the current menu entry press <?> or <h>.\n"),
166radiolist_instructions[] = N_( 165radiolist_instructions[] = N_(
167" Use the arrow keys to navigate this window or\n" 166"Press <Up>, <Down>, <Home> or <End> to navigate a radiolist, select\n"
168" press the hotkey of the item you wish to select\n" 167"with <Space>.\n"
169" followed by the <SPACE BAR>.\n" 168"For help related to the current entry press <?> or <h>.\n"
170" Press <?>, <F1> or <h> for additional information about this option.\n"), 169"For global help press <F1>.\n"),
171inputbox_instructions_int[] = N_( 170inputbox_instructions_int[] = N_(
172"Please enter a decimal value.\n" 171"Please enter a decimal value.\n"
173"Fractions will not be accepted.\n" 172"Fractions will not be accepted.\n"
174"Press <RETURN> to accept, <ESC> to cancel."), 173"Press <Enter> to apply, <Esc> to cancel."),
175inputbox_instructions_hex[] = N_( 174inputbox_instructions_hex[] = N_(
176"Please enter a hexadecimal value.\n" 175"Please enter a hexadecimal value.\n"
177"Press <RETURN> to accept, <ESC> to cancel."), 176"Press <Enter> to apply, <Esc> to cancel."),
178inputbox_instructions_string[] = N_( 177inputbox_instructions_string[] = N_(
179"Please enter a string value.\n" 178"Please enter a string value.\n"
180"Press <RETURN> to accept, <ESC> to cancel."), 179"Press <Enter> to apply, <Esc> to cancel."),
181setmod_text[] = N_( 180setmod_text[] = N_(
182"This feature depends on another which\n" 181"This feature depends on another feature which has been configured as a\n"
183"has been configured as a module.\n" 182"module. As a result, the current feature will be built as a module too."),
184"As a result, this feature will be built as a module."),
185load_config_text[] = N_( 183load_config_text[] = N_(
186"Enter the name of the configuration file you wish to load.\n" 184"Enter the name of the configuration file you wish to load.\n"
187"Accept the name shown to restore the configuration you\n" 185"Accept the name shown to restore the configuration you last\n"
188"last retrieved. Leave blank to abort."), 186"retrieved. Leave empty to abort."),
189load_config_help[] = N_( 187load_config_help[] = N_(
190"\n"
191"For various reasons, one may wish to keep several different\n" 188"For various reasons, one may wish to keep several different\n"
192"configurations available on a single machine.\n" 189"configurations available on a single machine.\n"
193"\n" 190"\n"
194"If you have saved a previous configuration in a file other than the\n" 191"If you have saved a previous configuration in a file other than the\n"
195"default one, entering its name here will allow you to modify that\n" 192"default one, entering its name here will allow you to load and modify\n"
196"configuration.\n" 193"that configuration.\n"
197"\n" 194"\n"
198"If you are uncertain, then you have probably never used alternate\n" 195"Leave empty to abort.\n"),
199"configuration files. You should therefor leave this blank to abort.\n"),
200save_config_text[] = N_( 196save_config_text[] = N_(
201"Enter a filename to which this configuration should be saved\n" 197"Enter a filename to which this configuration should be saved\n"
202"as an alternate. Leave blank to abort."), 198"as an alternate. Leave empty to abort."),
203save_config_help[] = N_( 199save_config_help[] = N_(
204"\n" 200"For various reasons, one may wish to keep several different\n"
205"For various reasons, one may wish to keep different configurations\n" 201"configurations available on a single machine.\n"
206"available on a single machine.\n"
207"\n" 202"\n"
208"Entering a file name here will allow you to later retrieve, modify\n" 203"Entering a file name here will allow you to later retrieve, modify\n"
209"and use the current configuration as an alternate to whatever\n" 204"and use the current configuration as an alternate to whatever\n"
210"configuration options you have selected at that time.\n" 205"configuration options you have selected at that time.\n"
211"\n" 206"\n"
212"If you are uncertain what all this means then you should probably\n" 207"Leave empty to abort.\n"),
213"leave this blank.\n"),
214search_help[] = N_( 208search_help[] = N_(
215"\n" 209"Search for symbols (configuration variable names CONFIG_*) and display\n"
216"Search for symbols and display their relations. Regular expressions\n" 210"their relations. Regular expressions are supported.\n"
217"are allowed.\n" 211"Example: Search for \"^FOO\".\n"
218"Example: search for \"^FOO\"\n"
219"Result:\n" 212"Result:\n"
220"-----------------------------------------------------------------\n" 213"-----------------------------------------------------------------\n"
221"Symbol: FOO [ = m]\n" 214"Symbol: FOO [ = m]\n"
@@ -229,26 +222,26 @@ search_help[] = N_(
229"Selects: LIBCRC32\n" 222"Selects: LIBCRC32\n"
230"Selected by: BAR\n" 223"Selected by: BAR\n"
231"-----------------------------------------------------------------\n" 224"-----------------------------------------------------------------\n"
232"o The line 'Prompt:' shows the text used in the menu structure for\n" 225"o The line 'Prompt:' shows the text displayed for this symbol in\n"
233" this symbol\n" 226" the menu hierarchy.\n"
234"o The 'Defined at' line tell at what file / line number the symbol\n" 227"o The 'Defined at' line tells at what file / line number the symbol is\n"
235" is defined\n" 228" defined.\n"
236"o The 'Depends on:' line tell what symbols needs to be defined for\n" 229"o The 'Depends on:' line lists symbols that need to be defined for\n"
237" this symbol to be visible in the menu (selectable)\n" 230" this symbol to be visible and selectable in the menu.\n"
238"o The 'Location:' lines tell where in the menu structure this symbol\n" 231"o The 'Location:' lines tell, where in the menu structure this symbol\n"
239" is located\n" 232" is located. A location followed by a [ = y] indicates that this is\n"
240" A location followed by a [ = y] indicate that this is a selectable\n" 233" a selectable menu item, and the current value is displayed inside\n"
241" menu item - and current value is displayed inside brackets.\n" 234" brackets.\n"
242"o The 'Selects:' line tell what symbol will be automatically\n" 235"o The 'Selects:' line tells, what symbol will be automatically selected\n"
243" selected if this symbol is selected (y or m)\n" 236" if this symbol is selected (y or m).\n"
244"o The 'Selected by' line tell what symbol has selected this symbol\n" 237"o The 'Selected by' line tells what symbol has selected this symbol.\n"
245"\n" 238"\n"
246"Only relevant lines are shown.\n" 239"Only relevant lines are shown.\n"
247"\n\n" 240"\n\n"
248"Search examples:\n" 241"Search examples:\n"
249"Examples: USB => find all symbols containing USB\n" 242"USB => find all symbols containing USB\n"
250" ^USB => find all symbols starting with USB\n" 243"^USB => find all symbols starting with USB\n"
251" USB$ => find all symbols ending with USB\n" 244"USB$ => find all symbols ending with USB\n"
252"\n"); 245"\n");
253 246
254struct mitem { 247struct mitem {
@@ -319,19 +312,19 @@ struct function_keys function_keys[] = {
319 }, 312 },
320 { 313 {
321 .key_str = "F2", 314 .key_str = "F2",
322 .func = "Sym Info", 315 .func = "SymInfo",
323 .key = F_SYMBOL, 316 .key = F_SYMBOL,
324 .handler = handle_f2, 317 .handler = handle_f2,
325 }, 318 },
326 { 319 {
327 .key_str = "F3", 320 .key_str = "F3",
328 .func = "Insts", 321 .func = "Help 2",
329 .key = F_INSTS, 322 .key = F_INSTS,
330 .handler = handle_f3, 323 .handler = handle_f3,
331 }, 324 },
332 { 325 {
333 .key_str = "F4", 326 .key_str = "F4",
334 .func = "Config", 327 .func = "ShowAll",
335 .key = F_CONF, 328 .key = F_CONF,
336 .handler = handle_f4, 329 .handler = handle_f4,
337 }, 330 },
@@ -355,7 +348,7 @@ struct function_keys function_keys[] = {
355 }, 348 },
356 { 349 {
357 .key_str = "F8", 350 .key_str = "F8",
358 .func = "Sym Search", 351 .func = "SymSearch",
359 .key = F_SEARCH, 352 .key = F_SEARCH,
360 .handler = handle_f8, 353 .handler = handle_f8,
361 }, 354 },
@@ -392,7 +385,7 @@ static void print_function_line(void)
392static void handle_f1(int *key, struct menu *current_item) 385static void handle_f1(int *key, struct menu *current_item)
393{ 386{
394 show_scroll_win(main_window, 387 show_scroll_win(main_window,
395 _("README"), _(nconf_readme)); 388 _("Global help"), _(nconf_global_help));
396 return; 389 return;
397} 390}
398 391
@@ -407,7 +400,7 @@ static void handle_f2(int *key, struct menu *current_item)
407static void handle_f3(int *key, struct menu *current_item) 400static void handle_f3(int *key, struct menu *current_item)
408{ 401{
409 show_scroll_win(main_window, 402 show_scroll_win(main_window,
410 _("Instructions"), 403 _("Short help"),
411 _(current_instructions)); 404 _(current_instructions));
412 return; 405 return;
413} 406}
@@ -696,13 +689,18 @@ static void search_conf(void)
696{ 689{
697 struct symbol **sym_arr; 690 struct symbol **sym_arr;
698 struct gstr res; 691 struct gstr res;
692 struct gstr title;
699 char *dialog_input; 693 char *dialog_input;
700 int dres; 694 int dres;
695
696 title = str_new();
697 str_printf( &title, _("Enter %s (sub)string to search for "
698 "(with or without \"%s\")"), CONFIG_, CONFIG_);
699
701again: 700again:
702 dres = dialog_inputbox(main_window, 701 dres = dialog_inputbox(main_window,
703 _("Search Configuration Parameter"), 702 _("Search Configuration Parameter"),
704 _("Enter " CONFIG_ " (sub)string to search for " 703 str_get(&title),
705 "(with or without \"" CONFIG_ "\")"),
706 "", &dialog_input_result, &dialog_input_result_len); 704 "", &dialog_input_result, &dialog_input_result_len);
707 switch (dres) { 705 switch (dres) {
708 case 0: 706 case 0:
@@ -712,6 +710,7 @@ again:
712 _("Search Configuration"), search_help); 710 _("Search Configuration"), search_help);
713 goto again; 711 goto again;
714 default: 712 default:
713 str_free(&title);
715 return; 714 return;
716 } 715 }
717 716
@@ -726,6 +725,7 @@ again:
726 show_scroll_win(main_window, 725 show_scroll_win(main_window,
727 _("Search Results"), str_get(&res)); 726 _("Search Results"), str_get(&res));
728 str_free(&res); 727 str_free(&res);
728 str_free(&title);
729} 729}
730 730
731 731
diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c
index 379003c7a2b4..9f8c44ecc703 100644
--- a/scripts/kconfig/nconf.gui.c
+++ b/scripts/kconfig/nconf.gui.c
@@ -48,7 +48,7 @@ static void set_normal_colors(void)
48 init_pair(INPUT_FIELD, -1, -1); 48 init_pair(INPUT_FIELD, -1, -1);
49 49
50 init_pair(FUNCTION_HIGHLIGHT, -1, -1); 50 init_pair(FUNCTION_HIGHLIGHT, -1, -1);
51 init_pair(FUNCTION_TEXT, COLOR_BLUE, -1); 51 init_pair(FUNCTION_TEXT, COLOR_YELLOW, -1);
52} 52}
53 53
54/* available attributes: 54/* available attributes:
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index df274febb3e5..1500c38f0cca 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -6,6 +6,7 @@
6#include <qglobal.h> 6#include <qglobal.h>
7 7
8#if QT_VERSION < 0x040000 8#if QT_VERSION < 0x040000
9#include <stddef.h>
9#include <qmainwindow.h> 10#include <qmainwindow.h>
10#include <qvbox.h> 11#include <qvbox.h>
11#include <qvaluelist.h> 12#include <qvaluelist.h>
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 22a3c400fc41..ecc5aa5f865d 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -656,11 +656,11 @@ bool sym_set_string_value(struct symbol *sym, const char *newval)
656 size = strlen(newval) + 1; 656 size = strlen(newval) + 1;
657 if (sym->type == S_HEX && (newval[0] != '0' || (newval[1] != 'x' && newval[1] != 'X'))) { 657 if (sym->type == S_HEX && (newval[0] != '0' || (newval[1] != 'x' && newval[1] != 'X'))) {
658 size += 2; 658 size += 2;
659 sym->def[S_DEF_USER].val = val = malloc(size); 659 sym->def[S_DEF_USER].val = val = xmalloc(size);
660 *val++ = '0'; 660 *val++ = '0';
661 *val++ = 'x'; 661 *val++ = 'x';
662 } else if (!oldval || strcmp(oldval, newval)) 662 } else if (!oldval || strcmp(oldval, newval))
663 sym->def[S_DEF_USER].val = val = malloc(size); 663 sym->def[S_DEF_USER].val = val = xmalloc(size);
664 else 664 else
665 return true; 665 return true;
666 666
@@ -812,7 +812,7 @@ struct symbol *sym_lookup(const char *name, int flags)
812 hash = 0; 812 hash = 0;
813 } 813 }
814 814
815 symbol = malloc(sizeof(*symbol)); 815 symbol = xmalloc(sizeof(*symbol));
816 memset(symbol, 0, sizeof(*symbol)); 816 memset(symbol, 0, sizeof(*symbol));
817 symbol->name = new_name; 817 symbol->name = new_name;
818 symbol->type = S_UNKNOWN; 818 symbol->type = S_UNKNOWN;
@@ -863,7 +863,7 @@ const char *sym_expand_string_value(const char *in)
863 size_t reslen; 863 size_t reslen;
864 864
865 reslen = strlen(in) + 1; 865 reslen = strlen(in) + 1;
866 res = malloc(reslen); 866 res = xmalloc(reslen);
867 res[0] = '\0'; 867 res[0] = '\0';
868 868
869 while ((src = strchr(in, '$'))) { 869 while ((src = strchr(in, '$'))) {
@@ -921,7 +921,7 @@ const char *sym_escape_string_value(const char *in)
921 p++; 921 p++;
922 } 922 }
923 923
924 res = malloc(reslen); 924 res = xmalloc(reslen);
925 res[0] = '\0'; 925 res[0] = '\0';
926 926
927 strcat(res, "\""); 927 strcat(res, "\"");
@@ -1228,7 +1228,7 @@ struct property *prop_alloc(enum prop_type type, struct symbol *sym)
1228 struct property *prop; 1228 struct property *prop;
1229 struct property **propp; 1229 struct property **propp;
1230 1230
1231 prop = malloc(sizeof(*prop)); 1231 prop = xmalloc(sizeof(*prop));
1232 memset(prop, 0, sizeof(*prop)); 1232 memset(prop, 0, sizeof(*prop));
1233 prop->type = type; 1233 prop->type = type;
1234 prop->sym = sym; 1234 prop->sym = sym;
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index d0b8b2318e48..6e7fbf196809 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -23,7 +23,7 @@ struct file *file_lookup(const char *name)
23 } 23 }
24 } 24 }
25 25
26 file = malloc(sizeof(*file)); 26 file = xmalloc(sizeof(*file));
27 memset(file, 0, sizeof(*file)); 27 memset(file, 0, sizeof(*file));
28 file->name = file_name; 28 file->name = file_name;
29 file->next = file_list; 29 file->next = file_list;
@@ -81,7 +81,7 @@ int file_write_dep(const char *name)
81struct gstr str_new(void) 81struct gstr str_new(void)
82{ 82{
83 struct gstr gs; 83 struct gstr gs;
84 gs.s = malloc(sizeof(char) * 64); 84 gs.s = xmalloc(sizeof(char) * 64);
85 gs.len = 64; 85 gs.len = 64;
86 gs.max_width = 0; 86 gs.max_width = 0;
87 strcpy(gs.s, "\0"); 87 strcpy(gs.s, "\0");
@@ -138,3 +138,22 @@ const char *str_get(struct gstr *gs)
138 return gs->s; 138 return gs->s;
139} 139}
140 140
141void *xmalloc(size_t size)
142{
143 void *p = malloc(size);
144 if (p)
145 return p;
146 fprintf(stderr, "Out of memory.\n");
147 exit(1);
148}
149
150void *xcalloc(size_t nmemb, size_t size)
151{
152 void *p = calloc(nmemb, size);
153 if (p)
154 return p;
155 fprintf(stderr, "Out of memory.\n");
156 exit(1);
157}
158
159
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index 00f9d3a9cf8b..6555a475453b 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -40,7 +40,7 @@ static void zconf_endfile(void);
40 40
41static void new_string(void) 41static void new_string(void)
42{ 42{
43 text = malloc(START_STRSIZE); 43 text = xmalloc(START_STRSIZE);
44 text_asize = START_STRSIZE; 44 text_asize = START_STRSIZE;
45 text_size = 0; 45 text_size = 0;
46 *text = 0; 46 *text = 0;
@@ -62,7 +62,7 @@ static void append_string(const char *str, int size)
62 62
63static void alloc_string(const char *str, int size) 63static void alloc_string(const char *str, int size)
64{ 64{
65 text = malloc(size + 1); 65 text = xmalloc(size + 1);
66 memcpy(text, str, size); 66 memcpy(text, str, size);
67 text[size] = 0; 67 text[size] = 0;
68} 68}
@@ -288,7 +288,7 @@ void zconf_initscan(const char *name)
288 exit(1); 288 exit(1);
289 } 289 }
290 290
291 current_buf = malloc(sizeof(*current_buf)); 291 current_buf = xmalloc(sizeof(*current_buf));
292 memset(current_buf, 0, sizeof(*current_buf)); 292 memset(current_buf, 0, sizeof(*current_buf));
293 293
294 current_file = file_lookup(name); 294 current_file = file_lookup(name);
@@ -299,7 +299,7 @@ void zconf_nextfile(const char *name)
299{ 299{
300 struct file *iter; 300 struct file *iter;
301 struct file *file = file_lookup(name); 301 struct file *file = file_lookup(name);
302 struct buffer *buf = malloc(sizeof(*buf)); 302 struct buffer *buf = xmalloc(sizeof(*buf));
303 memset(buf, 0, sizeof(*buf)); 303 memset(buf, 0, sizeof(*buf));
304 304
305 current_buf->state = YY_CURRENT_BUFFER; 305 current_buf->state = YY_CURRENT_BUFFER;
diff --git a/scripts/kconfig/zconf.lex.c_shipped b/scripts/kconfig/zconf.lex.c_shipped
index c32b1a49f5a3..a0521aa5974b 100644
--- a/scripts/kconfig/zconf.lex.c_shipped
+++ b/scripts/kconfig/zconf.lex.c_shipped
@@ -802,7 +802,7 @@ static void zconf_endfile(void);
802 802
803static void new_string(void) 803static void new_string(void)
804{ 804{
805 text = malloc(START_STRSIZE); 805 text = xmalloc(START_STRSIZE);
806 text_asize = START_STRSIZE; 806 text_asize = START_STRSIZE;
807 text_size = 0; 807 text_size = 0;
808 *text = 0; 808 *text = 0;
@@ -824,7 +824,7 @@ static void append_string(const char *str, int size)
824 824
825static void alloc_string(const char *str, int size) 825static void alloc_string(const char *str, int size)
826{ 826{
827 text = malloc(size + 1); 827 text = xmalloc(size + 1);
828 memcpy(text, str, size); 828 memcpy(text, str, size);
829 text[size] = 0; 829 text[size] = 0;
830} 830}
@@ -2343,7 +2343,7 @@ void zconf_initscan(const char *name)
2343 exit(1); 2343 exit(1);
2344 } 2344 }
2345 2345
2346 current_buf = malloc(sizeof(*current_buf)); 2346 current_buf = xmalloc(sizeof(*current_buf));
2347 memset(current_buf, 0, sizeof(*current_buf)); 2347 memset(current_buf, 0, sizeof(*current_buf));
2348 2348
2349 current_file = file_lookup(name); 2349 current_file = file_lookup(name);
@@ -2354,7 +2354,7 @@ void zconf_nextfile(const char *name)
2354{ 2354{
2355 struct file *iter; 2355 struct file *iter;
2356 struct file *file = file_lookup(name); 2356 struct file *file = file_lookup(name);
2357 struct buffer *buf = malloc(sizeof(*buf)); 2357 struct buffer *buf = xmalloc(sizeof(*buf));
2358 memset(buf, 0, sizeof(*buf)); 2358 memset(buf, 0, sizeof(*buf));
2359 2359
2360 current_buf->state = YY_CURRENT_BUFFER; 2360 current_buf->state = YY_CURRENT_BUFFER;
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 28b761567815..4305b2f2ec5e 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1750,7 +1750,7 @@ sub dump_struct($$) {
1750 # strip kmemcheck_bitfield_{begin,end}.*; 1750 # strip kmemcheck_bitfield_{begin,end}.*;
1751 $members =~ s/kmemcheck_bitfield_.*?;//gos; 1751 $members =~ s/kmemcheck_bitfield_.*?;//gos;
1752 # strip attributes 1752 # strip attributes
1753 $members =~ s/__aligned\s*\(\d+\)//gos; 1753 $members =~ s/__aligned\s*\(.+\)//gos;
1754 1754
1755 create_parameterlist($members, ';', $file); 1755 create_parameterlist($members, ';', $file);
1756 check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested); 1756 check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested);
@@ -2079,7 +2079,6 @@ sub dump_function($$) {
2079 $prototype =~ s/^__inline +//; 2079 $prototype =~ s/^__inline +//;
2080 $prototype =~ s/^__always_inline +//; 2080 $prototype =~ s/^__always_inline +//;
2081 $prototype =~ s/^noinline +//; 2081 $prototype =~ s/^noinline +//;
2082 $prototype =~ s/__devinit +//;
2083 $prototype =~ s/__init +//; 2082 $prototype =~ s/__init +//;
2084 $prototype =~ s/__init_or_module +//; 2083 $prototype =~ s/__init_or_module +//;
2085 $prototype =~ s/__must_check +//; 2084 $prototype =~ s/__must_check +//;
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 11a8c3010ed9..78b30c1548e9 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -830,6 +830,8 @@ static const char *section_white_list[] =
830 ".toc*", 830 ".toc*",
831 ".xt.prop", /* xtensa */ 831 ".xt.prop", /* xtensa */
832 ".xt.lit", /* xtensa */ 832 ".xt.lit", /* xtensa */
833 ".arcextmap*", /* arc */
834 ".gnu.linkonce.arcext*", /* arc : modules */
833 NULL 835 NULL
834}; 836};
835 837
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index 4bf17ddf7c7f..fbbfd08853d3 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -95,7 +95,7 @@ echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/vmlinuz-$KERNELRELEASE"
95echo "%endif" 95echo "%endif"
96echo "%endif" 96echo "%endif"
97 97
98echo 'make %{?_smp_mflags} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr headers_install' 98echo 'make %{?_smp_mflags} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr KBUILD_SRC= headers_install'
99echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE" 99echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE"
100 100
101echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$KERNELRELEASE" 101echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$KERNELRELEASE"
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index ee52cb8e17ad..9c22317778eb 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -33,6 +33,13 @@
33#include <string.h> 33#include <string.h>
34#include <unistd.h> 34#include <unistd.h>
35 35
36#ifndef EM_METAG
37/* Remove this when these make it to the standard system elf.h. */
38#define EM_METAG 174
39#define R_METAG_ADDR32 2
40#define R_METAG_NONE 3
41#endif
42
36static int fd_map; /* File descriptor for file being modified. */ 43static int fd_map; /* File descriptor for file being modified. */
37static int mmap_failed; /* Boolean flag. */ 44static int mmap_failed; /* Boolean flag. */
38static void *ehdr_curr; /* current ElfXX_Ehdr * for resource cleanup */ 45static void *ehdr_curr; /* current ElfXX_Ehdr * for resource cleanup */
@@ -341,6 +348,12 @@ do_file(char const *const fname)
341 altmcount = "__gnu_mcount_nc"; 348 altmcount = "__gnu_mcount_nc";
342 break; 349 break;
343 case EM_IA_64: reltype = R_IA64_IMM64; gpfx = '_'; break; 350 case EM_IA_64: reltype = R_IA64_IMM64; gpfx = '_'; break;
351 case EM_METAG: reltype = R_METAG_ADDR32;
352 altmcount = "_mcount_wrapper";
353 rel_type_nop = R_METAG_NONE;
354 /* We happen to have the same requirement as MIPS */
355 is_fake_mcount32 = MIPS32_is_fake_mcount;
356 break;
344 case EM_MIPS: /* reltype: e_class */ gpfx = '_'; break; 357 case EM_MIPS: /* reltype: e_class */ gpfx = '_'; break;
345 case EM_PPC: reltype = R_PPC_ADDR32; gpfx = '_'; break; 358 case EM_PPC: reltype = R_PPC_ADDR32; gpfx = '_'; break;
346 case EM_PPC64: reltype = R_PPC64_ADDR64; gpfx = '_'; break; 359 case EM_PPC64: reltype = R_PPC64_ADDR64; gpfx = '_'; break;
diff --git a/scripts/sign-file b/scripts/sign-file
index 974a20b661b7..2b7c4484d46c 100755
--- a/scripts/sign-file
+++ b/scripts/sign-file
@@ -2,51 +2,45 @@
2# 2#
3# Sign a module file using the given key. 3# Sign a module file using the given key.
4# 4#
5# Format: 5
6# 6my $USAGE =
7# ./scripts/sign-file [-v] <key> <x509> <module> [<dest>] 7"Usage: scripts/sign-file [-v] <hash algo> <key> <x509> <module> [<dest>]\n" .
8# 8" scripts/sign-file [-v] -s <raw sig> <hash algo> <x509> <module> [<dest>]\n";
9# 9
10use strict; 10use strict;
11use FileHandle; 11use FileHandle;
12use IPC::Open2; 12use IPC::Open2;
13use Getopt::Std;
13 14
14my $verbose = 0; 15my %opts;
15if ($#ARGV >= 0 && $ARGV[0] eq "-v") { 16getopts('vs:', \%opts) or die $USAGE;
16 $verbose = 1; 17my $verbose = $opts{'v'};
17 shift; 18my $signature_file = $opts{'s'};
18}
19 19
20die "Format: ./scripts/sign-file [-v] <key> <x509> <module> [<dest>]\n" 20die $USAGE if ($#ARGV > 4);
21 if ($#ARGV != 2 && $#ARGV != 3); 21die $USAGE if (!$signature_file && $#ARGV < 3 || $signature_file && $#ARGV < 2);
22 22
23my $private_key = $ARGV[0]; 23my $dgst = shift @ARGV;
24my $x509 = $ARGV[1]; 24my $private_key;
25my $module = $ARGV[2]; 25if (!$signature_file) {
26my $dest = ($#ARGV == 3) ? $ARGV[3] : $ARGV[2] . "~"; 26 $private_key = shift @ARGV;
27}
28my $x509 = shift @ARGV;
29my $module = shift @ARGV;
30my ($dest, $keep_orig);
31if (@ARGV) {
32 $dest = $ARGV[0];
33 $keep_orig = 1;
34} else {
35 $dest = $module . "~";
36}
27 37
28die "Can't read private key\n" unless (-r $private_key); 38die "Can't read private key\n" if (!$signature_file && !-r $private_key);
39die "Can't read signature file\n" if ($signature_file && !-r $signature_file);
29die "Can't read X.509 certificate\n" unless (-r $x509); 40die "Can't read X.509 certificate\n" unless (-r $x509);
30die "Can't read module\n" unless (-r $module); 41die "Can't read module\n" unless (-r $module);
31 42
32# 43#
33# Read the kernel configuration
34#
35my %config = (
36 CONFIG_MODULE_SIG_SHA512 => 1
37 );
38
39if (-r ".config") {
40 open(FD, "<.config") || die ".config";
41 while (<FD>) {
42 if ($_ =~ /^(CONFIG_.*)=[ym]/) {
43 $config{$1} = 1;
44 }
45 }
46 close(FD);
47}
48
49#
50# Function to read the contents of a file into a variable. 44# Function to read the contents of a file into a variable.
51# 45#
52sub read_file($) 46sub read_file($)
@@ -321,73 +315,71 @@ my $id_type = 1; # Identifier type: X.509
321# 315#
322# Digest the data 316# Digest the data
323# 317#
324my ($dgst, $prologue) = (); 318my $prologue;
325if (exists $config{"CONFIG_MODULE_SIG_SHA1"}) { 319if ($dgst eq "sha1") {
326 $prologue = pack("C*", 320 $prologue = pack("C*",
327 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 321 0x30, 0x21, 0x30, 0x09, 0x06, 0x05,
328 0x2B, 0x0E, 0x03, 0x02, 0x1A, 322 0x2B, 0x0E, 0x03, 0x02, 0x1A,
329 0x05, 0x00, 0x04, 0x14); 323 0x05, 0x00, 0x04, 0x14);
330 $dgst = "-sha1";
331 $hash = 2; 324 $hash = 2;
332} elsif (exists $config{"CONFIG_MODULE_SIG_SHA224"}) { 325} elsif ($dgst eq "sha224") {
333 $prologue = pack("C*", 326 $prologue = pack("C*",
334 0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, 327 0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09,
335 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, 328 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04,
336 0x05, 0x00, 0x04, 0x1C); 329 0x05, 0x00, 0x04, 0x1C);
337 $dgst = "-sha224";
338 $hash = 7; 330 $hash = 7;
339} elsif (exists $config{"CONFIG_MODULE_SIG_SHA256"}) { 331} elsif ($dgst eq "sha256") {
340 $prologue = pack("C*", 332 $prologue = pack("C*",
341 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 333 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09,
342 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 334 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01,
343 0x05, 0x00, 0x04, 0x20); 335 0x05, 0x00, 0x04, 0x20);
344 $dgst = "-sha256";
345 $hash = 4; 336 $hash = 4;
346} elsif (exists $config{"CONFIG_MODULE_SIG_SHA384"}) { 337} elsif ($dgst eq "sha384") {
347 $prologue = pack("C*", 338 $prologue = pack("C*",
348 0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 339 0x30, 0x41, 0x30, 0x0d, 0x06, 0x09,
349 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 340 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02,
350 0x05, 0x00, 0x04, 0x30); 341 0x05, 0x00, 0x04, 0x30);
351 $dgst = "-sha384";
352 $hash = 5; 342 $hash = 5;
353} elsif (exists $config{"CONFIG_MODULE_SIG_SHA512"}) { 343} elsif ($dgst eq "sha512") {
354 $prologue = pack("C*", 344 $prologue = pack("C*",
355 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 345 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09,
356 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 346 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03,
357 0x05, 0x00, 0x04, 0x40); 347 0x05, 0x00, 0x04, 0x40);
358 $dgst = "-sha512";
359 $hash = 6; 348 $hash = 6;
360} else { 349} else {
361 die "Can't determine hash algorithm"; 350 die "Unknown hash algorithm: $dgst\n";
362} 351}
363 352
364#
365# Generate the digest and read from openssl's stdout
366#
367my $digest;
368$digest = readpipe("openssl dgst $dgst -binary $module") || die "openssl dgst";
369
370#
371# Generate the binary signature, which will be just the integer that comprises
372# the signature with no metadata attached.
373#
374my $pid;
375$pid = open2(*read_from, *write_to,
376 "openssl rsautl -sign -inkey $private_key -keyform PEM") ||
377 die "openssl rsautl";
378binmode write_to;
379print write_to $prologue . $digest || die "pipe to openssl rsautl";
380close(write_to) || die "pipe to openssl rsautl";
381
382binmode read_from;
383my $signature; 353my $signature;
384read(read_from, $signature, 4096) || die "pipe from openssl rsautl"; 354if ($signature_file) {
385close(read_from) || die "pipe from openssl rsautl"; 355 $signature = read_file($signature_file);
356} else {
357 #
358 # Generate the digest and read from openssl's stdout
359 #
360 my $digest;
361 $digest = readpipe("openssl dgst -$dgst -binary $module") || die "openssl dgst";
362
363 #
364 # Generate the binary signature, which will be just the integer that
365 # comprises the signature with no metadata attached.
366 #
367 my $pid;
368 $pid = open2(*read_from, *write_to,
369 "openssl rsautl -sign -inkey $private_key -keyform PEM") ||
370 die "openssl rsautl";
371 binmode write_to;
372 print write_to $prologue . $digest || die "pipe to openssl rsautl";
373 close(write_to) || die "pipe to openssl rsautl";
374
375 binmode read_from;
376 read(read_from, $signature, 4096) || die "pipe from openssl rsautl";
377 close(read_from) || die "pipe from openssl rsautl";
378 waitpid($pid, 0) || die;
379 die "openssl rsautl died: $?" if ($? >> 8);
380}
386$signature = pack("n", length($signature)) . $signature, 381$signature = pack("n", length($signature)) . $signature,
387 382
388waitpid($pid, 0) || die;
389die "openssl rsautl died: $?" if ($? >> 8);
390
391# 383#
392# Build the signed binary 384# Build the signed binary
393# 385#
@@ -424,6 +416,6 @@ print FD
424 ; 416 ;
425close FD || die $dest; 417close FD || die $dest;
426 418
427if ($#ARGV != 3) { 419if (!$keep_orig) {
428 rename($dest, $module) || die $module; 420 rename($dest, $module) || die $module;
429} 421}
diff --git a/scripts/sortextable.h b/scripts/sortextable.h
index e4fd45b7e456..f5eb43d42926 100644
--- a/scripts/sortextable.h
+++ b/scripts/sortextable.h
@@ -182,7 +182,7 @@ do_func(Elf_Ehdr *ehdr, char const *const fname, table_sort_t custom_sort)
182 _r(&sort_needed_sym->st_value) - 182 _r(&sort_needed_sym->st_value) -
183 _r(&sort_needed_sec->sh_addr); 183 _r(&sort_needed_sec->sh_addr);
184 184
185#if 1 185#if 0
186 printf("sort done marker at %lx\n", 186 printf("sort done marker at %lx\n",
187 (unsigned long)((char *)sort_done_location - (char *)ehdr)); 187 (unsigned long)((char *)sort_done_location - (char *)ehdr));
188#endif 188#endif
diff --git a/scripts/tags.sh b/scripts/tags.sh
index 08f06c00745e..26a87e68afed 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -149,12 +149,17 @@ dogtags()
149exuberant() 149exuberant()
150{ 150{
151 all_target_sources | xargs $1 -a \ 151 all_target_sources | xargs $1 -a \
152 -I __initdata,__exitdata,__acquires,__releases \ 152 -I __initdata,__exitdata,__initconst,__devinitdata \
153 -I __read_mostly,____cacheline_aligned \ 153 -I __devinitconst,__cpuinitdata,__initdata_memblock \
154 -I __refdata,__attribute \
155 -I __acquires,__releases,__deprecated \
156 -I __read_mostly,__aligned,____cacheline_aligned \
154 -I ____cacheline_aligned_in_smp \ 157 -I ____cacheline_aligned_in_smp \
155 -I ____cacheline_internodealigned_in_smp \ 158 -I ____cacheline_internodealigned_in_smp \
159 -I __used,__packed,__packed2__,__must_check,__must_hold \
156 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \ 160 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
157 -I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \ 161 -I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \
162 -I static,const \
158 --extra=+f --c-kinds=+px \ 163 --extra=+f --c-kinds=+px \
159 --regex-asm='/^(ENTRY|_GLOBAL)\(([^)]*)\).*/\2/' \ 164 --regex-asm='/^(ENTRY|_GLOBAL)\(([^)]*)\).*/\2/' \
160 --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \ 165 --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \
@@ -182,8 +187,19 @@ exuberant()
182 --regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \ 187 --regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \
183 --regex-c++='/__TESTCLEARFLAG_FALSE\(([^,)]*).*/__TestClearPage\1/' \ 188 --regex-c++='/__TESTCLEARFLAG_FALSE\(([^,)]*).*/__TestClearPage\1/' \
184 --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' \ 189 --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' \
185 --regex-c='/PCI_OP_READ\(([a-z]*[a-z]).*[1-4]\)/pci_bus_read_config_\1/' \ 190 --regex-c='/PCI_OP_READ\((\w*).*[1-4]\)/pci_bus_read_config_\1/' \
186 --regex-c='/PCI_OP_WRITE\(([a-z]*[a-z]).*[1-4]\)/pci_bus_write_config_\1/' 191 --regex-c='/PCI_OP_WRITE\((\w*).*[1-4]\)/pci_bus_write_config_\1/' \
192 --regex-c='/DEFINE_(MUTEX|SEMAPHORE|SPINLOCK)\((\w*)/\2/v/' \
193 --regex-c='/DEFINE_(RAW_SPINLOCK|RWLOCK|SEQLOCK)\((\w*)/\2/v/' \
194 --regex-c='/DECLARE_(RWSEM|COMPLETION)\((\w*)/\2/v/' \
195 --regex-c='/DECLARE_BITMAP\((\w*)/\1/v/' \
196 --regex-c='/(^|\s)(|L|H)LIST_HEAD\((\w*)/\3/v/' \
197 --regex-c='/(^|\s)RADIX_TREE\((\w*)/\2/v/' \
198 --regex-c='/DEFINE_PER_CPU\(([^,]*,\s*)(\w*).*\)/\2/v/' \
199 --regex-c='/DEFINE_PER_CPU_SHARED_ALIGNED\(([^,]*,\s*)(\w*).*\)/\2/v/' \
200 --regex-c='/DECLARE_WAIT_QUEUE_HEAD\((\w*)/\1/v/' \
201 --regex-c='/DECLARE_(TASKLET|WORK|DELAYED_WORK)\((\w*)/\2/v/' \
202 --regex-c='/DEFINE_PCI_DEVICE_TABLE\((\w*)/\1/v/'
187 203
188 all_kconfigs | xargs $1 -a \ 204 all_kconfigs | xargs $1 -a \
189 --langdef=kconfig --language-force=kconfig \ 205 --langdef=kconfig --language-force=kconfig \
@@ -201,34 +217,34 @@ exuberant()
201emacs() 217emacs()
202{ 218{
203 all_target_sources | xargs $1 -a \ 219 all_target_sources | xargs $1 -a \
204 --regex='/^(ENTRY|_GLOBAL)(\([^)]*\)).*/\2/' \ 220 --regex='/^\(ENTRY\|_GLOBAL\)(\([^)]*\)).*/\2/' \
205 --regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/' \ 221 --regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/' \
206 --regex='/^TRACE_EVENT(\([^,)]*\).*/trace_\1/' \ 222 --regex='/^TRACE_EVENT(\([^,)]*\).*/trace_\1/' \
207 --regex='/^DEFINE_EVENT([^,)]*, *\([^,)]*\).*/trace_\1/' \ 223 --regex='/^DEFINE_EVENT([^,)]*, *\([^,)]*\).*/trace_\1/' \
208 --regex='/PAGEFLAG\(([^,)]*).*/Page\1/' \ 224 --regex='/PAGEFLAG(\([^,)]*\).*/Page\1/' \
209 --regex='/PAGEFLAG\(([^,)]*).*/SetPage\1/' \ 225 --regex='/PAGEFLAG(\([^,)]*\).*/SetPage\1/' \
210 --regex='/PAGEFLAG\(([^,)]*).*/ClearPage\1/' \ 226 --regex='/PAGEFLAG(\([^,)]*\).*/ClearPage\1/' \
211 --regex='/TESTSETFLAG\(([^,)]*).*/TestSetPage\1/' \ 227 --regex='/TESTSETFLAG(\([^,)]*\).*/TestSetPage\1/' \
212 --regex='/TESTPAGEFLAG\(([^,)]*).*/Page\1/' \ 228 --regex='/TESTPAGEFLAG(\([^,)]*\).*/Page\1/' \
213 --regex='/SETPAGEFLAG\(([^,)]*).*/SetPage\1/' \ 229 --regex='/SETPAGEFLAG(\([^,)]*\).*/SetPage\1/' \
214 --regex='/__SETPAGEFLAG\(([^,)]*).*/__SetPage\1/' \ 230 --regex='/__SETPAGEFLAG(\([^,)]*\).*/__SetPage\1/' \
215 --regex='/TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/' \ 231 --regex='/TESTCLEARFLAG(\([^,)]*\).*/TestClearPage\1/' \
216 --regex='/__TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/' \ 232 --regex='/__TESTCLEARFLAG(\([^,)]*\).*/TestClearPage\1/' \
217 --regex='/CLEARPAGEFLAG\(([^,)]*).*/ClearPage\1/' \ 233 --regex='/CLEARPAGEFLAG(\([^,)]*\).*/ClearPage\1/' \
218 --regex='/__CLEARPAGEFLAG\(([^,)]*).*/__ClearPage\1/' \ 234 --regex='/__CLEARPAGEFLAG(\([^,)]*\).*/__ClearPage\1/' \
219 --regex='/__PAGEFLAG\(([^,)]*).*/__SetPage\1/' \ 235 --regex='/__PAGEFLAG(\([^,)]*\).*/__SetPage\1/' \
220 --regex='/__PAGEFLAG\(([^,)]*).*/__ClearPage\1/' \ 236 --regex='/__PAGEFLAG(\([^,)]*\).*/__ClearPage\1/' \
221 --regex='/PAGEFLAG_FALSE\(([^,)]*).*/Page\1/' \ 237 --regex='/PAGEFLAG_FALSE(\([^,)]*\).*/Page\1/' \
222 --regex='/TESTSCFLAG\(([^,)]*).*/TestSetPage\1/' \ 238 --regex='/TESTSCFLAG(\([^,)]*\).*/TestSetPage\1/' \
223 --regex='/TESTSCFLAG\(([^,)]*).*/TestClearPage\1/' \ 239 --regex='/TESTSCFLAG(\([^,)]*\).*/TestClearPage\1/' \
224 --regex='/SETPAGEFLAG_NOOP\(([^,)]*).*/SetPage\1/' \ 240 --regex='/SETPAGEFLAG_NOOP(\([^,)]*\).*/SetPage\1/' \
225 --regex='/CLEARPAGEFLAG_NOOP\(([^,)]*).*/ClearPage\1/' \ 241 --regex='/CLEARPAGEFLAG_NOOP(\([^,)]*\).*/ClearPage\1/' \
226 --regex='/__CLEARPAGEFLAG_NOOP\(([^,)]*).*/__ClearPage\1/' \ 242 --regex='/__CLEARPAGEFLAG_NOOP(\([^,)]*\).*/__ClearPage\1/' \
227 --regex='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \ 243 --regex='/TESTCLEARFLAG_FALSE(\([^,)]*\).*/TestClearPage\1/' \
228 --regex='/__TESTCLEARFLAG_FALSE\(([^,)]*).*/__TestClearPage\1/' \ 244 --regex='/__TESTCLEARFLAG_FALSE(\([^,)]*\).*/__TestClearPage\1/' \
229 --regex='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' \ 245 --regex='/_PE(\([^,)]*\).*/PEVENT_ERRNO__\1/' \
230 --regex='/PCI_OP_READ\(([a-z]*[a-z]).*[1-4]\)/pci_bus_read_config_\1/' \ 246 --regex='/PCI_OP_READ(\([a-z]*[a-z]\).*[1-4])/pci_bus_read_config_\1/' \
231 --regex='/PCI_OP_WRITE\(([a-z]*[a-z]).*[1-4]\)/pci_bus_write_config_\1/' 247 --regex='/PCI_OP_WRITE(\([a-z]*[a-z]\).*[1-4])/pci_bus_write_config_\1/'
232 248
233 all_kconfigs | xargs $1 -a \ 249 all_kconfigs | xargs $1 -a \
234 --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/' 250 --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'