summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorAishwarya Pant <aishpant@gmail.com>2017-10-17 15:14:09 +0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2017-10-27 17:33:39 +0200
commitbbae615636155fa43a9b0fe0ea31c678984be864 (patch)
treeaadaef5afb9470e55d21f1762e995e64eca306a8 /drivers/media/rc
parent1f709713cbd70efe85e76d9e9453606c6cc4bf82 (diff)
downloadop-kernel-dev-bbae615636155fa43a9b0fe0ea31c678984be864.zip
op-kernel-dev-bbae615636155fa43a9b0fe0ea31c678984be864.tar.gz
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 <aishpant@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/rc')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud