All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] crypto: aspeed - Fix check for platform_get_irq() errors
@ 2022-09-20  3:21 ` YueHaibing
  0 siblings, 0 replies; 7+ messages in thread
From: YueHaibing @ 2022-09-20  3:21 UTC (permalink / raw)
  To: neal_liu, herbert, davem, joel, andrew, johnny_huang, dphadke
  Cc: linux-aspeed, linux-crypto, linux-arm-kernel, linux-kernel, YueHaibing

The platform_get_irq() function returns negative on error and
positive non-zero values on success. It never returns zero, but if it
did then treat that as a success.

Also remove redundant dev_err() print as platform_get_irq() already
prints an error.

Fixes: 108713a713c7 ("crypto: aspeed - Add HACE hash driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/crypto/aspeed/aspeed-hace.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/crypto/aspeed/aspeed-hace.c b/drivers/crypto/aspeed/aspeed-hace.c
index 3f880aafb6a2..f7f1d33defb1 100644
--- a/drivers/crypto/aspeed/aspeed-hace.c
+++ b/drivers/crypto/aspeed/aspeed-hace.c
@@ -130,10 +130,8 @@ static int aspeed_hace_probe(struct platform_device *pdev)
 
 	/* Get irq number and register it */
 	hace_dev->irq = platform_get_irq(pdev, 0);
-	if (!hace_dev->irq) {
-		dev_err(&pdev->dev, "Failed to get interrupt\n");
+	if (hace_dev->irq < 0)
 		return -ENXIO;
-	}
 
 	rc = devm_request_irq(&pdev->dev, hace_dev->irq, aspeed_hace_irq, 0,
 			      dev_name(&pdev->dev), hace_dev);
-- 
2.17.1


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

* [PATCH -next] crypto: aspeed - Fix check for platform_get_irq() errors
@ 2022-09-20  3:21 ` YueHaibing
  0 siblings, 0 replies; 7+ messages in thread
From: YueHaibing @ 2022-09-20  3:21 UTC (permalink / raw)
  To: neal_liu, herbert, davem, joel, andrew, johnny_huang, dphadke
  Cc: linux-aspeed, linux-crypto, linux-arm-kernel, linux-kernel, YueHaibing

The platform_get_irq() function returns negative on error and
positive non-zero values on success. It never returns zero, but if it
did then treat that as a success.

Also remove redundant dev_err() print as platform_get_irq() already
prints an error.

Fixes: 108713a713c7 ("crypto: aspeed - Add HACE hash driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/crypto/aspeed/aspeed-hace.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/crypto/aspeed/aspeed-hace.c b/drivers/crypto/aspeed/aspeed-hace.c
index 3f880aafb6a2..f7f1d33defb1 100644
--- a/drivers/crypto/aspeed/aspeed-hace.c
+++ b/drivers/crypto/aspeed/aspeed-hace.c
@@ -130,10 +130,8 @@ static int aspeed_hace_probe(struct platform_device *pdev)
 
 	/* Get irq number and register it */
 	hace_dev->irq = platform_get_irq(pdev, 0);
-	if (!hace_dev->irq) {
-		dev_err(&pdev->dev, "Failed to get interrupt\n");
+	if (hace_dev->irq < 0)
 		return -ENXIO;
-	}
 
 	rc = devm_request_irq(&pdev->dev, hace_dev->irq, aspeed_hace_irq, 0,
 			      dev_name(&pdev->dev), hace_dev);
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH -next] crypto: aspeed - Fix check for platform_get_irq() errors
  2022-09-20  3:21 ` YueHaibing
  (?)
@ 2022-09-20  5:06 ` Mukesh Ojha
  -1 siblings, 0 replies; 7+ messages in thread
From: Mukesh Ojha @ 2022-09-20  5:06 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On 9/20/2022 8:51 AM, YueHaibing wrote:
> The platform_get_irq() function returns negative on error and
> positive non-zero values on success. It never returns zero, but if it
> did then treat that as a success.
> 
> Also remove redundant dev_err() print as platform_get_irq() already
> prints an error.
> 
> Fixes: 108713a713c7 ("crypto: aspeed - Add HACE hash driver")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>   drivers/crypto/aspeed/aspeed-hace.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/crypto/aspeed/aspeed-hace.c b/drivers/crypto/aspeed/aspeed-hace.c
> index 3f880aafb6a2..f7f1d33defb1 100644
> --- a/drivers/crypto/aspeed/aspeed-hace.c
> +++ b/drivers/crypto/aspeed/aspeed-hace.c
> @@ -130,10 +130,8 @@ static int aspeed_hace_probe(struct platform_device *pdev)
>   
>   	/* Get irq number and register it */
>   	hace_dev->irq = platform_get_irq(pdev, 0);
> -	if (!hace_dev->irq) {
> -		dev_err(&pdev->dev, "Failed to get interrupt\n");
> +	if (hace_dev->irq < 0)
>   		return -ENXIO;
> -	}
>   
>   	rc = devm_request_irq(&pdev->dev, hace_dev->irq, aspeed_hace_irq, 0,
>   			      dev_name(&pdev->dev), hace_dev);

LGTM.
Reviewed-by: Mukesh Ojha <quic_mojha@quicinc.com>

-Mukesh

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH -next] crypto: aspeed - Fix check for platform_get_irq() errors
  2022-09-20  3:21 ` YueHaibing
@ 2022-09-20  5:24   ` Neal Liu
  -1 siblings, 0 replies; 7+ messages in thread
From: Neal Liu @ 2022-09-20  5:24 UTC (permalink / raw)
  To: YueHaibing, herbert, davem, joel, andrew, Johnny Huang, dphadke
  Cc: linux-aspeed, linux-crypto, linux-arm-kernel, linux-kernel

> The platform_get_irq() function returns negative on error and positive non-zero
> values on success. It never returns zero, but if it did then treat that as a
> success.
> 
> Also remove redundant dev_err() print as platform_get_irq() already prints an
> error.
> 
> Fixes: 108713a713c7 ("crypto: aspeed - Add HACE hash driver")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Neal Liu <neal_liu@aspeedtech.com>

> ---
>  drivers/crypto/aspeed/aspeed-hace.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/crypto/aspeed/aspeed-hace.c
> b/drivers/crypto/aspeed/aspeed-hace.c
> index 3f880aafb6a2..f7f1d33defb1 100644
> --- a/drivers/crypto/aspeed/aspeed-hace.c
> +++ b/drivers/crypto/aspeed/aspeed-hace.c
> @@ -130,10 +130,8 @@ static int aspeed_hace_probe(struct platform_device
> *pdev)
> 
>  	/* Get irq number and register it */
>  	hace_dev->irq = platform_get_irq(pdev, 0);
> -	if (!hace_dev->irq) {
> -		dev_err(&pdev->dev, "Failed to get interrupt\n");
> +	if (hace_dev->irq < 0)
>  		return -ENXIO;
> -	}
> 
>  	rc = devm_request_irq(&pdev->dev, hace_dev->irq, aspeed_hace_irq, 0,
>  			      dev_name(&pdev->dev), hace_dev);
> --
> 2.17.1


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

* RE: [PATCH -next] crypto: aspeed - Fix check for platform_get_irq() errors
@ 2022-09-20  5:24   ` Neal Liu
  0 siblings, 0 replies; 7+ messages in thread
From: Neal Liu @ 2022-09-20  5:24 UTC (permalink / raw)
  To: YueHaibing, herbert, davem, joel, andrew, Johnny Huang, dphadke
  Cc: linux-aspeed, linux-crypto, linux-arm-kernel, linux-kernel

> The platform_get_irq() function returns negative on error and positive non-zero
> values on success. It never returns zero, but if it did then treat that as a
> success.
> 
> Also remove redundant dev_err() print as platform_get_irq() already prints an
> error.
> 
> Fixes: 108713a713c7 ("crypto: aspeed - Add HACE hash driver")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Neal Liu <neal_liu@aspeedtech.com>

> ---
>  drivers/crypto/aspeed/aspeed-hace.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/crypto/aspeed/aspeed-hace.c
> b/drivers/crypto/aspeed/aspeed-hace.c
> index 3f880aafb6a2..f7f1d33defb1 100644
> --- a/drivers/crypto/aspeed/aspeed-hace.c
> +++ b/drivers/crypto/aspeed/aspeed-hace.c
> @@ -130,10 +130,8 @@ static int aspeed_hace_probe(struct platform_device
> *pdev)
> 
>  	/* Get irq number and register it */
>  	hace_dev->irq = platform_get_irq(pdev, 0);
> -	if (!hace_dev->irq) {
> -		dev_err(&pdev->dev, "Failed to get interrupt\n");
> +	if (hace_dev->irq < 0)
>  		return -ENXIO;
> -	}
> 
>  	rc = devm_request_irq(&pdev->dev, hace_dev->irq, aspeed_hace_irq, 0,
>  			      dev_name(&pdev->dev), hace_dev);
> --
> 2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH -next] crypto: aspeed - Fix check for platform_get_irq() errors
  2022-09-20  3:21 ` YueHaibing
@ 2022-09-30  6:15   ` Herbert Xu
  -1 siblings, 0 replies; 7+ messages in thread
From: Herbert Xu @ 2022-09-30  6:15 UTC (permalink / raw)
  To: YueHaibing
  Cc: neal_liu, davem, joel, andrew, johnny_huang, dphadke,
	linux-aspeed, linux-crypto, linux-arm-kernel, linux-kernel

On Tue, Sep 20, 2022 at 11:21:18AM +0800, YueHaibing wrote:
> The platform_get_irq() function returns negative on error and
> positive non-zero values on success. It never returns zero, but if it
> did then treat that as a success.
> 
> Also remove redundant dev_err() print as platform_get_irq() already
> prints an error.
> 
> Fixes: 108713a713c7 ("crypto: aspeed - Add HACE hash driver")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/crypto/aspeed/aspeed-hace.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [PATCH -next] crypto: aspeed - Fix check for platform_get_irq() errors
@ 2022-09-30  6:15   ` Herbert Xu
  0 siblings, 0 replies; 7+ messages in thread
From: Herbert Xu @ 2022-09-30  6:15 UTC (permalink / raw)
  To: YueHaibing
  Cc: neal_liu, davem, joel, andrew, johnny_huang, dphadke,
	linux-aspeed, linux-crypto, linux-arm-kernel, linux-kernel

On Tue, Sep 20, 2022 at 11:21:18AM +0800, YueHaibing wrote:
> The platform_get_irq() function returns negative on error and
> positive non-zero values on success. It never returns zero, but if it
> did then treat that as a success.
> 
> Also remove redundant dev_err() print as platform_get_irq() already
> prints an error.
> 
> Fixes: 108713a713c7 ("crypto: aspeed - Add HACE hash driver")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/crypto/aspeed/aspeed-hace.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-09-30  6:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-20  3:21 [PATCH -next] crypto: aspeed - Fix check for platform_get_irq() errors YueHaibing
2022-09-20  3:21 ` YueHaibing
2022-09-20  5:06 ` Mukesh Ojha
2022-09-20  5:24 ` Neal Liu
2022-09-20  5:24   ` Neal Liu
2022-09-30  6:15 ` Herbert Xu
2022-09-30  6:15   ` Herbert Xu

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.