diff options
-rw-r--r-- | Documentation/coccinelle.txt | 4 | ||||
-rw-r--r-- | Documentation/kbuild/kconfig-language.txt | 6 | ||||
-rw-r--r-- | scripts/.gitignore | 1 | ||||
-rw-r--r-- | scripts/coccinelle/misc/doubleinit.cocci | 6 | ||||
-rw-r--r-- | scripts/coccinelle/null/deref_null.cocci | 39 | ||||
-rwxr-xr-x | scripts/config | 13 | ||||
-rw-r--r-- | scripts/headers_check.pl | 6 | ||||
-rwxr-xr-x | scripts/tags.sh | 2 |
8 files changed, 41 insertions, 36 deletions
diff --git a/Documentation/coccinelle.txt b/Documentation/coccinelle.txt index 4a276ea7001c..96b690348ba1 100644 --- a/Documentation/coccinelle.txt +++ b/Documentation/coccinelle.txt | |||
@@ -36,6 +36,10 @@ as a regular user, and install it with | |||
36 | 36 | ||
37 | sudo make install | 37 | sudo make install |
38 | 38 | ||
39 | The semantic patches in the kernel will work best with Coccinelle version | ||
40 | 0.2.4 or later. Using earlier versions may incur some parse errors in the | ||
41 | semantic patch code, but any results that are obtained should still be | ||
42 | correct. | ||
39 | 43 | ||
40 | Using Coccinelle on the Linux kernel | 44 | Using Coccinelle on the Linux kernel |
41 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 45 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt index 5b9b1be6fde2..b507d61fd41c 100644 --- a/Documentation/kbuild/kconfig-language.txt +++ b/Documentation/kbuild/kconfig-language.txt | |||
@@ -267,7 +267,7 @@ separate list of options. | |||
267 | 267 | ||
268 | choices: | 268 | choices: |
269 | 269 | ||
270 | "choice" | 270 | "choice" [symbol] |
271 | <choice options> | 271 | <choice options> |
272 | <choice block> | 272 | <choice block> |
273 | "endchoice" | 273 | "endchoice" |
@@ -281,6 +281,10 @@ single driver can be compiled/loaded into the kernel, but all drivers | |||
281 | can be compiled as modules. | 281 | can be compiled as modules. |
282 | A choice accepts another option "optional", which allows to set the | 282 | A choice accepts another option "optional", which allows to set the |
283 | choice to 'n' and no entry needs to be selected. | 283 | choice to 'n' and no entry needs to be selected. |
284 | If no [symbol] is associated with a choice, then you can not have multiple | ||
285 | definitions of that choice. If a [symbol] is associated to the choice, | ||
286 | then you may define the same choice (ie. with the same entries) in another | ||
287 | place. | ||
284 | 288 | ||
285 | comment: | 289 | comment: |
286 | 290 | ||
diff --git a/scripts/.gitignore b/scripts/.gitignore index c5d5db54c009..e2741d23bab8 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore | |||
@@ -7,3 +7,4 @@ pnmtologo | |||
7 | bin2c | 7 | bin2c |
8 | unifdef | 8 | unifdef |
9 | ihex2fw | 9 | ihex2fw |
10 | recordmcount | ||
diff --git a/scripts/coccinelle/misc/doubleinit.cocci b/scripts/coccinelle/misc/doubleinit.cocci index 55d7dc19dfe0..156b20adb351 100644 --- a/scripts/coccinelle/misc/doubleinit.cocci +++ b/scripts/coccinelle/misc/doubleinit.cocci | |||
@@ -7,7 +7,7 @@ | |||
7 | // Copyright: (C) 2010 Julia Lawall, DIKU. GPLv2. | 7 | // Copyright: (C) 2010 Julia Lawall, DIKU. GPLv2. |
8 | // Copyright: (C) 2010 Gilles Muller, INRIA/LiP6. GPLv2. | 8 | // Copyright: (C) 2010 Gilles Muller, INRIA/LiP6. GPLv2. |
9 | // URL: http://coccinelle.lip6.fr/ | 9 | // URL: http://coccinelle.lip6.fr/ |
10 | // Comments: | 10 | // Comments: requires at least Coccinelle 0.2.4, lex or parse error otherwise |
11 | // Options: -no_includes -include_headers | 11 | // Options: -no_includes -include_headers |
12 | 12 | ||
13 | virtual org | 13 | virtual org |
@@ -19,7 +19,7 @@ position p0,p; | |||
19 | expression E; | 19 | expression E; |
20 | @@ | 20 | @@ |
21 | 21 | ||
22 | struct I s =@p0 { ... .fld@p = E, ...}; | 22 | struct I s =@p0 { ..., .fld@p = E, ...}; |
23 | 23 | ||
24 | @s@ | 24 | @s@ |
25 | identifier I, s, r.fld; | 25 | identifier I, s, r.fld; |
@@ -27,7 +27,7 @@ position r.p0,p; | |||
27 | expression E; | 27 | expression E; |
28 | @@ | 28 | @@ |
29 | 29 | ||
30 | struct I s =@p0 { ... .fld@p = E, ...}; | 30 | struct I s =@p0 { ..., .fld@p = E, ...}; |
31 | 31 | ||
32 | @script:python depends on org@ | 32 | @script:python depends on org@ |
33 | p0 << r.p0; | 33 | p0 << r.p0; |
diff --git a/scripts/coccinelle/null/deref_null.cocci b/scripts/coccinelle/null/deref_null.cocci index 9969d76d0f4b..cdac6cfcce92 100644 --- a/scripts/coccinelle/null/deref_null.cocci +++ b/scripts/coccinelle/null/deref_null.cocci | |||
@@ -11,21 +11,10 @@ | |||
11 | // Options: | 11 | // Options: |
12 | 12 | ||
13 | virtual context | 13 | virtual context |
14 | virtual patch | ||
15 | virtual org | 14 | virtual org |
16 | virtual report | 15 | virtual report |
17 | 16 | ||
18 | @initialize:python depends on !context && patch && !org && !report@ | 17 | @ifm@ |
19 | |||
20 | import sys | ||
21 | print >> sys.stderr, "This semantic patch does not support the 'patch' mode." | ||
22 | |||
23 | @depends on patch@ | ||
24 | @@ | ||
25 | |||
26 | this_rule_should_never_matches(); | ||
27 | |||
28 | @ifm depends on !patch@ | ||
29 | expression *E; | 18 | expression *E; |
30 | statement S1,S2; | 19 | statement S1,S2; |
31 | position p1; | 20 | position p1; |
@@ -35,7 +24,7 @@ if@p1 ((E == NULL && ...) || ...) S1 else S2 | |||
35 | 24 | ||
36 | // The following two rules are separate, because both can match a single | 25 | // The following two rules are separate, because both can match a single |
37 | // expression in different ways | 26 | // expression in different ways |
38 | @pr1 depends on !patch expression@ | 27 | @pr1 expression@ |
39 | expression *ifm.E; | 28 | expression *ifm.E; |
40 | identifier f; | 29 | identifier f; |
41 | position p1; | 30 | position p1; |
@@ -43,7 +32,7 @@ position p1; | |||
43 | 32 | ||
44 | (E != NULL && ...) ? <+...E->f@p1...+> : ... | 33 | (E != NULL && ...) ? <+...E->f@p1...+> : ... |
45 | 34 | ||
46 | @pr2 depends on !patch expression@ | 35 | @pr2 expression@ |
47 | expression *ifm.E; | 36 | expression *ifm.E; |
48 | identifier f; | 37 | identifier f; |
49 | position p2; | 38 | position p2; |
@@ -59,7 +48,7 @@ position p2; | |||
59 | 48 | ||
60 | // For org and report modes | 49 | // For org and report modes |
61 | 50 | ||
62 | @r depends on !context && !patch && (org || report) exists@ | 51 | @r depends on !context && (org || report) exists@ |
63 | expression subE <= ifm.E; | 52 | expression subE <= ifm.E; |
64 | expression *ifm.E; | 53 | expression *ifm.E; |
65 | expression E1,E2; | 54 | expression E1,E2; |
@@ -99,7 +88,7 @@ if@p1 ((E == NULL && ...) || ...) | |||
99 | } | 88 | } |
100 | else S3 | 89 | else S3 |
101 | 90 | ||
102 | @script:python depends on !context && !patch && !org && report@ | 91 | @script:python depends on !context && !org && report@ |
103 | p << r.p; | 92 | p << r.p; |
104 | p1 << ifm.p1; | 93 | p1 << ifm.p1; |
105 | x << ifm.E; | 94 | x << ifm.E; |
@@ -109,7 +98,7 @@ msg="ERROR: %s is NULL but dereferenced." % (x) | |||
109 | coccilib.report.print_report(p[0], msg) | 98 | coccilib.report.print_report(p[0], msg) |
110 | cocci.include_match(False) | 99 | cocci.include_match(False) |
111 | 100 | ||
112 | @script:python depends on !context && !patch && org && !report@ | 101 | @script:python depends on !context && org && !report@ |
113 | p << r.p; | 102 | p << r.p; |
114 | p1 << ifm.p1; | 103 | p1 << ifm.p1; |
115 | x << ifm.E; | 104 | x << ifm.E; |
@@ -120,7 +109,7 @@ msg_safe=msg.replace("[","@(").replace("]",")") | |||
120 | cocci.print_main(msg_safe,p) | 109 | cocci.print_main(msg_safe,p) |
121 | cocci.include_match(False) | 110 | cocci.include_match(False) |
122 | 111 | ||
123 | @s depends on !context && !patch && (org || report) exists@ | 112 | @s depends on !context && (org || report) exists@ |
124 | expression subE <= ifm.E; | 113 | expression subE <= ifm.E; |
125 | expression *ifm.E; | 114 | expression *ifm.E; |
126 | expression E1,E2; | 115 | expression E1,E2; |
@@ -159,7 +148,7 @@ if@p1 ((E == NULL && ...) || ...) | |||
159 | } | 148 | } |
160 | else S3 | 149 | else S3 |
161 | 150 | ||
162 | @script:python depends on !context && !patch && !org && report@ | 151 | @script:python depends on !context && !org && report@ |
163 | p << s.p; | 152 | p << s.p; |
164 | p1 << ifm.p1; | 153 | p1 << ifm.p1; |
165 | x << ifm.E; | 154 | x << ifm.E; |
@@ -168,7 +157,7 @@ x << ifm.E; | |||
168 | msg="ERROR: %s is NULL but dereferenced." % (x) | 157 | msg="ERROR: %s is NULL but dereferenced." % (x) |
169 | coccilib.report.print_report(p[0], msg) | 158 | coccilib.report.print_report(p[0], msg) |
170 | 159 | ||
171 | @script:python depends on !context && !patch && org && !report@ | 160 | @script:python depends on !context && org && !report@ |
172 | p << s.p; | 161 | p << s.p; |
173 | p1 << ifm.p1; | 162 | p1 << ifm.p1; |
174 | x << ifm.E; | 163 | x << ifm.E; |
@@ -180,7 +169,7 @@ cocci.print_main(msg_safe,p) | |||
180 | 169 | ||
181 | // For context mode | 170 | // For context mode |
182 | 171 | ||
183 | @depends on context && !patch && !org && !report exists@ | 172 | @depends on context && !org && !report exists@ |
184 | expression subE <= ifm.E; | 173 | expression subE <= ifm.E; |
185 | expression *ifm.E; | 174 | expression *ifm.E; |
186 | expression E1,E2; | 175 | expression E1,E2; |
@@ -223,7 +212,7 @@ else S3 | |||
223 | // The following three rules are duplicates of ifm, pr1 and pr2 respectively. | 212 | // The following three rules are duplicates of ifm, pr1 and pr2 respectively. |
224 | // It is need because the previous rule as already made a "change". | 213 | // It is need because the previous rule as already made a "change". |
225 | 214 | ||
226 | @ifm1 depends on !patch@ | 215 | @ifm1@ |
227 | expression *E; | 216 | expression *E; |
228 | statement S1,S2; | 217 | statement S1,S2; |
229 | position p1; | 218 | position p1; |
@@ -231,7 +220,7 @@ position p1; | |||
231 | 220 | ||
232 | if@p1 ((E == NULL && ...) || ...) S1 else S2 | 221 | if@p1 ((E == NULL && ...) || ...) S1 else S2 |
233 | 222 | ||
234 | @pr11 depends on !patch expression@ | 223 | @pr11 expression@ |
235 | expression *ifm1.E; | 224 | expression *ifm1.E; |
236 | identifier f; | 225 | identifier f; |
237 | position p1; | 226 | position p1; |
@@ -239,7 +228,7 @@ position p1; | |||
239 | 228 | ||
240 | (E != NULL && ...) ? <+...E->f@p1...+> : ... | 229 | (E != NULL && ...) ? <+...E->f@p1...+> : ... |
241 | 230 | ||
242 | @pr12 depends on !patch expression@ | 231 | @pr12 expression@ |
243 | expression *ifm1.E; | 232 | expression *ifm1.E; |
244 | identifier f; | 233 | identifier f; |
245 | position p2; | 234 | position p2; |
@@ -253,7 +242,7 @@ position p2; | |||
253 | sizeof(<+...E->f@p2...+>) | 242 | sizeof(<+...E->f@p2...+>) |
254 | ) | 243 | ) |
255 | 244 | ||
256 | @depends on context && !patch && !org && !report exists@ | 245 | @depends on context && !org && !report exists@ |
257 | expression subE <= ifm1.E; | 246 | expression subE <= ifm1.E; |
258 | expression *ifm1.E; | 247 | expression *ifm1.E; |
259 | expression E1,E2; | 248 | expression E1,E2; |
diff --git a/scripts/config b/scripts/config index 608d7fdb13e8..a7c7c4b8e957 100755 --- a/scripts/config +++ b/scripts/config | |||
@@ -10,8 +10,10 @@ commands: | |||
10 | --enable|-e option Enable option | 10 | --enable|-e option Enable option |
11 | --disable|-d option Disable option | 11 | --disable|-d option Disable option |
12 | --module|-m option Turn option into a module | 12 | --module|-m option Turn option into a module |
13 | --set-str option value | 13 | --set-str option string |
14 | Set option to "value" | 14 | Set option to "string" |
15 | --set-val option value | ||
16 | Set option to value | ||
15 | --state|-s option Print state of option (n,y,m,undef) | 17 | --state|-s option Print state of option (n,y,m,undef) |
16 | 18 | ||
17 | --enable-after|-E beforeopt option | 19 | --enable-after|-E beforeopt option |
@@ -86,7 +88,7 @@ while [ "$1" != "" ] ; do | |||
86 | B=$ARG | 88 | B=$ARG |
87 | shift 2 | 89 | shift 2 |
88 | ;; | 90 | ;; |
89 | --*) | 91 | -*) |
90 | checkarg "$1" | 92 | checkarg "$1" |
91 | shift | 93 | shift |
92 | ;; | 94 | ;; |
@@ -109,6 +111,11 @@ while [ "$1" != "" ] ; do | |||
109 | shift | 111 | shift |
110 | ;; | 112 | ;; |
111 | 113 | ||
114 | --set-val) | ||
115 | set_var "CONFIG_$ARG" "CONFIG_$ARG=$1" | ||
116 | shift | ||
117 | ;; | ||
118 | |||
112 | --state|-s) | 119 | --state|-s) |
113 | if grep -q "# CONFIG_$ARG is not set" $FN ; then | 120 | if grep -q "# CONFIG_$ARG is not set" $FN ; then |
114 | echo n | 121 | echo n |
diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl index 50d6cfd1fa77..7957e7a5166a 100644 --- a/scripts/headers_check.pl +++ b/scripts/headers_check.pl | |||
@@ -64,10 +64,10 @@ sub check_include | |||
64 | 64 | ||
65 | sub check_declarations | 65 | sub check_declarations |
66 | { | 66 | { |
67 | if ($line =~m/^\s*extern\b/) { | 67 | if ($line =~m/^(\s*extern|unsigned|char|short|int|long|void)\b/) { |
68 | printf STDERR "$filename:$lineno: " . | 68 | printf STDERR "$filename:$lineno: " . |
69 | "userspace cannot call function or variable " . | 69 | "userspace cannot reference function or " . |
70 | "defined in the kernel\n"; | 70 | "variable defined in the kernel\n"; |
71 | } | 71 | } |
72 | } | 72 | } |
73 | 73 | ||
diff --git a/scripts/tags.sh b/scripts/tags.sh index bbbe584d4494..92fdc4546141 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh | |||
@@ -123,7 +123,7 @@ exuberant() | |||
123 | -I ____cacheline_internodealigned_in_smp \ | 123 | -I ____cacheline_internodealigned_in_smp \ |
124 | -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \ | 124 | -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \ |
125 | -I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \ | 125 | -I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \ |
126 | --extra=+f --c-kinds=-px \ | 126 | --extra=+f --c-kinds=+px \ |
127 | --regex-asm='/^ENTRY\(([^)]*)\).*/\1/' \ | 127 | --regex-asm='/^ENTRY\(([^)]*)\).*/\1/' \ |
128 | --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \ | 128 | --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \ |
129 | --regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \ | 129 | --regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \ |