virtio-mmio: Delete an error message in vm_find_vqs()
Subsystems (2)
PATCH 1/1 virtio-mmio: Delete an error message in vm_find_vqs()
From: Markus Elfring <[email protected]>
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.
--- drivers/virtio/virtio_mmio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/virtio/virtio_mmio.c +1 -3
@@ -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
Quoted 6 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Sun, 5 Apr 2020 19:14:10 +0200The 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
Quoted 27 lines
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>--- drivers/virtio/virtio_mmio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/virtio/virtio_mmio.c +1
-4@@ -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
Quoted 5 lines
Quoted 3 lines
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
Quoted 1 line
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
Jason Wang
Acked-byQuoted 6 lines · Markus Elfring
Quoted 4 lines
Quoted 3 lines
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.
Quoted 5 lines
Quoted 3 lines
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.
Quoted 2 lines
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.
Thanks
Quoted 4 lines
Regards,
Markus