Skip to content

Commit 6a39bb1

Browse files
ColinIanKingmstsirkin
authored andcommitted
virtio_vdpa: remove redundant check on desc
The boolean variable has_affinity is true when desc is non-null and ops->set_vq_affinity is non-null. Hence the call to create_affinity_masks does not need to check for desc being non-null is redundant when has_affinity is true, so it can be removed as well as the now unused default_affd. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Message-Id: <20241107132114.22188-1-colin.i.king@gmail.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Eugenio Pérez <eperezma@redhat.com>
1 parent df28040 commit 6a39bb1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/virtio/virtio_vdpa.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,13 @@ static int virtio_vdpa_find_vqs(struct virtio_device *vdev, unsigned int nvqs,
364364
struct virtio_vdpa_device *vd_dev = to_virtio_vdpa_device(vdev);
365365
struct vdpa_device *vdpa = vd_get_vdpa(vdev);
366366
const struct vdpa_config_ops *ops = vdpa->config;
367-
struct irq_affinity default_affd = { 0 };
368367
struct cpumask *masks;
369368
struct vdpa_callback cb;
370369
bool has_affinity = desc && ops->set_vq_affinity;
371370
int i, err, queue_idx = 0;
372371

373372
if (has_affinity) {
374-
masks = create_affinity_masks(nvqs, desc ? desc : &default_affd);
373+
masks = create_affinity_masks(nvqs, desc);
375374
if (!masks)
376375
return -ENOMEM;
377376
}

0 commit comments

Comments
 (0)