[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240914174815.4084f90f@jic23-huawei>
Date: Sat, 14 Sep 2024 17:48:15 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: kernel test robot <lkp@...el.com>
Cc: Ramona Alexandra Nechita <ramona.nechita@...log.com>, Lars-Peter Clausen
<lars@...afoo.de>, Cosmin Tanislav <cosmin.tanislav@...log.com>, Michael
Hennerich <Michael.Hennerich@...log.com>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Nuno Sa <nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>, David
Lechner <dlechner@...libre.com>, Marcelo Schmitt
<marcelo.schmitt@...log.com>, Olivier Moysan <olivier.moysan@...s.st.com>,
Dumitru Ceclan <mitrutzceclan@...il.com>, Matteo Martelli
<matteomartelli3@...il.com>, AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>, Alisa-Dariana Roman
<alisadariana@...il.com>, Ivan Mikhaylov <fr0st61te@...il.com>, Mike
Looijmans <mike.looijmans@...ic.nl>, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev
Subject: Re: [PATCH v5 3/3] drivers: iio: adc: add support for ad777x family
skip "nr_"
> | ~~~~~~~~~~~ ^ ~~~
> >> drivers/iio/adc/ad7779.c:748:35: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
> 748 | return dev_err_probe(&spi->dev, ret,
> | ^~~
> drivers/iio/adc/ad7779.c:735:9: note: initialize the variable 'ret' to silence this warning
> 735 | int ret;
> | ^
> | = 0
Definitely don't do that!
just replace ret with -EINVAL
Jonathan
> 8 warnings generated.
>
>
> vim +/ret +748 drivers/iio/adc/ad7779.c
>
> 729
> 730 static int ad7779_probe(struct spi_device *spi)
> 731 {
> 732 struct iio_dev *indio_dev;
> 733 struct ad7779_state *st;
> 734 struct gpio_desc *reset_gpio, *start_gpio;
> 735 int ret;
> 736
> 737 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
> 738 if (!indio_dev)
> 739 return -ENOMEM;
> 740
> 741 st = iio_priv(indio_dev);
> 742
> 743 st->mclk = devm_clk_get_enabled(&spi->dev, "mclk");
> 744 if (IS_ERR(st->mclk))
> 745 return PTR_ERR(st->mclk);
> 746
> 747 if (!spi->irq)
> > 748 return dev_err_probe(&spi->dev, ret,
> 749 "DRDY irq not present\n");
> 750
Powered by blists - more mailing lists