All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] mfd: asic3: Add error checking return in asic3_mfd_probe()
@ 2020-04-19 11:19 Markus Elfring
  2020-04-20  7:13 ` Lee Jones
  0 siblings, 1 reply; 6+ messages in thread
From: Markus Elfring @ 2020-04-19 11:19 UTC (permalink / raw)
  To: Tang Bin, Shengju Zhang; +Cc: Lee Jones, linux-kernel

> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mfd: asic3: Add error checking return in asic3_mfd_probe()
  2020-04-19 11:19 [PATCH] mfd: asic3: Add error checking return in asic3_mfd_probe() Markus Elfring
@ 2020-04-20  7:13 ` Lee Jones
  2020-04-20  8:37   ` Markus Elfring
  0 siblings, 1 reply; 6+ messages in thread
From: Lee Jones @ 2020-04-20  7:13 UTC (permalink / raw)
  To: Markus Elfring; +Cc: Tang Bin, Shengju Zhang, linux-kernel

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: mfd: asic3: Add error checking return in asic3_mfd_probe()
  2020-04-20  7:13 ` Lee Jones
@ 2020-04-20  8:37   ` Markus Elfring
  2020-04-20  8:50     ` Lee Jones
  0 siblings, 1 reply; 6+ messages in thread
From: Markus Elfring @ 2020-04-20  8:37 UTC (permalink / raw)
  To: Lee Jones, Tang Bin, Shengju Zhang; +Cc: linux-kernel

>>> 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=%3C20200419091923.5728-1-tangbin@cmss.chinamobile.com%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/20200403042020.17452-1-tangbin@cmss.chinamobile.com/
https://lore.kernel.org/patchwork/patch/1219914/
https://lkml.org/lkml/2020/4/3/4

Regards,
Markus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: mfd: asic3: Add error checking return in asic3_mfd_probe()
  2020-04-20  8:37   ` Markus Elfring
@ 2020-04-20  8:50     ` Lee Jones
  2020-04-20 10:04       ` Markus Elfring
  0 siblings, 1 reply; 6+ messages in thread
From: Lee Jones @ 2020-04-20  8:50 UTC (permalink / raw)
  To: Markus Elfring; +Cc: Tang Bin, Shengju Zhang, linux-kernel

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=%3C20200419091923.5728-1-tangbin@cmss.chinamobile.com%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/20200403042020.17452-1-tangbin@cmss.chinamobile.com/
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: mfd: asic3: Add error checking return in asic3_mfd_probe()
  2020-04-20  8:50     ` Lee Jones
@ 2020-04-20 10:04       ` Markus Elfring
  0 siblings, 0 replies; 6+ messages in thread
From: Markus Elfring @ 2020-04-20 10:04 UTC (permalink / raw)
  To: Lee Jones; +Cc: Tang Bin, Shengju Zhang, linux-kernel

> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] mfd: asic3: Add error checking return in asic3_mfd_probe()
@ 2020-04-19  9:19 Tang Bin
  0 siblings, 0 replies; 6+ messages in thread
From: Tang Bin @ 2020-04-19  9:19 UTC (permalink / raw)
  To: lee.jones; +Cc: linux-kernel, Tang Bin, Shengju Zhang

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 <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
 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




^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-04-20 10:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-19 11:19 [PATCH] mfd: asic3: Add error checking return in asic3_mfd_probe() Markus Elfring
2020-04-20  7:13 ` Lee Jones
2020-04-20  8:37   ` Markus Elfring
2020-04-20  8:50     ` Lee Jones
2020-04-20 10:04       ` Markus Elfring
  -- strict thread matches above, loose matches on Subject: below --
2020-04-19  9:19 [PATCH] " Tang Bin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.