virtio_blk: use UINT_MAX instead of -1U
authorAngus Chen <angus.chen@jaguarmicro.com>
Thu, 10 Nov 2022 03:01:23 +0000 (11:01 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 28 Dec 2022 10:28:10 +0000 (05:28 -0500)
We use UINT_MAX to limit max_discard_sectors in virtblk_probe,
we can use UINT_MAX to limit max_hw_sectors for consistencies.

No functional change intended.

Signed-off-by: Angus Chen <angus.chen@jaguarmicro.com>
Message-Id: <20221110030124.1986-1-angus.chen@jaguarmicro.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
drivers/block/virtio_blk.c

index 271a9878fa8b3555804faf59deb6a726c4c27541..dcbf86cd2155e196b40a4faae4bbfd3e9ef9d55f 100644 (file)
@@ -994,7 +994,7 @@ static int virtblk_probe(struct virtio_device *vdev)
        blk_queue_max_segments(q, sg_elems);
 
        /* No real sector limit. */
-       blk_queue_max_hw_sectors(q, -1U);
+       blk_queue_max_hw_sectors(q, UINT_MAX);
 
        max_size = virtio_max_dma_size(vdev);