public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: kernel test robot <lkp@intel.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>, <llvm@lists.linux.dev>,
	<oe-kbuild-all@lists.linux.dev>, <linux-iio@vger.kernel.org>
Subject: Re: [jic23-iio:testing 107/107] drivers/iio/adc/ti-ads1298.c:653:29: warning: variable 'ret' is uninitialized when used here
Date: Mon, 19 Feb 2024 09:33:10 +0000	[thread overview]
Message-ID: <20240219093310.00005d3e@Huawei.com> (raw)
In-Reply-To: <202402171104.pciYOoXE-lkp@intel.com>

> >> drivers/iio/adc/ti-ads1298.c:653:29: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]  
>      653 |                 return dev_err_probe(dev, ret, "Cannot get reset GPIO\n");
>          |                                           ^~~
>    drivers/iio/adc/ti-ads1298.c:642:9: note: initialize the variable 'ret' to silence this warning
>      642 |         int ret;
>          |                ^
>          |                 = 0
>    7 warnings generated.
> 

This is the only one that matters I think,

> 
> vim +/ret +653 drivers/iio/adc/ti-ads1298.c
> 
>    635	
>    636	static int ads1298_probe(struct spi_device *spi)
>    637	{
>    638		struct ads1298_private *priv;
>    639		struct iio_dev *indio_dev;
>    640		struct device *dev = &spi->dev;
>    641		struct gpio_desc *reset_gpio;
>    642		int ret;
>    643	
>    644		indio_dev = devm_iio_device_alloc(dev, sizeof(*priv));
>    645		if (!indio_dev)
>    646			return -ENOMEM;
>    647	
>    648		priv = iio_priv(indio_dev);
>    649	
>    650		/* Reset to be asserted before enabling clock and power */
>    651		reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
>    652		if (IS_ERR(reset_gpio))
>  > 653			return dev_err_probe(dev, ret, "Cannot get reset GPIO\n");  
Should be PTR_ERR(reset_gpio)

I'll fix it up when I'm on the right machine.


>    654	
>    655		/* VREF can be supplied externally, otherwise use internal reference */
>    656		priv->reg_vref = devm_regulator_get_optional(dev, "vref");
>    657		if (IS_ERR(priv->reg_vref)) {
>    658			if (PTR_ERR(priv->reg_vref) != -ENODEV)
>    659				return dev_err_probe(dev, PTR_ERR(priv->reg_avdd),
>    660						     "Failed to get vref regulator\n");
>    661	
>    662			priv->reg_vref = NULL;
>    663		} else {
>    664			ret = regulator_enable(priv->reg_vref);
>    665			if (ret)
>    666				return ret;
>    667	
>    668			ret = devm_add_action_or_reset(dev, ads1298_reg_disable, priv->reg_vref);
>    669			if (ret)
>    670				return ret;
>    671		}

Thanks as ever is due to the 0-day team! Should have gotten this in my local tests, but
maybe I wasn't paying enough attention to the results :(


Jonathan



      reply	other threads:[~2024-02-19  9:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-17  3:41 [jic23-iio:testing 107/107] drivers/iio/adc/ti-ads1298.c:653:29: warning: variable 'ret' is uninitialized when used here kernel test robot
2024-02-19  9:33 ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240219093310.00005d3e@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=mike.looijmans@topic.nl \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox