Staging: iio: trigger: Remove explicit NULL comparison
authorCristina Opriceana <cristina.opriceana@gmail.com>
Tue, 31 Mar 2015 10:03:12 +0000 (13:03 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Apr 2015 15:23:20 +0000 (17:23 +0200)
This patch removes explicit NULL comparison and replaces it
with its shorter form. Detected with coccinelle.

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

index 89df1d32874dbcc15d6d1c9ffd933c701bbfd577..0c1976ddee7489c6d4165e3e4e01990e0b7952e3 100644 (file)
@@ -124,7 +124,7 @@ static int iio_trig_periodic_rtc_probe(struct platform_device *dev)
        int i, ret;
 
        for (i = 0;; i++) {
-               if (pdata[i] == NULL)
+               if (!pdata[i])
                        break;
                trig = iio_trigger_alloc("periodic%s", pdata[i]);
                if (!trig) {
@@ -142,7 +142,7 @@ static int iio_trig_periodic_rtc_probe(struct platform_device *dev)
                trig->ops = &iio_prtc_trigger_ops;
                /* RTC access */
                trig_info->rtc = rtc_class_open(pdata[i]);
-               if (trig_info->rtc == NULL) {
+               if (!trig_info->rtc) {
                        ret = -EINVAL;
                        goto error_free_trig_info;
                }