Message ID | 1615621617-1343-1-git-send-email-wangqing@vivo.com |
---|---|
State | New |
Headers | show |
Series | [1/2] ata: delete redundant printing of return value | expand |
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
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; > >
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;
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(-)