Skip to content

Commit f58c17c

Browse files
elfringmasahir0y
authored andcommitted
coccinelle: put_device: Add a cast to an expression for an assignment
Extend a when constraint in a SmPL rule so that an additional cast is optionally excluded from source code searches for an expression in assignments. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Suggested-by: Julia Lawall <Julia.Lawall@lip6.fr> Link: https://lore.kernel.org/lkml/alpine.DEB.2.21.1902160934400.3212@hadrien/ Link: https://systeme.lip6.fr/pipermail/cocci/2019-February/005592.html Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent 30a70e8 commit f58c17c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎scripts/coccinelle/free/put_device.cocci‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (id == NULL || ...) { ... return ...; }
2424
when != of_dev_put(id)
2525
when != if (id) { ... put_device(&id->dev) ... }
2626
when != e1 = (T)id
27-
when != e1 = &id->dev
27+
when != e1 = (T)(&id->dev)
2828
when != e1 = get_device(&id->dev)
2929
when != e1 = (T1)platform_get_drvdata(id)
3030
(

0 commit comments

Comments
 (0)