]> git.baikalelectronics.ru Git - kernel.git/commit
staging: speakup: Clean up tests if NULL returned on failure
authorsimran singhal <singhalsimran0@gmail.com>
Sat, 4 Mar 2017 16:46:54 +0000 (22:16 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Mar 2017 13:27:13 +0000 (14:27 +0100)
commite771ef23ae98ddf0dac13d8cc797e47b91033881
treeb5789f805b98b5799251a05e81394f235c71b841
parentbe6c0d9988e0c6748d15c64a21433742f354ffb6
staging: speakup: 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>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/speakup/main.c