Skip to content

Commit e316633

Browse files
committed
Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: Documentation/kbuild: add info that 'choice' can have a symbol name kbuild: add numeric --set-val option to scripts/config headers_check: Fix warning text headers_check: better search for functions in headers scripts/coccinelle: update for compatability with Coccinelle 0.2.4 tags: put function prototypes back! Kconfig: fix single letter command in scripts/config gitignore: add scripts/recordmcount
2 parents 1693ed2 + 0719e1d commit e316633

8 files changed

Lines changed: 41 additions & 36 deletions

File tree

‎Documentation/coccinelle.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ as a regular user, and install it with
3636

3737
sudo make install
3838

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.
3943

4044
Using Coccinelle on the Linux kernel
4145
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

‎Documentation/kbuild/kconfig-language.txt‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ separate list of options.
267267

268268
choices:
269269

270-
"choice"
270+
"choice" [symbol]
271271
<choice options>
272272
<choice block>
273273
"endchoice"
@@ -281,6 +281,10 @@ single driver can be compiled/loaded into the kernel, but all drivers
281281
can be compiled as modules.
282282
A choice accepts another option "optional", which allows to set the
283283
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.
284288

285289
comment:
286290

‎scripts/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ pnmtologo
77
bin2c
88
unifdef
99
ihex2fw
10+
recordmcount

‎scripts/coccinelle/misc/doubleinit.cocci‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// Copyright: (C) 2010 Julia Lawall, DIKU. GPLv2.
88
// Copyright: (C) 2010 Gilles Muller, INRIA/LiP6. GPLv2.
99
// URL: http://coccinelle.lip6.fr/
10-
// Comments:
10+
// Comments: requires at least Coccinelle 0.2.4, lex or parse error otherwise
1111
// Options: -no_includes -include_headers
1212

1313
virtual org
@@ -19,15 +19,15 @@ position p0,p;
1919
expression E;
2020
@@
2121

22-
struct I s =@p0 { ... .fld@p = E, ...};
22+
struct I s =@p0 { ..., .fld@p = E, ...};
2323

2424
@s@
2525
identifier I, s, r.fld;
2626
position r.p0,p;
2727
expression E;
2828
@@
2929

30-
struct I s =@p0 { ... .fld@p = E, ...};
30+
struct I s =@p0 { ..., .fld@p = E, ...};
3131

3232
@script:python depends on org@
3333
p0 << r.p0;

‎scripts/coccinelle/null/deref_null.cocci‎

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,10 @@
1111
// Options:
1212

1313
virtual context
14-
virtual patch
1514
virtual org
1615
virtual report
1716

18-
@initialize:python depends on !context && patch && !org && !report@
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@
17+
@ifm@
2918
expression *E;
3019
statement S1,S2;
3120
position p1;
@@ -35,15 +24,15 @@ if@p1 ((E == NULL && ...) || ...) S1 else S2
3524

3625
// The following two rules are separate, because both can match a single
3726
// expression in different ways
38-
@pr1 depends on !patch expression@
27+
@pr1 expression@
3928
expression *ifm.E;
4029
identifier f;
4130
position p1;
4231
@@
4332

4433
(E != NULL && ...) ? <+...E->f@p1...+> : ...
4534

46-
@pr2 depends on !patch expression@
35+
@pr2 expression@
4736
expression *ifm.E;
4837
identifier f;
4938
position p2;
@@ -59,7 +48,7 @@ position p2;
5948

6049
// For org and report modes
6150

62-
@r depends on !context && !patch && (org || report) exists@
51+
@r depends on !context && (org || report) exists@
6352
expression subE <= ifm.E;
6453
expression *ifm.E;
6554
expression E1,E2;
@@ -99,7 +88,7 @@ if@p1 ((E == NULL && ...) || ...)
9988
}
10089
else S3
10190

102-
@script:python depends on !context && !patch && !org && report@
91+
@script:python depends on !context && !org && report@
10392
p << r.p;
10493
p1 << ifm.p1;
10594
x << ifm.E;
@@ -109,7 +98,7 @@ msg="ERROR: %s is NULL but dereferenced." % (x)
10998
coccilib.report.print_report(p[0], msg)
11099
cocci.include_match(False)
111100
112-
@script:python depends on !context && !patch && org && !report@
101+
@script:python depends on !context && org && !report@
113102
p << r.p;
114103
p1 << ifm.p1;
115104
x << ifm.E;
@@ -120,7 +109,7 @@ msg_safe=msg.replace("[","@(").replace("]",")")
120109
cocci.print_main(msg_safe,p)
121110
cocci.include_match(False)
122111
123-
@s depends on !context && !patch && (org || report) exists@
112+
@s depends on !context && (org || report) exists@
124113
expression subE <= ifm.E;
125114
expression *ifm.E;
126115
expression E1,E2;
@@ -159,7 +148,7 @@ if@p1 ((E == NULL && ...) || ...)
159148
}
160149
else S3
161150

162-
@script:python depends on !context && !patch && !org && report@
151+
@script:python depends on !context && !org && report@
163152
p << s.p;
164153
p1 << ifm.p1;
165154
x << ifm.E;
@@ -168,7 +157,7 @@ x << ifm.E;
168157
msg="ERROR: %s is NULL but dereferenced." % (x)
169158
coccilib.report.print_report(p[0], msg)
170159
171-
@script:python depends on !context && !patch && org && !report@
160+
@script:python depends on !context && org && !report@
172161
p << s.p;
173162
p1 << ifm.p1;
174163
x << ifm.E;
@@ -180,7 +169,7 @@ cocci.print_main(msg_safe,p)
180169
181170
// For context mode
182171
183-
@depends on context && !patch && !org && !report exists@
172+
@depends on context && !org && !report exists@
184173
expression subE <= ifm.E;
185174
expression *ifm.E;
186175
expression E1,E2;
@@ -223,23 +212,23 @@ else S3
223212
// The following three rules are duplicates of ifm, pr1 and pr2 respectively.
224213
// It is need because the previous rule as already made a "change".
225214

226-
@ifm1 depends on !patch@
215+
@ifm1@
227216
expression *E;
228217
statement S1,S2;
229218
position p1;
230219
@@
231220

232221
if@p1 ((E == NULL && ...) || ...) S1 else S2
233222

234-
@pr11 depends on !patch expression@
223+
@pr11 expression@
235224
expression *ifm1.E;
236225
identifier f;
237226
position p1;
238227
@@
239228

240229
(E != NULL && ...) ? <+...E->f@p1...+> : ...
241230

242-
@pr12 depends on !patch expression@
231+
@pr12 expression@
243232
expression *ifm1.E;
244233
identifier f;
245234
position p2;
@@ -253,7 +242,7 @@ position p2;
253242
sizeof(<+...E->f@p2...+>)
254243
)
255244

256-
@depends on context && !patch && !org && !report exists@
245+
@depends on context && !org && !report exists@
257246
expression subE <= ifm1.E;
258247
expression *ifm1.E;
259248
expression E1,E2;

‎scripts/config‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ commands:
1010
--enable|-e option Enable option
1111
--disable|-d option Disable option
1212
--module|-m option Turn option into a module
13-
--set-str option value
14-
Set option to "value"
13+
--set-str option string
14+
Set option to "string"
15+
--set-val option value
16+
Set option to value
1517
--state|-s option Print state of option (n,y,m,undef)
1618
1719
--enable-after|-E beforeopt option
@@ -86,7 +88,7 @@ while [ "$1" != "" ] ; do
8688
B=$ARG
8789
shift 2
8890
;;
89-
--*)
91+
-*)
9092
checkarg "$1"
9193
shift
9294
;;
@@ -109,6 +111,11 @@ while [ "$1" != "" ] ; do
109111
shift
110112
;;
111113

114+
--set-val)
115+
set_var "CONFIG_$ARG" "CONFIG_$ARG=$1"
116+
shift
117+
;;
118+
112119
--state|-s)
113120
if grep -q "# CONFIG_$ARG is not set" $FN ; then
114121
echo n

‎scripts/headers_check.pl‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ sub check_include
6464

6565
sub check_declarations
6666
{
67-
if ($line =~m/^\s*extern\b/) {
67+
if ($line =~m/^(\s*extern|unsigned|char|short|int|long|void)\b/) {
6868
printf STDERR "$filename:$lineno: " .
69-
"userspace cannot call function or variable " .
70-
"defined in the kernel\n";
69+
"userspace cannot reference function or " .
70+
"variable defined in the kernel\n";
7171
}
7272
}
7373

‎scripts/tags.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ exuberant()
123123
-I ____cacheline_internodealigned_in_smp \
124124
-I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
125125
-I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \
126-
--extra=+f --c-kinds=-px \
126+
--extra=+f --c-kinds=+px \
127127
--regex-asm='/^ENTRY\(([^)]*)\).*/\1/' \
128128
--regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \
129129
--regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \

0 commit comments

Comments
 (0)