]> Git Repo - linux.git/commitdiff
virtio_vdpa: remove redundant check on desc
authorColin Ian King <[email protected]>
Thu, 7 Nov 2024 13:21:14 +0000 (13:21 +0000)
committerMichael S. Tsirkin <[email protected]>
Tue, 12 Nov 2024 23:07:46 +0000 (18:07 -0500)
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 <[email protected]>
Message-Id: <20241107132114[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Eugenio PĂ©rez <[email protected]>
drivers/virtio/virtio_vdpa.c

index 7364bd53e38dd451923a1ed9414c050b6affda1f..1f60c9d5cb1810a6f208c24bb2ac640d537391a0 100644 (file)
@@ -364,14 +364,13 @@ static int virtio_vdpa_find_vqs(struct virtio_device *vdev, unsigned int nvqs,
        struct virtio_vdpa_device *vd_dev = to_virtio_vdpa_device(vdev);
        struct vdpa_device *vdpa = vd_get_vdpa(vdev);
        const struct vdpa_config_ops *ops = vdpa->config;
-       struct irq_affinity default_affd = { 0 };
        struct cpumask *masks;
        struct vdpa_callback cb;
        bool has_affinity = desc && ops->set_vq_affinity;
        int i, err, queue_idx = 0;
 
        if (has_affinity) {
-               masks = create_affinity_masks(nvqs, desc ? desc : &default_affd);
+               masks = create_affinity_masks(nvqs, desc);
                if (!masks)
                        return -ENOMEM;
        }
This page took 0.057375 seconds and 4 git commands to generate.