public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Tang Bin <tangbin@cmss.chinamobile.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mfd:asic3:Delete redundant variable definition
Date: Fri, 17 Apr 2020 10:27:05 +0100	[thread overview]
Message-ID: <20200417092705.GG2167633@dell> (raw)
In-Reply-To: <211e7521-639d-804c-f332-bfed0cf315df@cmss.chinamobile.com>

On Thu, 16 Apr 2020, Tang Bin wrote:

> Hi, Lee:
> 
> On 2020/4/16 15:08, Lee Jones wrote:
> > On Fri, 03 Apr 2020, Tang Bin wrote:
> > 
> > > In this function, 'ret' is always assigned, even if 'pdata->leds'
> > > don't carry out,it has already been assigned a value in the above
> > > code, including '0',so it's redundant.
> > Which line initialises/assigns 'ret' before this one?
> 
>     I think it maybe my fault before, because I treat get resource and irq
> succeed. But now I have two questions  to ask you:
> 
>     Q1: About asic3_mfd_probe()?
> 
>           In the function asic3_mfd_probe(), if get resource or irq failed,
> the value returned just detected and dev_dbg() error message, but there were
> no error return. What I think the modify should be as follows:
> 
>     mem_sdio = platform_get_resource(pdev, IORESOURCE_MEM, 1);
>     if (!mem_sdio) {
>         dev_dbg(asic->dev, "no SDIO MEM resource\n");
>         ret = -EINVAL;
>         goto out;
>     }
> 
>     irq = platform_get_irq(pdev, 1);
>     if (irq < 0) {
>         dev_dbg(asic->dev, "no SDIO IRQ resource\n");
>         ret = irq;
>         goto out;
>     }
> 
>     If the function do like this, the 'ret = 0' in line 993 maybe redundant.
> 
> 
>    Q2: About asic3_probe()?
> 
>           In the line 995, if the function asic3_irq_probe() failed, it will
> print error message by the internally called function platform_get_irq(), so
> the dev_err() in the line 997 is redundant, should be delete.
> 
> 
>     I'll wait actively, and submit the corresponding patch according to your
> reply.

Just submit the patch and we can discuss it there.

These kind of messages always require a lot of extra faff to process.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2020-04-17  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03  4:20 [PATCH] mfd:asic3:Delete redundant variable definition Tang Bin
2020-04-16  7:08 ` Lee Jones
2020-04-16  9:57   ` Tang Bin
2020-04-17  9:27     ` Lee Jones [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-04-03  8:11 [PATCH] mfd: asic3: Delete " Markus Elfring
2020-04-03  9:25 ` Lee Jones

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=20200417092705.GG2167633@dell \
    --to=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tangbin@cmss.chinamobile.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