* [PATCH] virtio-mmio: Delete an error message in vm_find_vqs()
@ 2020-04-05 17:19 Markus Elfring
2020-04-09 3:19 ` Jason Wang
0 siblings, 1 reply; 4+ messages in thread
From: Markus Elfring @ 2020-04-05 17:19 UTC (permalink / raw)
To: virtualization, Jason Wang, Michael S. Tsirkin
Cc: LKML, kernel-janitors, Tang Bin
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 5 Apr 2020 19:14:10 +0200
The function “platform_get_irq” can log an error already.
Thus omit a redundant message for the exception handling in the
calling function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/virtio/virtio_mmio.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
index 97d5725fd9a2..9d16aaffca9d 100644
--- a/drivers/virtio/virtio_mmio.c
+++ b/drivers/virtio/virtio_mmio.c
@@ -466,10 +466,8 @@ static int vm_find_vqs(struct virtio_device *vdev, unsigned nvqs,
int irq = platform_get_irq(vm_dev->pdev, 0);
int i, err, queue_idx = 0;
- if (irq < 0) {
- dev_err(&vdev->dev, "Cannot get IRQ resource\n");
+ if (irq < 0)
return irq;
- }
err = request_irq(irq, vm_interrupt, IRQF_SHARED,
dev_name(&vdev->dev), vm_dev);
--
2.26.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] virtio-mmio: Delete an error message in vm_find_vqs()
2020-04-05 17:19 [PATCH] virtio-mmio: Delete an error message in vm_find_vqs() Markus Elfring
@ 2020-04-09 3:19 ` Jason Wang
2020-04-09 6:02 ` Markus Elfring
0 siblings, 1 reply; 4+ messages in thread
From: Jason Wang @ 2020-04-09 3:19 UTC (permalink / raw)
To: Markus Elfring, virtualization, Michael S. Tsirkin
Cc: LKML, kernel-janitors, Tang Bin
On 2020/4/6 上午1:19, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 5 Apr 2020 19:14:10 +0200
>
> The function “platform_get_irq” can log an error already.
> Thus omit a redundant message for the exception handling in the
> calling function.
It looks to me that not all error path of platform_get_irq() were loggd.
And git grep told me there're other users of platform_get_irq() that
check and log by themselves.
Thanks
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/virtio/virtio_mmio.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
> index 97d5725fd9a2..9d16aaffca9d 100644
> --- a/drivers/virtio/virtio_mmio.c
> +++ b/drivers/virtio/virtio_mmio.c
> @@ -466,10 +466,8 @@ static int vm_find_vqs(struct virtio_device *vdev, unsigned nvqs,
> int irq = platform_get_irq(vm_dev->pdev, 0);
> int i, err, queue_idx = 0;
>
> - if (irq < 0) {
> - dev_err(&vdev->dev, "Cannot get IRQ resource\n");
> + if (irq < 0)
> return irq;
> - }
>
> err = request_irq(irq, vm_interrupt, IRQF_SHARED,
> dev_name(&vdev->dev), vm_dev);
> --
> 2.26.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: virtio-mmio: Delete an error message in vm_find_vqs()
2020-04-09 3:19 ` Jason Wang
@ 2020-04-09 6:02 ` Markus Elfring
2020-04-09 6:20 ` Jason Wang
0 siblings, 1 reply; 4+ messages in thread
From: Markus Elfring @ 2020-04-09 6:02 UTC (permalink / raw)
To: Jason Wang, Michael S. Tsirkin, virtualization
Cc: LKML, kernel-janitors, Andrzej Hajda, Andy Shevchenko,
Bartlomiej Zolnierkiewicz, Javier Martinez Canillas,
Marek Szyprowski, Mark Brown, Rafael J. Wysocki, Rob Herring,
Russell King, Stephen Boyd, Tang Bin
>> The function “platform_get_irq” can log an error already.
>> Thus omit a redundant message for the exception handling in the
>> calling function.
>
> It looks to me that not all error path of platform_get_irq() were loggd.
How do you think about to clarify the handling of the error code “-EPROBE_DEFER” any more?
https://elixir.bootlin.com/linux/v5.6.3/source/drivers/base/platform.c#L202
> And git grep told me there're other users of platform_get_irq() that check and log by themselves.
Source code analysis can point further update candidates out, can't it?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/base/platform.c?id=7723f4c5ecdb8d832f049f8483beb0d1081cedf6
Would you like to achieve collateral evolution?
Regards,
Markus
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: virtio-mmio: Delete an error message in vm_find_vqs()
2020-04-09 6:02 ` Markus Elfring
@ 2020-04-09 6:20 ` Jason Wang
0 siblings, 0 replies; 4+ messages in thread
From: Jason Wang @ 2020-04-09 6:20 UTC (permalink / raw)
To: Markus Elfring, Michael S. Tsirkin, virtualization
Cc: LKML, kernel-janitors, Andrzej Hajda, Andy Shevchenko,
Bartlomiej Zolnierkiewicz, Javier Martinez Canillas,
Marek Szyprowski, Mark Brown, Rafael J. Wysocki, Rob Herring,
Russell King, Stephen Boyd, Tang Bin
On 2020/4/9 下午2:02, Markus Elfring wrote:
>>> The function “platform_get_irq” can log an error already.
>>> Thus omit a redundant message for the exception handling in the
>>> calling function.
>> It looks to me that not all error path of platform_get_irq() were loggd.
> How do you think about to clarify the handling of the error code “-EPROBE_DEFER” any more?
> https://elixir.bootlin.com/linux/v5.6.3/source/drivers/base/platform.c#L202
Aha, it looks to me that I'm on the wrong branch. Sorry.
>
>
>> And git grep told me there're other users of platform_get_irq() that check and log by themselves.
> Source code analysis can point further update candidates out, can't it?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/base/platform.c?id=7723f4c5ecdb8d832f049f8483beb0d1081cedf6
Yes, it can.
>
> Would you like to achieve collateral evolution?
Yes and it's probably be better to put all the fixes in one series.
For this patch.
Acked-by: Jason Wang <jasowang@redhat.com>
Thanks
>
> Regards,
> Markus
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-04-09 6:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-05 17:19 [PATCH] virtio-mmio: Delete an error message in vm_find_vqs() Markus Elfring
2020-04-09 3:19 ` Jason Wang
2020-04-09 6:02 ` Markus Elfring
2020-04-09 6:20 ` Jason Wang
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).