Skip to content

Commit 572864d

Browse files
Jiri Pirkomstsirkin
authored andcommitted
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 <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent de128f3 commit 572864d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/virtio/virtio_pci_common.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors,
125125
GFP_KERNEL))
126126
goto error;
127127

128+
if (!per_vq_vectors)
129+
desc = NULL;
130+
128131
if (desc) {
129132
flags |= PCI_IRQ_AFFINITY;
130133
desc->pre_vectors++; /* virtio config vector */
@@ -349,8 +352,7 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned int nvqs,
349352
nvectors = 2;
350353
}
351354

352-
err = vp_request_msix_vectors(vdev, nvectors, per_vq_vectors,
353-
per_vq_vectors ? desc : NULL);
355+
err = vp_request_msix_vectors(vdev, nvectors, per_vq_vectors, desc);
354356
if (err)
355357
goto error_find;
356358

0 commit comments

Comments
 (0)