diff mbox series

[4/4] virtio-blk: remove deprecated ida_simple_XXX()

Message ID 20220420041053.7927-5-kch@nvidia.com (mailing list archive)
State New, archived
Headers show
Series virtio-blk: small cleanup | expand

Commit Message

Chaitanya Kulkarni April 20, 2022, 4:10 a.m. UTC
Replace deprecated ida_simple_get() and ida_simple_remove() with
ida_alloc_max() and ida_free().

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 drivers/block/virtio_blk.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Stefan Hajnoczi April 20, 2022, 3:19 p.m. UTC | #1
On Tue, Apr 19, 2022 at 09:10:53PM -0700, Chaitanya Kulkarni wrote:
> Replace deprecated ida_simple_get() and ida_simple_remove() with
> ida_alloc_max() and ida_free().
> 
> Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
> ---
>  drivers/block/virtio_blk.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
diff mbox series

Patch

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 74c3a48cd1e5..e05748337dd1 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -411,7 +411,7 @@  static void virtblk_free_disk(struct gendisk *disk)
 {
 	struct virtio_blk *vblk = disk->private_data;
 
-	ida_simple_remove(&vd_index_ida, vblk->index);
+	ida_free(&vd_index_ida, vblk->index);
 	mutex_destroy(&vblk->vdev_mutex);
 	kfree(vblk);
 }
@@ -720,8 +720,8 @@  static int virtblk_probe(struct virtio_device *vdev)
 		return -EINVAL;
 	}
 
-	err = ida_simple_get(&vd_index_ida, 0, minor_to_index(1 << MINORBITS),
-			     GFP_KERNEL);
+	err = ida_alloc_max(&vd_index_ida, minor_to_index(1 << MINORBITS),
+			    GFP_KERNEL);
 	if (err < 0)
 		goto out;
 	index = err;
@@ -911,7 +911,7 @@  static int virtblk_probe(struct virtio_device *vdev)
 out_free_vblk:
 	kfree(vblk);
 out_free_index:
-	ida_simple_remove(&vd_index_ida, index);
+	ida_free(&vd_index_ida, index);
 out:
 	return err;
 }