mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Anton Gusev <aagusev@ispras.ru>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	lvc-project@linuxtesting.org
Subject: Re: [PATCH] power: supply: generic-adc-battery: remove redundant return code assignment
Date: Fri, 17 Mar 2023 20:40:32 +0100	[thread overview]
Message-ID: <20230317194032.widpyvv6f4dqapla@mercury.elektranox.org> (raw)
In-Reply-To: <20230317170007.25692-1-aagusev@ispras.ru>

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

Hi,

On Fri, Mar 17, 2023 at 08:00:07PM +0300, Anton Gusev wrote:
> Since any subsequent uses of ret reassign it first and PTR_ERR does not
> have any effect on its own, this line has no effect and can be removed.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Signed-off-by: Anton Gusev <aagusev@ispras.ru>
> ---

Thanks, but the correct thing to do is using ret, which is WIP:

https://lore.kernel.org/linux-pm/20230314225535.1321736-4-sre@kernel.org/T/#u

-- Sebastian

>  drivers/power/supply/generic-adc-battery.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/power/supply/generic-adc-battery.c b/drivers/power/supply/generic-adc-battery.c
> index 66039c665dd1..b51e5c4b36ff 100644
> --- a/drivers/power/supply/generic-adc-battery.c
> +++ b/drivers/power/supply/generic-adc-battery.c
> @@ -285,7 +285,6 @@ static int gab_probe(struct platform_device *pdev)
>  		adc_bat->channel[chan] = iio_channel_get(&pdev->dev,
>  							 gab_chan_name[chan]);
>  		if (IS_ERR(adc_bat->channel[chan])) {
> -			ret = PTR_ERR(adc_bat->channel[chan]);
>  			adc_bat->channel[chan] = NULL;
>  		} else {
>  			/* copying properties for supported channels only */
> -- 
> 2.39.2
> 

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

           reply	other threads:[~2023-03-17 19:40 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20230317170007.25692-1-aagusev@ispras.ru>]

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=20230317194032.widpyvv6f4dqapla@mercury.elektranox.org \
    --to=sebastian.reichel@collabora.com \
    --cc=aagusev@ispras.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    /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

all inboxes | Powered by JetHome®