linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3] ata: sata_highbank: delete redundant print and fix return value
@ 2021-03-15  2:39 Wang Qing
  2021-03-15  8:38 ` Sergei Shtylyov
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Qing @ 2021-03-15  2:39 UTC (permalink / raw)
  To: Jens Axboe, linux-ide, linux-kernel; +Cc: Wang Qing

platform_get_irq() has already checked and printed the return value, 
the printing here is nothing special, and should corrected to < 0.

Also, thhe return value should return a real error.

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/ata/sata_highbank.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c
index 64b2ef1..4438ee6
--- a/drivers/ata/sata_highbank.c
+++ b/drivers/ata/sata_highbank.c
@@ -469,10 +469,8 @@ static int ahci_highbank_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
-		dev_err(dev, "no irq\n");
-		return -EINVAL;
-	}
+	if (irq < 0)
+		return irq;
 
 	hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL);
 	if (!hpriv) {
-- 
2.7.4


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

* Re: [PATCH V3] ata: sata_highbank: delete redundant print and fix return value
  2021-03-15  2:39 [PATCH V3] ata: sata_highbank: delete redundant print and fix return value Wang Qing
@ 2021-03-15  8:38 ` Sergei Shtylyov
  0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2021-03-15  8:38 UTC (permalink / raw)
  To: Wang Qing, Jens Axboe, linux-ide, linux-kernel

Hello!

On 15.03.2021 5:39, Wang Qing wrote:

> platform_get_irq() has already checked and printed the return value,
> the printing here is nothing special, and should corrected to < 0.
> 
> Also, thhe return value should return a real error.

    The.
    It's a bad idea to mix the fix and cleanup in one patch (and to do two 
things in one patch as well); also describing a bug fix as an "appendage"
to the clean up. Anyway, I had already posted the fix here:

https://marc.info/?l=linux-ide&m=161575450917827

> Signed-off-by: Wang Qing <wangqing@vivo.com>
> ---
>   drivers/ata/sata_highbank.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c
> index 64b2ef1..4438ee6
> --- a/drivers/ata/sata_highbank.c
> +++ b/drivers/ata/sata_highbank.c
> @@ -469,10 +469,8 @@ static int ahci_highbank_probe(struct platform_device *pdev)
>   	}
>   
>   	irq = platform_get_irq(pdev, 0);
> -	if (irq <= 0) {
> -		dev_err(dev, "no irq\n");
> -		return -EINVAL;
> -	}
> +	if (irq < 0)
> +		return irq;

    What about irq == 0?
   [...]

MBR, Sergei

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

end of thread, other threads:[~2021-03-15  8:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15  2:39 [PATCH V3] ata: sata_highbank: delete redundant print and fix return value Wang Qing
2021-03-15  8:38 ` Sergei Shtylyov

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).