[PATCH] null_blk: Remove usage of the deprecated ida_simple_xx() API

Christophe JAILLET posted 1 patch 1 year, 11 months ago
drivers/block/null_blk/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] null_blk: Remove usage of the deprecated ida_simple_xx() API
Posted by Christophe JAILLET 1 year, 11 months ago
ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

This is less verbose.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/block/null_blk/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index b1271de64d36..293f24cc4122 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -1825,7 +1825,7 @@ static void null_del_dev(struct nullb *nullb)
 
 	dev = nullb->dev;
 
-	ida_simple_remove(&nullb_indexes, nullb->index);
+	ida_free(&nullb_indexes, nullb->index);
 
 	list_del_init(&nullb->list);
 
@@ -2159,7 +2159,7 @@ static int null_add_dev(struct nullb_device *dev)
 	blk_queue_flag_set(QUEUE_FLAG_NONROT, nullb->q);
 
 	mutex_lock(&lock);
-	rv = ida_simple_get(&nullb_indexes, 0, 0, GFP_KERNEL);
+	rv = ida_alloc(&nullb_indexes, GFP_KERNEL);
 	if (rv < 0) {
 		mutex_unlock(&lock);
 		goto out_cleanup_zone;
-- 
2.43.0
Re: [PATCH] null_blk: Remove usage of the deprecated ida_simple_xx() API
Posted by Jens Axboe 1 year, 11 months ago
On Sun, 14 Jan 2024 10:00:59 +0100, Christophe JAILLET wrote:
> ida_alloc() and ida_free() should be preferred to the deprecated
> ida_simple_get() and ida_simple_remove().
> 
> This is less verbose.
> 
> 

Applied, thanks!

[1/1] null_blk: Remove usage of the deprecated ida_simple_xx() API
      commit: 95931a245b44ee04f3359ec432e73614d44d8b38

Best regards,
-- 
Jens Axboe