Staging: iio: Simplify NULL pointer condition
authorCristina Opriceana <cristina.opriceana@gmail.com>
Thu, 19 Mar 2015 19:04:42 +0000 (21:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Mar 2015 12:33:50 +0000 (13:33 +0100)
Replace NULL comparrison with its shorter form.
Done with coccinelle:

@replace_rule@
expression e;
@@

-e == NULL
+ !e

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/magnetometer/hmc5843_core.c

index 90cc18b703cf67ae6c089c36d51d8ebde6f28106..6befa6f8b2e0d1b23992adb0b92195ca845415a2 100644 (file)
@@ -579,7 +579,7 @@ int hmc5843_common_probe(struct device *dev, struct regmap *regmap,
        int ret;
 
        indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
-       if (indio_dev == NULL)
+       if (!indio_dev)
                return -ENOMEM;
 
        dev_set_drvdata(dev, indio_dev);