staging: lirc_zilog: Clean up tests if NULL returned on failure
authorsimran singhal <singhalsimran0@gmail.com>
Fri, 10 Mar 2017 05:13:12 +0000 (10:43 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Mar 2017 13:57:00 +0000 (14:57 +0100)
commit1e8b15d06a0ec40180134736aad3674137cad4d9
tree548a876b0d4bf2a210a00ef9c3b9e96b3cf89932
parent49637a458b61629672a8ae19fdae2058c64815cf
staging: lirc_zilog: Clean up tests if NULL returned on failure

Some functions like kmalloc/kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:
@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/lirc/lirc_zilog.c