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
This commit is contained in:
@@ -36,6 +36,10 @@ as a regular user, and install it with
|
|||||||
|
|
||||||
sudo make install
|
sudo make install
|
||||||
|
|
||||||
|
The semantic patches in the kernel will work best with Coccinelle version
|
||||||
|
0.2.4 or later. Using earlier versions may incur some parse errors in the
|
||||||
|
semantic patch code, but any results that are obtained should still be
|
||||||
|
correct.
|
||||||
|
|
||||||
Using Coccinelle on the Linux kernel
|
Using Coccinelle on the Linux kernel
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@@ -267,7 +267,7 @@ separate list of options.
|
|||||||
|
|
||||||
choices:
|
choices:
|
||||||
|
|
||||||
"choice"
|
"choice" [symbol]
|
||||||
<choice options>
|
<choice options>
|
||||||
<choice block>
|
<choice block>
|
||||||
"endchoice"
|
"endchoice"
|
||||||
@@ -281,6 +281,10 @@ single driver can be compiled/loaded into the kernel, but all drivers
|
|||||||
can be compiled as modules.
|
can be compiled as modules.
|
||||||
A choice accepts another option "optional", which allows to set the
|
A choice accepts another option "optional", which allows to set the
|
||||||
choice to 'n' and no entry needs to be selected.
|
choice to 'n' and no entry needs to be selected.
|
||||||
|
If no [symbol] is associated with a choice, then you can not have multiple
|
||||||
|
definitions of that choice. If a [symbol] is associated to the choice,
|
||||||
|
then you may define the same choice (ie. with the same entries) in another
|
||||||
|
place.
|
||||||
|
|
||||||
comment:
|
comment:
|
||||||
|
|
||||||
|
1
scripts/.gitignore
vendored
1
scripts/.gitignore
vendored
@@ -7,3 +7,4 @@ pnmtologo
|
|||||||
bin2c
|
bin2c
|
||||||
unifdef
|
unifdef
|
||||||
ihex2fw
|
ihex2fw
|
||||||
|
recordmcount
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
// Copyright: (C) 2010 Julia Lawall, DIKU. GPLv2.
|
// Copyright: (C) 2010 Julia Lawall, DIKU. GPLv2.
|
||||||
// Copyright: (C) 2010 Gilles Muller, INRIA/LiP6. GPLv2.
|
// Copyright: (C) 2010 Gilles Muller, INRIA/LiP6. GPLv2.
|
||||||
// URL: http://coccinelle.lip6.fr/
|
// URL: http://coccinelle.lip6.fr/
|
||||||
// Comments:
|
// Comments: requires at least Coccinelle 0.2.4, lex or parse error otherwise
|
||||||
// Options: -no_includes -include_headers
|
// Options: -no_includes -include_headers
|
||||||
|
|
||||||
virtual org
|
virtual org
|
||||||
@@ -19,7 +19,7 @@ position p0,p;
|
|||||||
expression E;
|
expression E;
|
||||||
@@
|
@@
|
||||||
|
|
||||||
struct I s =@p0 { ... .fld@p = E, ...};
|
struct I s =@p0 { ..., .fld@p = E, ...};
|
||||||
|
|
||||||
@s@
|
@s@
|
||||||
identifier I, s, r.fld;
|
identifier I, s, r.fld;
|
||||||
@@ -27,7 +27,7 @@ position r.p0,p;
|
|||||||
expression E;
|
expression E;
|
||||||
@@
|
@@
|
||||||
|
|
||||||
struct I s =@p0 { ... .fld@p = E, ...};
|
struct I s =@p0 { ..., .fld@p = E, ...};
|
||||||
|
|
||||||
@script:python depends on org@
|
@script:python depends on org@
|
||||||
p0 << r.p0;
|
p0 << r.p0;
|
||||||
|
@@ -11,21 +11,10 @@
|
|||||||
// Options:
|
// Options:
|
||||||
|
|
||||||
virtual context
|
virtual context
|
||||||
virtual patch
|
|
||||||
virtual org
|
virtual org
|
||||||
virtual report
|
virtual report
|
||||||
|
|
||||||
@initialize:python depends on !context && patch && !org && !report@
|
@ifm@
|
||||||
|
|
||||||
import sys
|
|
||||||
print >> sys.stderr, "This semantic patch does not support the 'patch' mode."
|
|
||||||
|
|
||||||
@depends on patch@
|
|
||||||
@@
|
|
||||||
|
|
||||||
this_rule_should_never_matches();
|
|
||||||
|
|
||||||
@ifm depends on !patch@
|
|
||||||
expression *E;
|
expression *E;
|
||||||
statement S1,S2;
|
statement S1,S2;
|
||||||
position p1;
|
position p1;
|
||||||
@@ -35,7 +24,7 @@ if@p1 ((E == NULL && ...) || ...) S1 else S2
|
|||||||
|
|
||||||
// The following two rules are separate, because both can match a single
|
// The following two rules are separate, because both can match a single
|
||||||
// expression in different ways
|
// expression in different ways
|
||||||
@pr1 depends on !patch expression@
|
@pr1 expression@
|
||||||
expression *ifm.E;
|
expression *ifm.E;
|
||||||
identifier f;
|
identifier f;
|
||||||
position p1;
|
position p1;
|
||||||
@@ -43,7 +32,7 @@ position p1;
|
|||||||
|
|
||||||
(E != NULL && ...) ? <+...E->f@p1...+> : ...
|
(E != NULL && ...) ? <+...E->f@p1...+> : ...
|
||||||
|
|
||||||
@pr2 depends on !patch expression@
|
@pr2 expression@
|
||||||
expression *ifm.E;
|
expression *ifm.E;
|
||||||
identifier f;
|
identifier f;
|
||||||
position p2;
|
position p2;
|
||||||
@@ -59,7 +48,7 @@ position p2;
|
|||||||
|
|
||||||
// For org and report modes
|
// For org and report modes
|
||||||
|
|
||||||
@r depends on !context && !patch && (org || report) exists@
|
@r depends on !context && (org || report) exists@
|
||||||
expression subE <= ifm.E;
|
expression subE <= ifm.E;
|
||||||
expression *ifm.E;
|
expression *ifm.E;
|
||||||
expression E1,E2;
|
expression E1,E2;
|
||||||
@@ -99,7 +88,7 @@ if@p1 ((E == NULL && ...) || ...)
|
|||||||
}
|
}
|
||||||
else S3
|
else S3
|
||||||
|
|
||||||
@script:python depends on !context && !patch && !org && report@
|
@script:python depends on !context && !org && report@
|
||||||
p << r.p;
|
p << r.p;
|
||||||
p1 << ifm.p1;
|
p1 << ifm.p1;
|
||||||
x << ifm.E;
|
x << ifm.E;
|
||||||
@@ -109,7 +98,7 @@ msg="ERROR: %s is NULL but dereferenced." % (x)
|
|||||||
coccilib.report.print_report(p[0], msg)
|
coccilib.report.print_report(p[0], msg)
|
||||||
cocci.include_match(False)
|
cocci.include_match(False)
|
||||||
|
|
||||||
@script:python depends on !context && !patch && org && !report@
|
@script:python depends on !context && org && !report@
|
||||||
p << r.p;
|
p << r.p;
|
||||||
p1 << ifm.p1;
|
p1 << ifm.p1;
|
||||||
x << ifm.E;
|
x << ifm.E;
|
||||||
@@ -120,7 +109,7 @@ msg_safe=msg.replace("[","@(").replace("]",")")
|
|||||||
cocci.print_main(msg_safe,p)
|
cocci.print_main(msg_safe,p)
|
||||||
cocci.include_match(False)
|
cocci.include_match(False)
|
||||||
|
|
||||||
@s depends on !context && !patch && (org || report) exists@
|
@s depends on !context && (org || report) exists@
|
||||||
expression subE <= ifm.E;
|
expression subE <= ifm.E;
|
||||||
expression *ifm.E;
|
expression *ifm.E;
|
||||||
expression E1,E2;
|
expression E1,E2;
|
||||||
@@ -159,7 +148,7 @@ if@p1 ((E == NULL && ...) || ...)
|
|||||||
}
|
}
|
||||||
else S3
|
else S3
|
||||||
|
|
||||||
@script:python depends on !context && !patch && !org && report@
|
@script:python depends on !context && !org && report@
|
||||||
p << s.p;
|
p << s.p;
|
||||||
p1 << ifm.p1;
|
p1 << ifm.p1;
|
||||||
x << ifm.E;
|
x << ifm.E;
|
||||||
@@ -168,7 +157,7 @@ x << ifm.E;
|
|||||||
msg="ERROR: %s is NULL but dereferenced." % (x)
|
msg="ERROR: %s is NULL but dereferenced." % (x)
|
||||||
coccilib.report.print_report(p[0], msg)
|
coccilib.report.print_report(p[0], msg)
|
||||||
|
|
||||||
@script:python depends on !context && !patch && org && !report@
|
@script:python depends on !context && org && !report@
|
||||||
p << s.p;
|
p << s.p;
|
||||||
p1 << ifm.p1;
|
p1 << ifm.p1;
|
||||||
x << ifm.E;
|
x << ifm.E;
|
||||||
@@ -180,7 +169,7 @@ cocci.print_main(msg_safe,p)
|
|||||||
|
|
||||||
// For context mode
|
// For context mode
|
||||||
|
|
||||||
@depends on context && !patch && !org && !report exists@
|
@depends on context && !org && !report exists@
|
||||||
expression subE <= ifm.E;
|
expression subE <= ifm.E;
|
||||||
expression *ifm.E;
|
expression *ifm.E;
|
||||||
expression E1,E2;
|
expression E1,E2;
|
||||||
@@ -223,7 +212,7 @@ else S3
|
|||||||
// The following three rules are duplicates of ifm, pr1 and pr2 respectively.
|
// The following three rules are duplicates of ifm, pr1 and pr2 respectively.
|
||||||
// It is need because the previous rule as already made a "change".
|
// It is need because the previous rule as already made a "change".
|
||||||
|
|
||||||
@ifm1 depends on !patch@
|
@ifm1@
|
||||||
expression *E;
|
expression *E;
|
||||||
statement S1,S2;
|
statement S1,S2;
|
||||||
position p1;
|
position p1;
|
||||||
@@ -231,7 +220,7 @@ position p1;
|
|||||||
|
|
||||||
if@p1 ((E == NULL && ...) || ...) S1 else S2
|
if@p1 ((E == NULL && ...) || ...) S1 else S2
|
||||||
|
|
||||||
@pr11 depends on !patch expression@
|
@pr11 expression@
|
||||||
expression *ifm1.E;
|
expression *ifm1.E;
|
||||||
identifier f;
|
identifier f;
|
||||||
position p1;
|
position p1;
|
||||||
@@ -239,7 +228,7 @@ position p1;
|
|||||||
|
|
||||||
(E != NULL && ...) ? <+...E->f@p1...+> : ...
|
(E != NULL && ...) ? <+...E->f@p1...+> : ...
|
||||||
|
|
||||||
@pr12 depends on !patch expression@
|
@pr12 expression@
|
||||||
expression *ifm1.E;
|
expression *ifm1.E;
|
||||||
identifier f;
|
identifier f;
|
||||||
position p2;
|
position p2;
|
||||||
@@ -253,7 +242,7 @@ position p2;
|
|||||||
sizeof(<+...E->f@p2...+>)
|
sizeof(<+...E->f@p2...+>)
|
||||||
)
|
)
|
||||||
|
|
||||||
@depends on context && !patch && !org && !report exists@
|
@depends on context && !org && !report exists@
|
||||||
expression subE <= ifm1.E;
|
expression subE <= ifm1.E;
|
||||||
expression *ifm1.E;
|
expression *ifm1.E;
|
||||||
expression E1,E2;
|
expression E1,E2;
|
||||||
|
@@ -10,8 +10,10 @@ commands:
|
|||||||
--enable|-e option Enable option
|
--enable|-e option Enable option
|
||||||
--disable|-d option Disable option
|
--disable|-d option Disable option
|
||||||
--module|-m option Turn option into a module
|
--module|-m option Turn option into a module
|
||||||
--set-str option value
|
--set-str option string
|
||||||
Set option to "value"
|
Set option to "string"
|
||||||
|
--set-val option value
|
||||||
|
Set option to value
|
||||||
--state|-s option Print state of option (n,y,m,undef)
|
--state|-s option Print state of option (n,y,m,undef)
|
||||||
|
|
||||||
--enable-after|-E beforeopt option
|
--enable-after|-E beforeopt option
|
||||||
@@ -86,7 +88,7 @@ while [ "$1" != "" ] ; do
|
|||||||
B=$ARG
|
B=$ARG
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
--*)
|
-*)
|
||||||
checkarg "$1"
|
checkarg "$1"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@@ -109,6 +111,11 @@ while [ "$1" != "" ] ; do
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
--set-val)
|
||||||
|
set_var "CONFIG_$ARG" "CONFIG_$ARG=$1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
--state|-s)
|
--state|-s)
|
||||||
if grep -q "# CONFIG_$ARG is not set" $FN ; then
|
if grep -q "# CONFIG_$ARG is not set" $FN ; then
|
||||||
echo n
|
echo n
|
||||||
|
@@ -64,10 +64,10 @@ sub check_include
|
|||||||
|
|
||||||
sub check_declarations
|
sub check_declarations
|
||||||
{
|
{
|
||||||
if ($line =~m/^\s*extern\b/) {
|
if ($line =~m/^(\s*extern|unsigned|char|short|int|long|void)\b/) {
|
||||||
printf STDERR "$filename:$lineno: " .
|
printf STDERR "$filename:$lineno: " .
|
||||||
"userspace cannot call function or variable " .
|
"userspace cannot reference function or " .
|
||||||
"defined in the kernel\n";
|
"variable defined in the kernel\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -123,7 +123,7 @@ exuberant()
|
|||||||
-I ____cacheline_internodealigned_in_smp \
|
-I ____cacheline_internodealigned_in_smp \
|
||||||
-I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
|
-I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
|
||||||
-I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \
|
-I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \
|
||||||
--extra=+f --c-kinds=-px \
|
--extra=+f --c-kinds=+px \
|
||||||
--regex-asm='/^ENTRY\(([^)]*)\).*/\1/' \
|
--regex-asm='/^ENTRY\(([^)]*)\).*/\1/' \
|
||||||
--regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \
|
--regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \
|
||||||
--regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \
|
--regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \
|
||||||
|
Reference in New Issue
Block a user