Skip to content

Commit

Permalink
Staging: iio: trigger: Remove explicit NULL comparison
Browse files Browse the repository at this point in the history
This patch removes explicit NULL comparison and replaces it
with its shorter form. Detected with coccinelle.

Signed-off-by: Cristina Opriceana <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
cristina2689 authored and gregkh committed Apr 1, 2015
1 parent 4529757 commit e84d072
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}
Expand Down

0 comments on commit e84d072

Please sign in to comment.