2020-04-19 09:22:41

by Tang Bin

[permalink] [raw]
Subject: [PATCH] mfd: asic3: Add error checking return in asic3_mfd_probe()

In the function asic3_mfd_probe(), when get resource or irq
failed, the value returned just detected and debug error message,
but there were no error checking return. So add the right error
checking return. And remove the redundant 'ret = 0'.

Signed-off-by: Shengju Zhang <[email protected]>
Signed-off-by: Tang Bin <[email protected]>
---
drivers/mfd/asic3.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 7694de3f1..827449b7a 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -881,12 +881,18 @@ static int __init asic3_mfd_probe(struct platform_device *pdev,
int irq, ret;

mem_sdio = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- if (!mem_sdio)
+ 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)
+ if (irq < 0) {
dev_dbg(asic->dev, "no SDIO IRQ resource\n");
+ ret = irq;
+ goto out;
+ }

/* DS1WM */
asic3_set_register(asic, ASIC3_OFFSET(EXTCF, SELECT),
@@ -924,7 +930,6 @@ static int __init asic3_mfd_probe(struct platform_device *pdev,
goto out;
}

- ret = 0;
if (pdata->leds) {
int i;

--
2.20.1.windows.1




2020-04-19 11:22:36

by Markus Elfring

[permalink] [raw]
Subject: Re: [PATCH] mfd: asic3: Add error checking return in asic3_mfd_probe()

> In the function asic3_mfd_probe(), when get resource or irq
> failed, the value returned just detected and debug error message,
> but there were no error checking return. So add the right error
> checking return.

I suggest to improve the commit message.
Would you like to adjust the patch subject?


> And remove the redundant 'ret = 0'.

I propose to reconsider this interpretation of the source code here.
How do you think about to move the mentioned statement into an else branch
at the end?

Regards,
Markus

2020-04-20 07:15:59

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH] mfd: asic3: Add error checking return in asic3_mfd_probe()

On Sun, 19 Apr 2020, Markus Elfring wrote:

> > In the function asic3_mfd_probe(), when get resource or irq
> > failed, the value returned just detected and debug error message,
> > but there were no error checking return. So add the right error
> > checking return.
>
> I suggest to improve the commit message.
> Would you like to adjust the patch subject?
>
>
> > And remove the redundant 'ret = 0'.
>
> I propose to reconsider this interpretation of the source code here.
> How do you think about to move the mentioned statement into an else branch
> at the end?

Could you please fix your mailer.

If you do not, your replies will be lost/discounted!

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

2020-04-20 08:41:20

by Markus Elfring

[permalink] [raw]
Subject: Re: mfd: asic3: Add error checking return in asic3_mfd_probe()

>>> And remove the redundant 'ret = 0'.
>>
>> I propose to reconsider this interpretation of the source code here.
>> How do you think about to move the mentioned statement into an else branch
>> at the end?
>
> Could you please fix your mailer.

Would you like to help with increasing software development resources
according to corresponding open issues?

mailto:tangbin%40cmss.chinamobile.com?In-Reply-To=%[email protected]%3E&Cc=lee.jones%40linaro.org%2Clinux-kernel%40vger.kernel.org%2Czhangshengju%40cmss.chinamobile.com&Subject=Re%3A%20%5BPATCH%5D%20mfd%3A%20asic3%3A%20Add%20error%20checking%20return%20in%20asic3_mfd_probe%28%29


Can any more clarification help also around the previous update suggestion
“mfd: asic3: Delete redundant variable definition”?
https://lore.kernel.org/lkml/[email protected]/
https://lore.kernel.org/patchwork/patch/1219914/
https://lkml.org/lkml/2020/4/3/4

Regards,
Markus

2020-04-20 08:52:26

by Lee Jones

[permalink] [raw]
Subject: Re: mfd: asic3: Add error checking return in asic3_mfd_probe()

On Mon, 20 Apr 2020, Markus Elfring wrote:

> >>> And remove the redundant 'ret = 0'.
> >>
> >> I propose to reconsider this interpretation of the source code here.
> >> How do you think about to move the mentioned statement into an else branch
> >> at the end?
> >
> > Could you please fix your mailer.
>
> Would you like to help with increasing software development resources
> according to corresponding open issues?

You mean, do I want to contribute to fixing your mailer?

No, not really. :)

>mailto:tangbin%40cmss.chinamobile.com?In-Reply-To=%[email protected]%3E&Cc=lee.jones%40linaro.org%2Clinux-kernel%40vger.kernel.org%2Czhangshengju%40cmss.chinamobile.com&Subject=Re%3A%20%5BPATCH%5D%20mfd%3A%20asic3%3A%20Add%20error%20checking%20return%20in%20asic3_mfd_probe%28%29

?

> Can any more clarification help also around the previous update suggestion
> “mfd: asic3: Delete redundant variable definition”?
> https://lore.kernel.org/lkml/[email protected]/
> https://lore.kernel.org/patchwork/patch/1219914/
> https://lkml.org/lkml/2020/4/3/4

Reviews for these patches are on my TODO.

So, it seems this mail did the right thing. Did you use a different
mailer, or fix/configure your previous one?

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

2020-04-20 10:06:49

by Markus Elfring

[permalink] [raw]
Subject: Re: mfd: asic3: Add error checking return in asic3_mfd_probe()

> So, it seems this mail did the right thing.

Thanks for another positive feedback.


> Did you use a different mailer,

No.


> or fix/configure your previous one?

My preferred mail program is also evolving over time.
Unfortunately, it seems that this software contains still development challenges
for the desired support of the field “In-Reply-To” in mailto links
(according to the public inbox communication interface).

Regards,
Markus