From 2c2b913d19e149bf7c4ae5f62634fc3b46a06306 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Wed, 4 Mar 2015 09:32:32 +0100 Subject: irqf_oneshot.cocci: add check of devm_request_threaded_irq() Since commit 1c6c69525b40eb76de8adf039409722015927dc3 ("genirq: Reject bogus threaded irq requests") threaded IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise the request will fail. Until now, this coccinelle script only checked request_threaded_irq(). However, the counterpart devm function (see kernel/irq/devres.c) is also affected by the missing flag which can be detected with this patch. Signed-off-by: Valentin Rothberg Signed-off-by: Peter Senna Tschudin Acked-by: Julia Lawall Signed-off-by: Michal Marek --- scripts/coccinelle/misc/irqf_oneshot.cocci | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'scripts') diff --git a/scripts/coccinelle/misc/irqf_oneshot.cocci b/scripts/coccinelle/misc/irqf_oneshot.cocci index 6cfde94be0ef..a24a754ae1d7 100644 --- a/scripts/coccinelle/misc/irqf_oneshot.cocci +++ b/scripts/coccinelle/misc/irqf_oneshot.cocci @@ -12,11 +12,13 @@ virtual org virtual report @r1@ +expression dev; expression irq; expression thread_fn; expression flags; position p; @@ +( request_threaded_irq@p(irq, NULL, thread_fn, ( flags | IRQF_ONESHOT @@ -24,13 +26,24 @@ flags | IRQF_ONESHOT IRQF_ONESHOT ) , ...) +| +devm_request_threaded_irq@p(dev, irq, NULL, thread_fn, +( +flags | IRQF_ONESHOT +| +IRQF_ONESHOT +) +, ...) +) @depends on patch@ +expression dev; expression irq; expression thread_fn; expression flags; position p != r1.p; @@ +( request_threaded_irq@p(irq, NULL, thread_fn, ( -0 @@ -40,6 +53,17 @@ request_threaded_irq@p(irq, NULL, thread_fn, +flags | IRQF_ONESHOT ) , ...) +| +devm_request_threaded_irq@p(dev, irq, NULL, thread_fn, +( +-0 ++IRQF_ONESHOT +| +-flags ++flags | IRQF_ONESHOT +) +, ...) +) @depends on context@ position p != r1.p; -- cgit v1.2.3 From 99b2cdde83726a89daadbfd1264fb9a3b91eed0b Mon Sep 17 00:00:00 2001 From: Alex Pilon Date: Tue, 14 Apr 2015 00:38:33 -0400 Subject: scripts/extract-ikconfig: Support LZ4-compressed images. Support for kernel image LZ4 compression was added around 3.11, but not the corresponding kernel .config extraction. This makes possible extracting the kernel config for LZ4-compressed kernels you're not running, or the current LZ4-compressed kernel if compiled without /proc/config.gz support. Signed-off-by: Alex Pilon Signed-off-by: Michal Marek --- scripts/extract-ikconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/extract-ikconfig b/scripts/extract-ikconfig index e1862429ccda..3b42f255e2ba 100755 --- a/scripts/extract-ikconfig +++ b/scripts/extract-ikconfig @@ -61,6 +61,7 @@ try_decompress '\3757zXZ\000' abcde unxz try_decompress 'BZh' xy bunzip2 try_decompress '\135\0\0\0' xxx unlzma try_decompress '\211\114\132' xy 'lzop -d' +try_decompress '\002\041\114\030' xyy 'lz4 -d -l' # Bail out: echo "$me: Cannot find kernel config." >&2 -- cgit v1.2.3 From 33236415ece63d5689411f3ddb676eeb93af2698 Mon Sep 17 00:00:00 2001 From: Fabian Frederick Date: Thu, 9 Apr 2015 22:58:04 +0200 Subject: scripts/coccinelle/misc/bugon.cocci: update bug_on conversion warning if()/BUG conversion to BUG_ON must be avoided when there's side effect in condition. The reason being BUG_ON won't execute the condition when CONFIG_BUG is not defined. Inspired-by: J. Bruce Fields Suggested-by: Julia Lawall Acked-by: Julia Lawall Signed-off-by: Fabian Frederick Signed-off-by: Michal Marek --- scripts/coccinelle/misc/bugon.cocci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/coccinelle/misc/bugon.cocci b/scripts/coccinelle/misc/bugon.cocci index 3b7eec24fb5a..27c97f1f2767 100644 --- a/scripts/coccinelle/misc/bugon.cocci +++ b/scripts/coccinelle/misc/bugon.cocci @@ -57,6 +57,6 @@ coccilib.org.print_todo(p[0], "WARNING use BUG_ON") p << r.p; @@ -msg="WARNING: Use BUG_ON" +msg="WARNING: Use BUG_ON instead of if condition followed by BUG.\nPlease make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h)" coccilib.report.print_report(p[0], msg) -- cgit v1.2.3