linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ata: delete redundant printing of return value
@ 2021-03-13  7:47 Wang Qing
  2021-03-13 10:16 ` Sergei Shtylyov
  0 siblings, 1 reply; 5+ messages in thread
From: Wang Qing @ 2021-03-13  7:47 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, it is not necessary at all.

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

diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c
index 64b2ef1..a43d42a
--- 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");
+	if (irq <= 0)
 		return -EINVAL;
-	}
 
 	hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL);
 	if (!hpriv) {
-- 
2.7.4


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

* Re: [PATCH 1/2] ata: delete redundant printing of return value
  2021-03-13  7:47 [PATCH 1/2] ata: delete redundant printing of return value Wang Qing
@ 2021-03-13 10:16 ` Sergei Shtylyov
  0 siblings, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2021-03-13 10:16 UTC (permalink / raw)
  To: Wang Qing, Jens Axboe, linux-ide, linux-kernel

Hello again. :-)

   Now, 2 patches to the different files shouldn't have and identical subject! And the patch
subject should reflect the exact patch locus, e.g. "sata_highbank: delete redundant printing
of return value".

On 3/13/21 10:47 AM, Wang Qing wrote:

> platform_get_irq() has already checked and printed the return value, 
> the printing here is nothing special, it is not necessary at all.
> 
> Signed-off-by: Wang Qing <wangqing@vivo.com>
> ---
>  drivers/ata/sata_highbank.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c
> index 64b2ef1..a43d42a
> --- 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");
> +	if (irq <= 0)
>  		return -EINVAL;
> -	}

   Again, this code has more serious issue: it breaks deferred probing by 
overriding the result to -EINVAL...

MBR, Sergei

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

* Re: [PATCH 1/2] ata: delete redundant printing of return value
  2021-03-13  7:46 Wang Qing
  2021-03-13 10:04 ` Sergei Shtylyov
@ 2021-03-13 12:07 ` Hans de Goede
  1 sibling, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2021-03-13 12:07 UTC (permalink / raw)
  To: Wang Qing, Jens Axboe, linux-ide, linux-kernel

Hi,

On 3/13/21 8:46 AM, Wang Qing wrote:
> platform_get_irq() has already checked and printed the return value, 
> the printing here is nothing special, it is not necessary at all.
> 
> Signed-off-by: Wang Qing <wangqing@vivo.com>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>  drivers/ata/libahci_platform.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
> index de638da..2e7ea75
> --- a/drivers/ata/libahci_platform.c
> +++ b/drivers/ata/libahci_platform.c
> @@ -582,11 +582,8 @@ int ahci_platform_init_host(struct platform_device *pdev,
>  	int i, irq, n_ports, rc;
>  
>  	irq = platform_get_irq(pdev, 0);
> -	if (irq <= 0) {
> -		if (irq != -EPROBE_DEFER)
> -			dev_err(dev, "no irq\n");
> +	if (irq <= 0)
>  		return irq;
> -	}
>  
>  	hpriv->irq = irq;
>  
> 


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

* Re: [PATCH 1/2] ata: delete redundant printing of return value
  2021-03-13  7:46 Wang Qing
@ 2021-03-13 10:04 ` Sergei Shtylyov
  2021-03-13 12:07 ` Hans de Goede
  1 sibling, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2021-03-13 10:04 UTC (permalink / raw)
  To: Wang Qing, Hans de Goede, Jens Axboe, linux-ide, linux-kernel

Hello!

   The patch subject should reflect the exact patch locus, e.g. "ata: libahci_platform:
delete redundant printing of return value".

On 3/13/21 10:46 AM, Wang Qing wrote:

> platform_get_irq() has already checked and printed the return value, 
> the printing here is nothing special, it is not necessary at all.
> 
> Signed-off-by: Wang Qing <wangqing@vivo.com>
> ---
>  drivers/ata/libahci_platform.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
> index de638da..2e7ea75
> --- a/drivers/ata/libahci_platform.c
> +++ b/drivers/ata/libahci_platform.c
> @@ -582,11 +582,8 @@ int ahci_platform_init_host(struct platform_device *pdev,
>  	int i, irq, n_ports, rc;
>  
>  	irq = platform_get_irq(pdev, 0);
> -	if (irq <= 0) {
> -		if (irq != -EPROBE_DEFER)
> -			dev_err(dev, "no irq\n");
> +	if (irq <= 0)
>  		return irq;
> -	}

   This code has more serious problem: it returns 0 on error as if it was success.
Should be changed to *if* (irq < 0) (in a separate patch).

MBR, Sergei

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

* [PATCH 1/2] ata: delete redundant printing of return value
@ 2021-03-13  7:46 Wang Qing
  2021-03-13 10:04 ` Sergei Shtylyov
  2021-03-13 12:07 ` Hans de Goede
  0 siblings, 2 replies; 5+ messages in thread
From: Wang Qing @ 2021-03-13  7:46 UTC (permalink / raw)
  To: Hans de Goede, 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, it is not necessary at all.

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

diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index de638da..2e7ea75
--- a/drivers/ata/libahci_platform.c
+++ b/drivers/ata/libahci_platform.c
@@ -582,11 +582,8 @@ int ahci_platform_init_host(struct platform_device *pdev,
 	int i, irq, n_ports, rc;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
-		if (irq != -EPROBE_DEFER)
-			dev_err(dev, "no irq\n");
+	if (irq <= 0)
 		return irq;
-	}
 
 	hpriv->irq = irq;
 
-- 
2.7.4


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

end of thread, other threads:[~2021-03-13 12:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-13  7:47 [PATCH 1/2] ata: delete redundant printing of return value Wang Qing
2021-03-13 10:16 ` Sergei Shtylyov
  -- strict thread matches above, loose matches on Subject: below --
2021-03-13  7:46 Wang Qing
2021-03-13 10:04 ` Sergei Shtylyov
2021-03-13 12:07 ` Hans de Goede

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