linux/drivers/staging/iio
Somya Anand dc6ed26dc3 Staging: iio: use !x instead of x == NULL
Functions like devm_kzalloc, kmalloc_array, devm_ioremap,
usb_alloc_urb, alloc_netdev return NULL as a return value on failure.
Generally, When NULL represents failure, !x is commonly used.

This patch cleans up the tests on the results of these functions, thereby
using !x instead of x == NULL or NULL == x. This is done via following
coccinelle script:
@prob_7@
identifier x;
statement S;
@@

(
 x = devm_kzalloc(...);
|
 x = usb_alloc_urb(...);
|
 x = kmalloc_array(...);
|
 x = devm_ioremap(...);
|
 x = alloc_netdev(...);
)
 ...
- if(NULL == x)
+ if(!x)
        S
Further we have used isomorphism characteristics of coccinelle to
indicate x == NULL and NULL == x are equivalent. This is done via
following iso script.

Expression
@ is_null @ expression X; @@
X == NULL <=> NULL == X

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 16:14:35 +01:00
..
accel Staging: iio: Remove parentheses around right side an assignment 2015-03-16 16:10:08 +01:00
adc staging: iio: Use kcalloc instead of kzalloc. 2015-03-15 18:41:09 +01:00
addac staging: iio: addac: annotate Kconfig entries with module name information 2014-10-20 10:29:08 +08:00
cdc staging: iio: cdc: Don't put an else right after a return 2014-09-19 17:49:39 -07:00
Documentation Staging: iio: Added define guards where needed 2015-03-06 09:54:33 -08:00
frequency Staging: iio: Use braces on all arms of if statement 2015-03-16 16:14:05 +01:00
gyro Staging: iio: gyro: Added description for config symbol. 2014-10-20 10:29:08 +08:00
impedance-analyzer staging: iio: ad5933: fix format string warnings 2015-01-25 22:55:34 +00:00
light Staging: iio: Remove parentheses around right side an assignment 2015-03-16 16:10:08 +01:00
magnetometer staging: iio: hmc5843: Set iio name property in sysfs 2015-03-06 17:06:30 -08:00
meter Staging: iio: Simplify return logic 2015-03-16 16:11:40 +01:00
resolver Merge 4.0-rc3 into staging-next 2015-03-09 08:13:01 +01:00
trigger Staging: iio: use !x instead of x == NULL 2015-03-16 16:14:35 +01:00
iio_dummy_evgen.c iio: dummy: Add virtual registers for dummy device 2014-11-22 11:05:44 +00:00
iio_dummy_evgen.h iio: dummy: Add virtual registers for dummy device 2014-11-22 11:05:44 +00:00
iio_simple_dummy_buffer.c iio: kfifo: Remove unused argument in iio_kfifo_allocate 2014-12-26 11:20:38 +00:00
iio_simple_dummy_events.c iio: core: Remove IIO_EV_TYPE_INSTANCE 2015-01-27 18:49:55 +00:00
iio_simple_dummy.c staging: Remove <linux/moduleparam.h> header. 2015-03-01 17:09:52 -08:00
iio_simple_dummy.h staging: iio: dummy: fix compile error when not using buffering 2015-01-01 12:20:52 +00:00
Kconfig kconfig: use bool instead of boolean for type definition attributes 2015-01-07 13:08:04 +01:00
Makefile
ring_hw.h staging: iio: Add #include guards to header files 2014-09-28 22:19:04 -04:00
TODO