diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-30 21:14:05 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-30 21:14:05 -0400 |
| commit | a7697b945e6e5025f184d6762e7285f1c498411d (patch) | |
| tree | 3cf6ddd963c454cbadc581c8160e560894fdb2a1 /scripts | |
| parent | 2b17b4382c4bcb1952e9c6953284044970a274f3 (diff) | |
| parent | 354fa22fce767ac137099c8009a411bd0499816c (diff) | |
Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull non-critical part of kbuild from Michal Marek:
- New semantic patches, make coccicheck M= fix
- make gtags speedup
- make tags/TAGS always removes struct forward declarations
- make deb-pkg fixes (some patches are still pending, I know)
- scripts/patch-kernel fix from the last user of this script ;)
* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
scripts/patch-kernel: digest kernel.org hosted .xz patches
scripts/coccinelle/api/ptr_ret.cocci: semantic patch for ptr_err
scripts: refactor remove structure forward declarations
kbuild: incremental tags update for GNU Global
coccinelle: semantic patch for bool issues
coccinelle: semantic patch to check for PTR_ERR after reassignment
coccinelle: semantic patch converting 0 test to null test
coccinelle: semantic patch for missing iounmap
coccinelle: semantic patch for missing clk_put
kbuild: Fix out-of-tree build for 'make deb-pkg'
kbuild: Only build linux-image package for UML
kbuild: Fix link to headers in 'make deb-pkg'
coccicheck: change handling of C={1,2} when M= is set
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/coccinelle/api/ptr_ret.cocci | 70 | ||||
| -rw-r--r-- | scripts/coccinelle/free/clk_put.cocci | 67 | ||||
| -rw-r--r-- | scripts/coccinelle/free/iounmap.cocci | 67 | ||||
| -rw-r--r-- | scripts/coccinelle/misc/boolinit.cocci | 178 | ||||
| -rw-r--r-- | scripts/coccinelle/misc/cstptr.cocci | 41 | ||||
| -rw-r--r-- | scripts/coccinelle/null/badzero.cocci | 237 | ||||
| -rw-r--r-- | scripts/package/builddeb | 20 | ||||
| -rwxr-xr-x | scripts/patch-kernel | 4 | ||||
| -rwxr-xr-x | scripts/tags.sh | 13 |
9 files changed, 687 insertions, 10 deletions
diff --git a/scripts/coccinelle/api/ptr_ret.cocci b/scripts/coccinelle/api/ptr_ret.cocci new file mode 100644 index 000000000000..cbfd08c7d8c7 --- /dev/null +++ b/scripts/coccinelle/api/ptr_ret.cocci | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | /// | ||
| 2 | /// Use PTR_RET rather than if(IS_ERR(...)) + PTR_ERR | ||
| 3 | /// | ||
| 4 | // Confidence: High | ||
| 5 | // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2. | ||
| 6 | // Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2. | ||
| 7 | // URL: http://coccinelle.lip6.fr/ | ||
| 8 | // Options: -no_includes -include_headers | ||
| 9 | // | ||
| 10 | // Keywords: ERR_PTR, PTR_ERR, PTR_RET | ||
| 11 | // Version min: 2.6.39 | ||
| 12 | // | ||
| 13 | |||
| 14 | virtual context | ||
| 15 | virtual patch | ||
| 16 | virtual org | ||
| 17 | virtual report | ||
| 18 | |||
| 19 | @depends on patch@ | ||
| 20 | expression ptr; | ||
| 21 | @@ | ||
| 22 | |||
| 23 | - if (IS_ERR(ptr)) return PTR_ERR(ptr); else return 0; | ||
| 24 | + return PTR_RET(ptr); | ||
| 25 | |||
| 26 | @depends on patch@ | ||
| 27 | expression ptr; | ||
| 28 | @@ | ||
| 29 | |||
| 30 | - if (IS_ERR(ptr)) return PTR_ERR(ptr); return 0; | ||
| 31 | + return PTR_RET(ptr); | ||
| 32 | |||
| 33 | @r1 depends on !patch@ | ||
| 34 | expression ptr; | ||
| 35 | position p1; | ||
| 36 | @@ | ||
| 37 | |||
| 38 | * if@p1 (IS_ERR(ptr)) return PTR_ERR(ptr); else return 0; | ||
| 39 | |||
| 40 | @r2 depends on !patch@ | ||
| 41 | expression ptr; | ||
| 42 | position p2; | ||
| 43 | @@ | ||
| 44 | |||
| 45 | * if@p2 (IS_ERR(ptr)) return PTR_ERR(ptr); return 0; | ||
| 46 | |||
| 47 | @script:python depends on org@ | ||
| 48 | p << r1.p1; | ||
| 49 | @@ | ||
| 50 | |||
| 51 | coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used") | ||
| 52 | |||
| 53 | |||
| 54 | @script:python depends on org@ | ||
| 55 | p << r2.p2; | ||
| 56 | @@ | ||
| 57 | |||
| 58 | coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used") | ||
| 59 | |||
| 60 | @script:python depends on report@ | ||
| 61 | p << r1.p1; | ||
| 62 | @@ | ||
| 63 | |||
| 64 | coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used") | ||
| 65 | |||
| 66 | @script:python depends on report@ | ||
| 67 | p << r2.p2; | ||
| 68 | @@ | ||
| 69 | |||
| 70 | coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used") | ||
diff --git a/scripts/coccinelle/free/clk_put.cocci b/scripts/coccinelle/free/clk_put.cocci new file mode 100644 index 000000000000..46747adfd20a --- /dev/null +++ b/scripts/coccinelle/free/clk_put.cocci | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | /// Find missing clk_puts. | ||
| 2 | /// | ||
| 3 | //# This only signals a missing clk_put when there is a clk_put later | ||
| 4 | //# in the same function. | ||
| 5 | //# False positives can be due to loops. | ||
| 6 | // | ||
| 7 | // Confidence: Moderate | ||
| 8 | // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2. | ||
| 9 | // Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2. | ||
| 10 | // URL: http://coccinelle.lip6.fr/ | ||
| 11 | // Comments: | ||
| 12 | // Options: | ||
| 13 | |||
| 14 | virtual context | ||
| 15 | virtual org | ||
| 16 | virtual report | ||
| 17 | |||
| 18 | @clk@ | ||
| 19 | expression e; | ||
| 20 | statement S,S1; | ||
| 21 | int ret; | ||
| 22 | position p1,p2,p3; | ||
| 23 | @@ | ||
| 24 | |||
| 25 | e = clk_get@p1(...) | ||
| 26 | ... when != clk_put(e) | ||
| 27 | if (<+...e...+>) S | ||
| 28 | ... when any | ||
| 29 | when != clk_put(e) | ||
| 30 | when != if (...) { ... clk_put(e); ... } | ||
| 31 | ( | ||
| 32 | if (ret == 0) S1 | ||
| 33 | | | ||
| 34 | if (...) | ||
| 35 | { ... | ||
| 36 | return 0; } | ||
| 37 | | | ||
| 38 | if (...) | ||
| 39 | { ... | ||
| 40 | return <+...e...+>; } | ||
| 41 | | | ||
| 42 | *if@p2 (...) | ||
| 43 | { ... when != clk_put(e) | ||
| 44 | when forall | ||
| 45 | return@p3 ...; } | ||
| 46 | ) | ||
| 47 | ... when any | ||
| 48 | clk_put(e); | ||
| 49 | |||
| 50 | @script:python depends on org@ | ||
| 51 | p1 << clk.p1; | ||
| 52 | p2 << clk.p2; | ||
| 53 | p3 << clk.p3; | ||
| 54 | @@ | ||
| 55 | |||
| 56 | cocci.print_main("clk_get",p1) | ||
| 57 | cocci.print_secs("if",p2) | ||
| 58 | cocci.print_secs("needed clk_put",p3) | ||
| 59 | |||
| 60 | @script:python depends on report@ | ||
| 61 | p1 << clk.p1; | ||
| 62 | p2 << clk.p2; | ||
| 63 | p3 << clk.p3; | ||
| 64 | @@ | ||
| 65 | |||
| 66 | msg = "ERROR: missing clk_put; clk_get on line %s and execution via conditional on line %s" % (p1[0].line,p2[0].line) | ||
| 67 | coccilib.report.print_report(p3[0],msg) | ||
diff --git a/scripts/coccinelle/free/iounmap.cocci b/scripts/coccinelle/free/iounmap.cocci new file mode 100644 index 000000000000..5384f4ba1192 --- /dev/null +++ b/scripts/coccinelle/free/iounmap.cocci | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | /// Find missing iounmaps. | ||
| 2 | /// | ||
| 3 | //# This only signals a missing iounmap when there is an iounmap later | ||
| 4 | //# in the same function. | ||
| 5 | //# False positives can be due to loops. | ||
| 6 | // | ||
| 7 | // Confidence: Moderate | ||
| 8 | // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2. | ||
| 9 | // Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2. | ||
| 10 | // URL: http://coccinelle.lip6.fr/ | ||
| 11 | // Comments: | ||
| 12 | // Options: | ||
| 13 | |||
| 14 | virtual context | ||
| 15 | virtual org | ||
| 16 | virtual report | ||
| 17 | |||
| 18 | @iom@ | ||
| 19 | expression e; | ||
| 20 | statement S,S1; | ||
| 21 | int ret; | ||
| 22 | position p1,p2,p3; | ||
| 23 | @@ | ||
| 24 | |||
| 25 | e = \(ioremap@p1\|ioremap_nocache@p1\)(...) | ||
| 26 | ... when != iounmap(e) | ||
| 27 | if (<+...e...+>) S | ||
| 28 | ... when any | ||
| 29 | when != iounmap(e) | ||
| 30 | when != if (...) { ... iounmap(e); ... } | ||
| 31 | ( | ||
| 32 | if (ret == 0) S1 | ||
| 33 | | | ||
| 34 | if (...) | ||
| 35 | { ... | ||
| 36 | return 0; } | ||
| 37 | | | ||
| 38 | if (...) | ||
| 39 | { ... | ||
| 40 | return <+...e...+>; } | ||
