Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: iio: adc: Remove explicit NULL comparison

This patch removes explicit NULL comparison and writes it in its
shorter form. Detected with coccinelle.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Cristina Opriceana and committed by
Greg Kroah-Hartman
d3f31e87 16d55be4

+2 -2
+1 -1
drivers/staging/iio/adc/ad7606_ring.c
··· 50 50 int ret; 51 51 52 52 buf = kzalloc(indio_dev->scan_bytes, GFP_KERNEL); 53 - if (buf == NULL) 53 + if (!buf) 54 54 return; 55 55 56 56 if (gpio_is_valid(st->pdata->gpio_frstdata)) {
+1 -1
drivers/staging/iio/adc/ad7780.c
··· 169 169 int ret, voltage_uv = 0; 170 170 171 171 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); 172 - if (indio_dev == NULL) 172 + if (!indio_dev) 173 173 return -ENOMEM; 174 174 175 175 st = iio_priv(indio_dev);