From: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx> Treat separately the case where there is only one other statement in the branch, to be able to remove the outer {} as well. Signed-off-by: Julia Lawall <Julia.Lawall@xxxxxxx> --- scripts/coccinelle/api/platform_get_irq.cocci | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/coccinelle/api/platform_get_irq.cocci b/scripts/coccinelle/api/platform_get_irq.cocci index c6ac755..7ac32ee 100644 --- a/scripts/coccinelle/api/platform_get_irq.cocci +++ b/scripts/coccinelle/api/platform_get_irq.cocci @@ -31,6 +31,25 @@ if ( \( ret < 0 \| ret <= 0 \) ) @depends on patch@ expression ret; struct platform_device *E; +statement S; +@@ + +ret = +( +platform_get_irq +| +platform_get_irq_byname +)(E, ...); + +if ( \( ret < 0 \| ret <= 0 \) ) +-{ +-dev_err(...); +S +-} + +@depends on patch@ +expression ret; +struct platform_device *E; @@ ret =