Skip to contentSkip to conversation

virtio: Remove unnecessary variable assignments

PATCH Bo Liu (刘波)-浪潮信息 1 participant 1 message Jun 20, 2022 virtio core

lore
Share & tools
lore

Bo Liu (刘波)-浪潮信息

author Reviewed-by Stefano Garzarella
#0 lore raw

Hi

Quoted 36 lines

Hi Bo,

Quoted 24 lines · Bo Liu (刘波)-浪潮信息

Hi

Quoted 11 lines · Bo Liu
Quoted 6 lines

In function vp_modern_probe(), "mdev->pci_dev" is assigned to variable "pci_dev", variable "pci_dev" and "mdev->pci_dev" have the same value.
There is no need to assign variable "pci_dev" to "mdev->pci_dev". So remove it.

I suggest rephrasing the description a bit.
Maybe into something like this:

Quoted 9 lines

In function vp_modern_probe(), "pci_dev" is initialized with the value of "mdev->pci_dev", so assigning "pci_dev" to "mdev->pci_dev"
is unnecessary since they store the same value.

Anyway, the patch LGTM:

The new patch is:

Quoted 8 lines

In function vp_modern_probe(), "pci_dev" is initialized with the value of "mdev->pci_dev", so assigning "pci_dev" to "mdev->pci_dev" is unnecessary since they store the same value.

---
drivers/virtio/virtio_pci_modern_dev.c | 2 --

1 file changed, 2 deletions(-)
Quoted 6 lines

It looks good, but I think it is better to send a proper v2.

You can also add my R-b just before your S-o-b

Thanks,
Stefano

The new patch is:

In function vp_modern_probe(), "pci_dev" is initialized with the value of "mdev->pci_dev", so assigning "pci_dev" to "mdev->pci_dev" is unnecessary since they store the same value.

---
 drivers/virtio/virtio_pci_modern_dev.c | 2 --
 1 file changed, 2 deletions(-)
(quoted diff) +0 -0

b/drivers/virtio/virtio_pci_modern_dev.c
index b790f30b2b56..fa2a9445bb18 100644

drivers/virtio/virtio_pci_modern_dev.c +0 -0
@@ -220,8 +220,6 @@ int vp_modern_probe(struct virtio_pci_modern_device

*mdev)

check_offsets();

- mdev->pci_dev = pci_dev;
-
/* We only own devices >= 0x1000 and <= 0x107f: leave the rest. */ if (pci_dev->device < 0x1000 || pci_dev->device > 0x107f)
return -ENODEV;
--
2.27.0