public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Tony Lindgren <tony@atomide.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jerome Neanne <jneanne@baylibre.com>,
	Arnd Bergmann <arnd@arndb.de>, Axel Lin <axel.lin@ingics.com>,
	Yang Li <yang.lee@linux.alibaba.com>,
	Yang Yingliang <yangyingliang@huawei.com>,
	linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regulator: tps65219: fix Wextra warning
Date: Thu, 15 Dec 2022 16:48:08 +0000	[thread overview]
Message-ID: <Y5tPyOqSNud7LumS@sirena.org.uk> (raw)
In-Reply-To: <20221215164140.821796-1-arnd@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 627 bytes --]

On Thu, Dec 15, 2022 at 05:41:28PM +0100, Arnd Bergmann wrote:

> -		tps65219_get_rdev_by_name(irq_type->regulator_name, rdevtbl, rdev);
> -		if (rdev < 0) {
> +		error = tps65219_get_rdev_by_name(irq_type->regulator_name, rdevtbl, rdev);
> +		if (error) {
>  			dev_err(tps->dev, "Failed to get rdev for %s\n",
>  				irq_type->regulator_name);
> -			return -EINVAL;
> +			return error;

This will shut up the warning but is leaving the use of the
uninitialised rdev (which I'm kind of disappointed the static checkers
didn't pick up on).  rdev needs to be passed by reference into the
function, or set from the return value.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-12-15 16:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15 16:41 [PATCH] regulator: tps65219: fix Wextra warning Arnd Bergmann
2022-12-15 16:48 ` Mark Brown [this message]
2022-12-16 10:18   ` Arnd Bergmann
2023-01-19  8:07     ` Arnd Bergmann
2023-01-19 11:13       ` Mark Brown

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=Y5tPyOqSNud7LumS@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=axel.lin@ingics.com \
    --cc=jneanne@baylibre.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    --cc=yang.lee@linux.alibaba.com \
    --cc=yangyingliang@huawei.com \
    /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