提交 ca047e71 编写于 作者: J Julia Lawall 提交者: Michal Marek

coccinelle: ifnullfree: various cleanups

Adjust tests to compare against NULL, to match cases that explicitly make
that comparison.

Remove removal and re-addition of freeing functions.

Add position variable on usb_free_urb in the non-patch case.
Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: NMichal Marek <mmarek@suse.cz>
上级 41167d07
...@@ -16,19 +16,15 @@ virtual context ...@@ -16,19 +16,15 @@ virtual context
@r2 depends on patch@ @r2 depends on patch@
expression E; expression E;
@@ @@
- if (E) - if (E != NULL)
( (
- kfree(E); kfree(E);
+ kfree(E);
| |
- debugfs_remove(E); debugfs_remove(E);
+ debugfs_remove(E);
| |
- debugfs_remove_recursive(E); debugfs_remove_recursive(E);
+ debugfs_remove_recursive(E);
| |
- usb_free_urb(E); usb_free_urb(E);
+ usb_free_urb(E);
) )
@r depends on context || report || org @ @r depends on context || report || org @
...@@ -36,8 +32,8 @@ expression E; ...@@ -36,8 +32,8 @@ expression E;
position p; position p;
@@ @@
* if (E) * if (E != NULL)
* \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb\)(E); * \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb@p\)(E);
@script:python depends on org@ @script:python depends on org@
p << r.p; p << r.p;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册