From 6e5b86924a633f5b6eefb051404339a5a7bb005e Mon Sep 17 00:00:00 2001 From: Américo Wang Date: Fri, 5 Nov 2010 14:16:10 +0800 Subject: gitignore: add scripts/recordmcount This file is generated, should be ignored by git. Signed-off-by: WANG Cong Signed-off-by: Michal Marek --- scripts/.gitignore | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/.gitignore b/scripts/.gitignore index c5d5db54c009..e2741d23bab8 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore @@ -7,3 +7,4 @@ pnmtologo bin2c unifdef ihex2fw +recordmcount -- cgit v1.2.3 From 45f53cc90e8f0e46ab024d0bc1de49ebee0dc583 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Fri, 5 Nov 2010 12:06:05 +0100 Subject: Kconfig: fix single letter command in scripts/config The one letter commands in scripts/config didn't work and always printed usage. Fix this here. Cc: erick@openchill.org Reported-by: erick@openchill.org Signed-off-by: Andi Kleen Signed-off-by: Michal Marek --- scripts/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/config b/scripts/config index 608d7fdb13e8..dfd4732f7099 100755 --- a/scripts/config +++ b/scripts/config @@ -86,7 +86,7 @@ while [ "$1" != "" ] ; do B=$ARG shift 2 ;; - --*) + -*) checkarg "$1" shift ;; -- cgit v1.2.3 From 0a18a9386c056028799938960f91be338c4ff349 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Thu, 4 Nov 2010 10:24:16 +0100 Subject: tags: put function prototypes back! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 7db86dc (ctags: usability fix) removed function prototypes from tags file claiming "It makes no real sense to include function prototypes". But it is useful for quickly determining which header file developer needs to include to fix compilation. Now if someone wants to remove forward declarations (which I agree are baggage), write a postprocessing script. Signed-off-by: Alexey Dobriyan Signed-off-by: Uwe Kleine-König Signed-off-by: Michal Marek --- scripts/tags.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/tags.sh b/scripts/tags.sh index 8509bb512935..e091db312ddb 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -123,7 +123,7 @@ exuberant() -I ____cacheline_internodealigned_in_smp \ -I EXPORT_SYMBOL,EXPORT_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-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' -- cgit v1.2.3 From a1087ef6abedf0bfd60e5e3fddf33192cb2c1325 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Wed, 24 Nov 2010 15:54:18 +0100 Subject: scripts/coccinelle: update for compatability with Coccinelle 0.2.4 For doubleinit.cocci, Coccinelle 0.2.4 requires a comma after ... in a field list. Coccinelle also now behaves gracefully when a definition is provided for a virtual that doesn't exist, so there is no need for the semantic patch code to check for this case. Updated the documentation to reflect the fact that the best results will now be obtained with Coccinelle version 0.2.4 or later. Signed-off-by: Julia Lawall --- Documentation/coccinelle.txt | 4 ++++ scripts/coccinelle/misc/doubleinit.cocci | 6 ++--- scripts/coccinelle/null/deref_null.cocci | 39 ++++++++++++-------------------- 3 files changed, 21 insertions(+), 28 deletions(-) (limited to 'scripts') 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 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 @@ // Copyright: (C) 2010 Julia Lawall, DIKU. GPLv2. // Copyright: (C) 2010 Gilles Muller, INRIA/LiP6. GPLv2. // URL: http://coccinelle.lip6.fr/ -// Comments: +// Comments: requires at least Coccinelle 0.2.4, lex or parse error otherwise // Options: -no_includes -include_headers virtual org @@ -19,7 +19,7 @@ position p0,p; expression E; @@ -struct I s =@p0 { ... .fld@p = E, ...}; +struct I s =@p0 { ..., .fld@p = E, ...}; @s@ identifier I, s, r.fld; @@ -27,7 +27,7 @@ position r.p0,p; expression E; @@ -struct I s =@p0 { ... .fld@p = E, ...}; +struct I s =@p0 { ..., .fld@p = E, ...}; @script:python depends on org@ 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 @@ // Options: virtual context -virtual patch virtual org virtual report -@initialize:python depends on !context && patch && !org && !report@ - -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@ +@ifm@ expression *E; statement S1,S2; 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 // expression in different ways -@pr1 depends on !patch expression@ +@pr1 expression@ expression *ifm.E; identifier f; position p1; @@ -43,7 +32,7 @@ position p1; (E != NULL && ...) ? <+...E->f@p1...+> : ... -@pr2 depends on !patch expression@ +@pr2 expression@ expression *ifm.E; identifier f; position p2; @@ -59,7 +48,7 @@ position p2; // 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 *ifm.E; expression E1,E2; @@ -99,7 +88,7 @@ if@p1 ((E == NULL && ...) || ...) } else S3 -@script:python depends on !context && !patch && !org && report@ +@script:python depends on !context && !org && report@ p << r.p; p1 << ifm.p1; x << ifm.E; @@ -109,7 +98,7 @@ msg="ERROR: %s is NULL but dereferenced." % (x) coccilib.report.print_report(p[0], msg) cocci.include_match(False) -@script:python depends on !context && !patch && org && !report@ +@script:python depends on !context && org && !report@ p << r.p; p1 << ifm.p1; x << ifm.E; @@ -120,7 +109,7 @@ msg_safe=msg.replace("[","@(").replace("]",")") cocci.print_main(msg_safe,p) cocci.include_match(False) -@s depends on !context && !patch && (org || report) exists@ +@s depends on !context && (org || report) exists@ expression subE <= ifm.E; expression *ifm.E; expression E1,E2; @@ -159,7 +148,7 @@ if@p1 ((E == NULL && ...) || ...) } else S3 -@script:python depends on !context && !patch && !org && report@ +@script:python depends on !context && !org && report@ p << s.p; p1 << ifm.p1; x << ifm.E; @@ -168,7 +157,7 @@ x << ifm.E; msg="ERROR: %s is NULL but dereferenced." % (x) 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; p1 << ifm.p1; x << ifm.E; @@ -180,7 +169,7 @@ cocci.print_main(msg_safe,p) // For context mode -@depends on context && !patch && !org && !report exists@ +@depends on context && !org && !report exists@ expression subE <= ifm.E; expression *ifm.E; expression E1,E2; @@ -223,7 +212,7 @@ else S3 // The following three rules are duplicates of ifm, pr1 and pr2 respectively. // It is need because the previous rule as already made a "change". -@ifm1 depends on !patch@ +@ifm1@ expression *E; statement S1,S2; position p1; @@ -231,7 +220,7 @@ position p1; if@p1 ((E == NULL && ...) || ...) S1 else S2 -@pr11 depends on !patch expression@ +@pr11 expression@ expression *ifm1.E; identifier f; position p1; @@ -239,7 +228,7 @@ position p1; (E != NULL && ...) ? <+...E->f@p1...+> : ... -@pr12 depends on !patch expression@ +@pr12 expression@ expression *ifm1.E; identifier f; position p2; @@ -253,7 +242,7 @@ position p2; sizeof(<+...E->f@p2...+>) ) -@depends on context && !patch && !org && !report exists@ +@depends on context && !org && !report exists@ expression subE <= ifm1.E; expression *ifm1.E; expression E1,E2; -- cgit v1.2.3 From de323f22a83b024b7432e813609c6efb74b1bbfc Mon Sep 17 00:00:00 2001 From: "akpm@linux-foundation.org" Date: Tue, 30 Nov 2010 13:51:13 -0800 Subject: headers_check: better search for functions in headers Some headers don't bother with "extern" in function prototypes, which results in said prototypes being unnoticed and exported to userland. This patch slightly improves detection of such cases by checking for C type names as well in the beginning of a line. Signed-off-by: Alexander Shishkin Cc: Stephen Hemminger Cc: Michal Marek Cc: WANG Cong Cc: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Michal Marek --- scripts/headers_check.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl index 50d6cfd1fa77..e0e25a1c2c12 100644 --- a/scripts/headers_check.pl +++ b/scripts/headers_check.pl @@ -64,7 +64,7 @@ sub check_include 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: " . "userspace cannot call function or variable " . "defined in the kernel\n"; -- cgit v1.2.3 From d52784eb3607bf887628742f99041b4f18d7d1de Mon Sep 17 00:00:00 2001 From: "akpm@linux-foundation.org" Date: Tue, 30 Nov 2010 13:52:14 -0800 Subject: headers_check: Fix warning text Fix the warning text too, per Randy. Cc: Alexander Shishkin Cc: Michal Marek Cc: Randy Dunlap Cc: Stephen Hemminger Cc: WANG Cong Signed-off-by: Andrew Morton Signed-off-by: Michal Marek --- scripts/headers_check.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl index e0e25a1c2c12..7957e7a5166a 100644 --- a/scripts/headers_check.pl +++ b/scripts/headers_check.pl @@ -66,8 +66,8 @@ sub check_declarations { if ($line =~m/^(\s*extern|unsigned|char|short|int|long|void)\b/) { printf STDERR "$filename:$lineno: " . - "userspace cannot call function or variable " . - "defined in the kernel\n"; + "userspace cannot reference function or " . + "variable defined in the kernel\n"; } } -- cgit v1.2.3 From f0a6332ce221614fbd0731af92f668892fa4b700 Mon Sep 17 00:00:00 2001 From: Jonas Aaberg Date: Wed, 15 Dec 2010 08:37:00 +0100 Subject: kbuild: add numeric --set-val option to scripts/config Add new option to scripts/config for changing .config numeric values Acked-by: Linus Walleij Signed-off-by: Jonas Aaberg Signed-off-by: Michal Marek --- scripts/config | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/config b/scripts/config index dfd4732f7099..a7c7c4b8e957 100755 --- a/scripts/config +++ b/scripts/config @@ -10,8 +10,10 @@ commands: --enable|-e option Enable option --disable|-d option Disable option --module|-m option Turn option into a module - --set-str option value - Set option to "value" + --set-str option string + Set option to "string" + --set-val option value + Set option to value --state|-s option Print state of option (n,y,m,undef) --enable-after|-E beforeopt option @@ -109,6 +111,11 @@ while [ "$1" != "" ] ; do shift ;; + --set-val) + set_var "CONFIG_$ARG" "CONFIG_$ARG=$1" + shift + ;; + --state|-s) if grep -q "# CONFIG_$ARG is not set" $FN ; then echo n -- cgit v1.2.3