linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: pxa: ssp: Delete an error message in pxa_ssp_probe()
@ 2020-04-04 14:00 Markus Elfring
  2020-04-04 15:17 ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2020-04-04 14:00 UTC (permalink / raw)
  To: linux-arm-kernel, Allison Randal, Andy Shevchenko,
	Enrico Weigelt, Kate Stewart, Robert Jarzmik, Russell King,
	Thomas Gleixner, YueHaibing
  Cc: LKML, Tang Bin

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 4 Apr 2020 15:50:10 +0200
Subject: [PATCH] ARM: pxa: ssp: Delete an error message in pxa_ssp_probe()

The function “platform_get_irq” can log an error already.
Thus omit a redundant message for the exception handling in the
calling function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 arch/arm/plat-pxa/ssp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index 563440315acd..9e77b3392c1e 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -146,10 +146,8 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 	}

 	ssp->irq = platform_get_irq(pdev, 0);
-	if (ssp->irq < 0) {
-		dev_err(dev, "no IRQ resource defined\n");
+	if (ssp->irq < 0)
 		return -ENODEV;
-	}

 	if (dev->of_node) {
 		const struct of_device_id *id =
--
2.26.0


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

* Re: [PATCH] ARM: pxa: ssp: Delete an error message in pxa_ssp_probe()
  2020-04-04 14:00 [PATCH] ARM: pxa: ssp: Delete an error message in pxa_ssp_probe() Markus Elfring
@ 2020-04-04 15:17 ` Andy Shevchenko
  2020-04-04 16:01   ` Markus Elfring
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2020-04-04 15:17 UTC (permalink / raw)
  To: Markus Elfring
  Cc: linux-arm Mailing List, Allison Randal, Andy Shevchenko,
	Enrico Weigelt, Kate Stewart, Robert Jarzmik, Russell King,
	Thomas Gleixner, YueHaibing, LKML, Tang Bin

On Sat, Apr 4, 2020 at 5:03 PM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 4 Apr 2020 15:50:10 +0200
> Subject: [PATCH] ARM: pxa: ssp: Delete an error message in pxa_ssp_probe()
>
> The function “platform_get_irq” can log an error already.
> Thus omit a redundant message for the exception handling in the
> calling function.

...

>         ssp->irq = platform_get_irq(pdev, 0);
> -       if (ssp->irq < 0) {
> -               dev_err(dev, "no IRQ resource defined\n");
> +       if (ssp->irq < 0)
>                 return -ENODEV;
> -       }

At the same time we can unshadow the error code, i.e.
  return ssp->irq;


-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH] ARM: pxa: ssp: Delete an error message in pxa_ssp_probe()
  2020-04-04 15:17 ` Andy Shevchenko
@ 2020-04-04 16:01   ` Markus Elfring
  0 siblings, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2020-04-04 16:01 UTC (permalink / raw)
  To: Andy Shevchenko, linux-arm-kernel
  Cc: Allison Randal, Andy Shevchenko, Enrico Weigelt, Kate Stewart,
	Robert Jarzmik, Russell King, Tang Bin, Thomas Gleixner,
	YueHaibing, LKML, kernel-janitors

>>         ssp->irq = platform_get_irq(pdev, 0);
>> -       if (ssp->irq < 0) {
>> -               dev_err(dev, "no IRQ resource defined\n");
>> +       if (ssp->irq < 0)
>>                 return -ENODEV;
>> -       }
>
> At the same time we can unshadow the error code, i.e.
>   return ssp->irq;

Have you got any preferences for the order of possible change combinations?

Regards,
Markus

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-04 14:00 [PATCH] ARM: pxa: ssp: Delete an error message in pxa_ssp_probe() Markus Elfring
2020-04-04 15:17 ` Andy Shevchenko
2020-04-04 16:01   ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).