diff options
author | Jiri Pirko <jiri@nvidia.com> | 2024-07-16 14:35:41 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2024-07-17 12:43:20 +0300 |
commit | 572864d45d61c69aa99461e944f43d3b95c5e159 (patch) | |
tree | 0bc7670cadeb8ffc7e9f5e91e846ad770d4f8419 /drivers | |
parent | de128f3f6317b8568311d9f9eb5e0425ebc23a03 (diff) | |
download | linux-572864d45d61c69aa99461e944f43d3b95c5e159.tar.xz |
virtio_pci: simplify vp_request_msix_vectors() call a bit
Pass desc arg as it is always to vp_request_msix_vectors(). There rely
on per_vq_vectors arg and null desc in case it is false.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Message-Id: <20240716113552.80599-3-jiri@resnulli.us>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/virtio/virtio_pci_common.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index 277591a6ab96..cda0d35dd9e1 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -125,6 +125,9 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, GFP_KERNEL)) goto error; + if (!per_vq_vectors) + desc = NULL; + if (desc) { flags |= PCI_IRQ_AFFINITY; desc->pre_vectors++; /* virtio config vector */ @@ -349,8 +352,7 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned int nvqs, nvectors = 2; } - err = vp_request_msix_vectors(vdev, nvectors, per_vq_vectors, - per_vq_vectors ? desc : NULL); + err = vp_request_msix_vectors(vdev, nvectors, per_vq_vectors, desc); if (err) goto error_find; |