linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: Remove usage of the deprecated ida_simple_xxx API
@ 2022-06-17  2:04 Bo Liu
  2022-06-28  3:24 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Bo Liu @ 2022-06-17  2:04 UTC (permalink / raw)
  To: fujita.tomonori, axboe; +Cc: linux-scsi, linux-block, linux-kernel, Bo Liu

Use ida_alloc_xxx()/ida_free() instead of
ida_simple_get()/ida_simple_remove().
The latter is deprecated and more verbose.

Signed-off-by: Bo Liu <liubo03@inspur.com>
---
 block/bsg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/bsg.c b/block/bsg.c
index 882f56bff14f..2ab1351eb082 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -169,7 +169,7 @@ static void bsg_device_release(struct device *dev)
 {
 	struct bsg_device *bd = container_of(dev, struct bsg_device, device);
 
-	ida_simple_remove(&bsg_minor_ida, MINOR(bd->device.devt));
+	ida_free(&bsg_minor_ida, MINOR(bd->device.devt));
 	kfree(bd);
 }
 
@@ -196,7 +196,7 @@ struct bsg_device *bsg_register_queue(struct request_queue *q,
 	bd->queue = q;
 	bd->sg_io_fn = sg_io_fn;
 
-	ret = ida_simple_get(&bsg_minor_ida, 0, BSG_MAX_DEVS, GFP_KERNEL);
+	ret = ida_alloc_max(&bsg_minor_ida, BSG_MAX_DEVS - 1, GFP_KERNEL);
 	if (ret < 0) {
 		if (ret == -ENOSPC)
 			dev_err(parent, "bsg: too many bsg devices\n");
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: Remove usage of the deprecated ida_simple_xxx API
  2022-06-17  2:04 [PATCH] scsi: Remove usage of the deprecated ida_simple_xxx API Bo Liu
@ 2022-06-28  3:24 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2022-06-28  3:24 UTC (permalink / raw)
  To: axboe, Bo Liu, fujita.tomonori
  Cc: Martin K . Petersen, linux-block, linux-kernel, linux-scsi

On Thu, 16 Jun 2022 22:04:30 -0400, Bo Liu wrote:

> Use ida_alloc_xxx()/ida_free() instead of
> ida_simple_get()/ida_simple_remove().
> The latter is deprecated and more verbose.
> 
> 

Applied to 5.20/scsi-queue, thanks!

[1/1] scsi: Remove usage of the deprecated ida_simple_xxx API
      https://git.kernel.org/mkp/scsi/c/873cdda193fc

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-28  3:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-17  2:04 [PATCH] scsi: Remove usage of the deprecated ida_simple_xxx API Bo Liu
2022-06-28  3:24 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).