diff options
| author | Aishwarya Pant <[email protected]> | 2017-10-17 15:14:09 +0200 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2017-10-27 17:33:39 +0200 |
| commit | bbae615636155fa43a9b0fe0ea31c678984be864 (patch) | |
| tree | aadaef5afb9470e55d21f1762e995e64eca306a8 /tools/perf/scripts/python | |
| parent | 1f709713cbd70efe85e76d9e9453606c6cc4bf82 (diff) | |
media: staging: atomisp2: cleanup null check on memory allocation
For memory allocation functions that fail with a NULL return value, it
is preferred to use the (!x) test in place of (x == NULL).
Changes in atomisp2/css2400/sh_css.c were done by hand.
Done with the help of the following cocci script:
@@
type T;
T* p;
statement s,s1;
@@
p =
\(devm_kzalloc\|devm_ioremap\|usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\|
kmalloc\|kmalloc_array\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\|
kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|devm_kzalloc\)(...)
...when != p
if (
- p == NULL
+ !p
) s
else s1
--
Changes in v3:
Rebase changes over atomisp-next branch of the media tree
Changes in atomisp2/css2400/sh_css.c were done by hand, the above script
was not able to match the pattern if (a->b != null).
Signed-off-by: Aishwarya Pant <[email protected]>
Acked-by: Julia Lawall <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions