Re: [Outreachy kernel] [PATCH] Staging: irda: Use !x instead of NULL comparison

2017-09-16 Thread Julia Lawall
On Sat, 16 Sep 2017, Srishti Sharma wrote: > Test for NULL as !x where functions that return NULL on failure > are used. Done using the following semantic patch by coccinelle. > > @ is_null @ > expression E; > statement S; > @@ > > E = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\| > us

[PATCH] Staging: irda: Use !x instead of NULL comparison

2017-09-15 Thread Srishti Sharma
Test for NULL as !x where functions that return NULL on failure are used. Done using the following semantic patch by coccinelle. @ is_null @ expression E; statement S; @@ E = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\| usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\)(...)); ( if(!E) S