staging: iio: trigger: Remove explicit comparisons
authorCristina Moraru <cristina.moraru09@gmail.com>
Tue, 20 Oct 2015 19:55:45 +0000 (22:55 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Oct 2015 02:32:09 +0000 (19:32 -0700)
Remove comparisons to 0 or NULL

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

index 9fe48ef11473c204fae7e8a3fb542ded85226eee..035dd456d7d67e085db527e10cefad20216f5fc1 100644 (file)
@@ -100,7 +100,7 @@ static ssize_t iio_bfin_tmr_frequency_store(struct device *dev,
        if (enabled)
                disable_gptimers(st->t->bit);
 
-       if (val == 0)
+       if (!val)
                return count;
 
        val = get_sclk() / val;
@@ -125,7 +125,7 @@ static ssize_t iio_bfin_tmr_frequency_show(struct device *dev,
        unsigned int period = get_gptimer_period(st->t->id);
        unsigned long val;
 
-       if (period == 0)
+       if (!period)
                val = 0;
        else
                val = get_sclk() / get_gptimer_period(st->t->id);
index 2db885750fb84384653a54ab97089c835f479dca..00d1393312614f06215ec3f2d37e7a03ec3dcb0c 100644 (file)
@@ -39,7 +39,7 @@ static int iio_trig_periodic_rtc_set_state(struct iio_trigger *trig, bool state)
        dev_dbg(&trig_info->rtc->dev, "trigger frequency is %u\n",
                trig_info->frequency);
        ret = rtc_irq_set_state(trig_info->rtc, &trig_info->task, state);
-       if (ret == 0)
+       if (!ret)
                trig_info->state = state;
 
        return ret;