1
0
Fork 0

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: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
hifive-unleashed-5.1
Julia Lawall 2015-10-26 22:28:25 +01:00 committed by Michal Marek
parent 41167d072b
commit ca047e715c
1 changed files with 7 additions and 11 deletions

View File

@ -16,19 +16,15 @@ virtual context
@r2 depends on patch@
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 @
@ -36,8 +32,8 @@ expression E;
position p;
@@
* if (E)
* \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb\)(E);
* if (E != NULL)
* \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb@p\)(E);
@script:python depends on org@
p << r.p;