]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
virtio_pci: simplify vp_request_msix_vectors() call a bit
authorJiri Pirko <jiri@nvidia.com>
Tue, 16 Jul 2024 11:35:41 +0000 (13:35 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 17 Jul 2024 09:43:20 +0000 (05:43 -0400)
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>
drivers/virtio/virtio_pci_common.c

index 277591a6ab96eda58269f2227bafff27a44264d8..cda0d35dd9e13321fabcfd851eaa99c436f948bc 100644 (file)
@@ -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;