Skip to content

Commit

Permalink
coccinelle: put_device: Add a cast to an expression for an assignment
Browse files Browse the repository at this point in the history
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 <[email protected]>
Suggested-by: Julia Lawall <[email protected]>
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 <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
elfring authored and masahir0y committed Jul 7, 2019
1 parent 30a70e8 commit f58c17c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/coccinelle/free/put_device.cocci
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (id == NULL || ...) { ... return ...; }
when != of_dev_put(id)
when != if (id) { ... put_device(&id->dev) ... }
when != e1 = (T)id
when != e1 = &id->dev
when != e1 = (T)(&id->dev)
when != e1 = get_device(&id->dev)
when != e1 = (T1)platform_get_drvdata(id)
(
Expand Down

0 comments on commit f58c17c

Please sign in to comment.