forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/…
…mmarek/kbuild Pull misc kbuild changes from Michal Marek: "This is the non-critical part of kbuild for v3.6-rc1: - Two new coccinelle semantic patches - New scripts/tags.sh regexp - scripts/config improvements that I mistakenly applied here instead of in the kconfig branch (but there are no conflicts) - Debian packaging fixes" * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: scripts/tags.sh: Teach [ce]tags about libtraceeevent error codes scripts/coccinelle: list iterator variable semantic patch scripts/coccinelle: Find threaded IRQs requests which are missing IRQF_ONESHOT deb-pkg: Add all Makefiles to header package deb-pkg: Install linux-firmware-image in versioned dir scripts/config: add option to undef a symbol scripts/config: allow alternate prefix to config option symbol scripts/config: add option to not upper-case symbols
- Loading branch information
Showing
5 changed files
with
264 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
/// If list_for_each_entry, etc complete a traversal of the list, the iterator | ||
/// variable ends up pointing to an address at an offset from the list head, | ||
/// and not a meaningful structure. Thus this value should not be used after | ||
/// the end of the iterator. | ||
//#False positives arise when there is a goto in the iterator and the | ||
//#reported reference is at the label of this goto. Some flag tests | ||
//#may also cause a report to be a false positive. | ||
/// | ||
// Confidence: Moderate | ||
// Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2. | ||
// Copyright: (C) 2012 Gilles Muller, INRIA/LIP6. GPLv2. | ||
// URL: http://coccinelle.lip6.fr/ | ||
// Comments: | ||
// Options: -no_includes -include_headers | ||
|
||
virtual context | ||
virtual org | ||
virtual report | ||
|
||
@r exists@ | ||
identifier c,member; | ||
expression E,x; | ||
iterator name list_for_each_entry; | ||
iterator name list_for_each_entry_reverse; | ||
iterator name list_for_each_entry_continue; | ||
iterator name list_for_each_entry_continue_reverse; | ||
iterator name list_for_each_entry_from; | ||
iterator name list_for_each_entry_safe; | ||
iterator name list_for_each_entry_safe_continue; | ||
iterator name list_for_each_entry_safe_from; | ||
iterator name list_for_each_entry_safe_reverse; | ||
iterator name hlist_for_each_entry; | ||
iterator name hlist_for_each_entry_continue; | ||
iterator name hlist_for_each_entry_from; | ||
iterator name hlist_for_each_entry_safe; | ||
statement S; | ||
position p1,p2; | ||
@@ | ||
|
||
( | ||
list_for_each_entry@p1(c,...,member) { ... when != break; | ||
when forall | ||
when strict | ||
} | ||
| | ||
list_for_each_entry_reverse@p1(c,...,member) { ... when != break; | ||
when forall | ||
when strict | ||
} | ||
| | ||
list_for_each_entry_continue@p1(c,...,member) { ... when != break; | ||
when forall | ||
when strict | ||
} | ||
| | ||
list_for_each_entry_continue_reverse@p1(c,...,member) { ... when != break; | ||
when forall | ||
when strict | ||
} | ||
| | ||
list_for_each_entry_from@p1(c,...,member) { ... when != break; | ||
when forall | ||
when strict | ||
} | ||
| | ||
list_for_each_entry_safe@p1(c,...,member) { ... when != break; | ||
when forall | ||
when strict | ||
} | ||
| | ||
list_for_each_entry_safe_continue@p1(c,...,member) { ... when != break; | ||
when forall | ||
when strict | ||
} | ||
| | ||
list_for_each_entry_safe_from@p1(c,...,member) { ... when != break; | ||
when forall | ||
when strict | ||
} | ||
| | ||
list_for_each_entry_safe_reverse@p1(c,...,member) { ... when != break; | ||
when forall | ||
when strict | ||
} | ||
) | ||
... | ||
( | ||
list_for_each_entry(c,...) S | ||
| | ||
list_for_each_entry_reverse(c,...) S | ||
| | ||
list_for_each_entry_continue(c,...) S | ||
| | ||
list_for_each_entry_continue_reverse(c,...) S | ||
| | ||
list_for_each_entry_from(c,...) S | ||
| | ||
list_for_each_entry_safe(c,...) S | ||
| | ||
list_for_each_entry_safe(x,c,...) S | ||
| | ||
list_for_each_entry_safe_continue(c,...) S | ||
| | ||
list_for_each_entry_safe_continue(x,c,...) S | ||
| | ||
list_for_each_entry_safe_from(c,...) S | ||
| | ||
list_for_each_entry_safe_from(x,c,...) S | ||
| | ||
list_for_each_entry_safe_reverse(c,...) S | ||
| | ||
list_for_each_entry_safe_reverse(x,c,...) S | ||
| | ||
hlist_for_each_entry(c,...) S | ||
| | ||
hlist_for_each_entry_continue(c,...) S | ||
| | ||
hlist_for_each_entry_from(c,...) S | ||
| | ||
hlist_for_each_entry_safe(c,...) S | ||
| | ||
list_remove_head(x,c,...) | ||
| | ||
sizeof(<+...c...+>) | ||
| | ||
&c->member | ||
| | ||
c = E | ||
| | ||
*c@p2 | ||
) | ||
|
||
@script:python depends on org@ | ||
p1 << r.p1; | ||
p2 << r.p2; | ||
@@ | ||
cocci.print_main("invalid iterator index reference",p2) | ||
cocci.print_secs("iterator",p1) | ||
@script:python depends on report@ | ||
p1 << r.p1; | ||
p2 << r.p2; | ||
@@ | ||
msg = "ERROR: invalid reference to the index variable of the iterator on line %s" % (p1[0].line) | ||
coccilib.report.print_report(p2[0], msg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/// Make sure threaded IRQs without a primary handler are always request with | ||
/// IRQF_ONESHOT | ||
/// | ||
// | ||
// Confidence: Good | ||
// Comments: | ||
// Options: --no-includes | ||
|
||
virtual patch | ||
virtual context | ||
virtual org | ||
virtual report | ||
|
||
@r1@ | ||
expression irq; | ||
expression thread_fn; | ||
expression flags; | ||
position p; | ||
@@ | ||
request_threaded_irq@p(irq, NULL, thread_fn, | ||
( | ||
flags | IRQF_ONESHOT | ||
| | ||
IRQF_ONESHOT | ||
) | ||
, ...) | ||
|
||
@depends on patch@ | ||
expression irq; | ||
expression thread_fn; | ||
expression flags; | ||
position p != r1.p; | ||
@@ | ||
request_threaded_irq@p(irq, NULL, thread_fn, | ||
( | ||
-0 | ||
+IRQF_ONESHOT | ||
| | ||
-flags | ||
+flags | IRQF_ONESHOT | ||
) | ||
, ...) | ||
|
||
@depends on context@ | ||
position p != r1.p; | ||
@@ | ||
*request_threaded_irq@p(...) | ||
|
||
@match depends on report || org@ | ||
expression irq; | ||
position p != r1.p; | ||
@@ | ||
request_threaded_irq@p(irq, NULL, ...) | ||
|
||
@script:python depends on org@ | ||
p << match.p; | ||
@@ | ||
msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT" | ||
coccilib.org.print_todo(p[0],msg) | ||
@script:python depends on report@ | ||
p << match.p; | ||
@@ | ||
msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT" | ||
coccilib.report.print_report(p[0],msg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.