Linux-EDAC Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/2] EDAC/aspeed: Fix handling of platform_get_irq() error
@ 2020-08-27  7:07 Krzysztof Kozlowski
  2020-08-27  7:07 ` [PATCH 2/2] EDAC/ti: " Krzysztof Kozlowski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2020-08-27  7:07 UTC (permalink / raw)
  To: Stefan Schaeckeler, Borislav Petkov, Mauro Carvalho Chehab,
	Tony Luck, James Morse, Robert Richter, Joel Stanley,
	Andrew Jeffery, Tero Kristo, linux-edac, linux-arm-kernel,
	linux-aspeed, linux-kernel
  Cc: Krzysztof Kozlowski

platform_get_irq() returns -ERRNO on error.  In such case comparison
to 0 would pass the check.

Fixes: 9b7e6242ee4e ("EDAC, aspeed: Add an Aspeed AST2500 EDAC driver")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/edac/aspeed_edac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c
index b194658b8b5c..fbec28dc661d 100644
--- a/drivers/edac/aspeed_edac.c
+++ b/drivers/edac/aspeed_edac.c
@@ -209,8 +209,8 @@ static int config_irq(void *ctx, struct platform_device *pdev)
 	/* register interrupt handler */
 	irq = platform_get_irq(pdev, 0);
 	dev_dbg(&pdev->dev, "got irq %d\n", irq);
-	if (!irq)
-		return -ENODEV;
+	if (irq < 0)
+		return irq;
 
 	rc = devm_request_irq(&pdev->dev, irq, mcr_isr, IRQF_TRIGGER_HIGH,
 			      DRV_NAME, ctx);
-- 
2.17.1


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

* [PATCH 2/2] EDAC/ti: Fix handling of platform_get_irq() error
  2020-08-27  7:07 [PATCH 1/2] EDAC/aspeed: Fix handling of platform_get_irq() error Krzysztof Kozlowski
@ 2020-08-27  7:07 ` Krzysztof Kozlowski
  2020-08-27  7:13   ` Tero Kristo
       [not found] ` <0D9EC2D2-C4A0-42E9-94A5-DCFBE7BFEC43@cisco.com>
  2020-09-01 18:51 ` Borislav Petkov
  2 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2020-08-27  7:07 UTC (permalink / raw)
  To: Stefan Schaeckeler, Borislav Petkov, Mauro Carvalho Chehab,
	Tony Luck, James Morse, Robert Richter, Joel Stanley,
	Andrew Jeffery, Tero Kristo, linux-edac, linux-arm-kernel,
	linux-aspeed, linux-kernel
  Cc: Krzysztof Kozlowski

platform_get_irq() returns -ERRNO on error.  In such case comparison
to 0 would pass the check.

Fixes: 86a18ee21e5e ("EDAC, ti: Add support for TI keystone and DRA7xx EDAC")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/edac/ti_edac.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/edac/ti_edac.c b/drivers/edac/ti_edac.c
index 6e52796a0b41..e7eae20f83d1 100644
--- a/drivers/edac/ti_edac.c
+++ b/drivers/edac/ti_edac.c
@@ -278,7 +278,8 @@ static int ti_edac_probe(struct platform_device *pdev)
 
 	/* add EMIF ECC error handler */
 	error_irq = platform_get_irq(pdev, 0);
-	if (!error_irq) {
+	if (error_irq < 0) {
+		ret = error_irq;
 		edac_printk(KERN_ERR, EDAC_MOD_NAME,
 			    "EMIF irq number not defined.\n");
 		goto err;
-- 
2.17.1


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

* Re: [PATCH 2/2] EDAC/ti: Fix handling of platform_get_irq() error
  2020-08-27  7:07 ` [PATCH 2/2] EDAC/ti: " Krzysztof Kozlowski
@ 2020-08-27  7:13   ` Tero Kristo
  0 siblings, 0 replies; 5+ messages in thread
From: Tero Kristo @ 2020-08-27  7:13 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Stefan Schaeckeler, Borislav Petkov,
	Mauro Carvalho Chehab, Tony Luck, James Morse, Robert Richter,
	Joel Stanley, Andrew Jeffery, linux-edac, linux-arm-kernel,
	linux-aspeed, linux-kernel

On 27/08/2020 10:07, Krzysztof Kozlowski wrote:
> platform_get_irq() returns -ERRNO on error.  In such case comparison
> to 0 would pass the check.
> 
> Fixes: 86a18ee21e5e ("EDAC, ti: Add support for TI keystone and DRA7xx EDAC")
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Reviewed-by: Tero Kristo <t-kristo@ti.com>

> ---
>   drivers/edac/ti_edac.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/edac/ti_edac.c b/drivers/edac/ti_edac.c
> index 6e52796a0b41..e7eae20f83d1 100644
> --- a/drivers/edac/ti_edac.c
> +++ b/drivers/edac/ti_edac.c
> @@ -278,7 +278,8 @@ static int ti_edac_probe(struct platform_device *pdev)
>   
>   	/* add EMIF ECC error handler */
>   	error_irq = platform_get_irq(pdev, 0);
> -	if (!error_irq) {
> +	if (error_irq < 0) {
> +		ret = error_irq;
>   		edac_printk(KERN_ERR, EDAC_MOD_NAME,
>   			    "EMIF irq number not defined.\n");
>   		goto err;
> 

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* Re: [PATCH 1/2] EDAC/aspeed: Fix handling of platform_get_irq() error
       [not found] ` <0D9EC2D2-C4A0-42E9-94A5-DCFBE7BFEC43@cisco.com>
@ 2020-08-27 23:49   ` Stefan Schaeckeler
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Schaeckeler @ 2020-08-27 23:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Borislav Petkov, Mauro Carvalho Chehab,
	Tony Luck, James Morse, Robert Richter, Joel Stanley,
	Andrew Jeffery, Tero Kristo, linux-edac, linux-arm-kernel,
	linux-aspeed, linux-kernel
  Cc: Stefan Schaeckeler

>  platform_get_irq() returns -ERRNO on error.  In such case comparison
>  to 0 would pass the check.
>
>  Fixes: 9b7e6242ee4e ("EDAC, aspeed: Add an Aspeed AST2500 EDAC driver")
>  Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Reviewed-by: Stefan Schaeckeler <schaecsn@gmx.net>

>  ---
>  drivers/edac/aspeed_edac.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
>  diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c
>  index b194658b8b5c..fbec28dc661d 100644
>  --- a/drivers/edac/aspeed_edac.c
>  +++ b/drivers/edac/aspeed_edac.c
>  @@ -209,8 +209,8 @@ static int config_irq(void *ctx, struct platform_device *pdev)
>   	/* register interrupt handler */
>   	irq = platform_get_irq(pdev, 0);
>   	dev_dbg(&pdev->dev, "got irq %d\n", irq);
>  -	if (!irq)
>  -		return -ENODEV;
>  +	if (irq < 0)
>  +		return irq;
>
>   	rc = devm_request_irq(&pdev->dev, irq, mcr_isr, IRQF_TRIGGER_HIGH,
>   			      DRV_NAME, ctx);
>  --
>  2.17.1
>
>

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

* Re: [PATCH 1/2] EDAC/aspeed: Fix handling of platform_get_irq() error
  2020-08-27  7:07 [PATCH 1/2] EDAC/aspeed: Fix handling of platform_get_irq() error Krzysztof Kozlowski
  2020-08-27  7:07 ` [PATCH 2/2] EDAC/ti: " Krzysztof Kozlowski
       [not found] ` <0D9EC2D2-C4A0-42E9-94A5-DCFBE7BFEC43@cisco.com>
@ 2020-09-01 18:51 ` Borislav Petkov
  2 siblings, 0 replies; 5+ messages in thread
From: Borislav Petkov @ 2020-09-01 18:51 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Stefan Schaeckeler, Mauro Carvalho Chehab, Tony Luck,
	James Morse, Robert Richter, Joel Stanley, Andrew Jeffery,
	Tero Kristo, linux-edac, linux-arm-kernel, linux-aspeed,
	linux-kernel

On Thu, Aug 27, 2020 at 09:07:42AM +0200, Krzysztof Kozlowski wrote:
> platform_get_irq() returns -ERRNO on error.  In such case comparison
> to 0 would pass the check.
> 
> Fixes: 9b7e6242ee4e ("EDAC, aspeed: Add an Aspeed AST2500 EDAC driver")
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/edac/aspeed_edac.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Both applied,
thanks.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

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

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27  7:07 [PATCH 1/2] EDAC/aspeed: Fix handling of platform_get_irq() error Krzysztof Kozlowski
2020-08-27  7:07 ` [PATCH 2/2] EDAC/ti: " Krzysztof Kozlowski
2020-08-27  7:13   ` Tero Kristo
     [not found] ` <0D9EC2D2-C4A0-42E9-94A5-DCFBE7BFEC43@cisco.com>
2020-08-27 23:49   ` [PATCH 1/2] EDAC/aspeed: " Stefan Schaeckeler
2020-09-01 18:51 ` Borislav Petkov

Linux-EDAC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-edac/0 linux-edac/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-edac linux-edac/ https://lore.kernel.org/linux-edac \
		linux-edac@vger.kernel.org
	public-inbox-index linux-edac

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-edac


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git