public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipack: Remove usage of the deprecated ida_simple_xx() API
@ 2023-11-01  9:41 Christophe JAILLET
  2023-11-07  7:04 ` Vaibhav Gupta
  0 siblings, 1 reply; 3+ messages in thread
From: Christophe JAILLET @ 2023-11-01  9:41 UTC (permalink / raw)
  To: Vaibhav Gupta, Jens Taprogge, Greg Kroah-Hartman
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET,
	industrypack-devel

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/ipack/ipack.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ipack/ipack.c b/drivers/ipack/ipack.c
index cc1ecfd49928..b1471ba016a5 100644
--- a/drivers/ipack/ipack.c
+++ b/drivers/ipack/ipack.c
@@ -207,7 +207,7 @@ struct ipack_bus_device *ipack_bus_register(struct device *parent, int slots,
 	if (!bus)
 		return NULL;
 
-	bus_nr = ida_simple_get(&ipack_ida, 0, 0, GFP_KERNEL);
+	bus_nr = ida_alloc(&ipack_ida, GFP_KERNEL);
 	if (bus_nr < 0) {
 		kfree(bus);
 		return NULL;
@@ -237,7 +237,7 @@ int ipack_bus_unregister(struct ipack_bus_device *bus)
 {
 	bus_for_each_dev(&ipack_bus_type, NULL, bus,
 		ipack_unregister_bus_member);
-	ida_simple_remove(&ipack_ida, bus->bus_nr);
+	ida_free(&ipack_ida, bus->bus_nr);
 	kfree(bus);
 	return 0;
 }
-- 
2.34.1


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

* Re: [PATCH] ipack: Remove usage of the deprecated ida_simple_xx() API
  2023-11-01  9:41 [PATCH] ipack: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
@ 2023-11-07  7:04 ` Vaibhav Gupta
  2023-11-07  7:20   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Vaibhav Gupta @ 2023-11-07  7:04 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Jens Taprogge, Greg Kroah-Hartman, linux-kernel, kernel-janitors,
	industrypack-devel

Hello Christophe,
Thank you for your patch.

Acked-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>

Hey Greg, could you please add this patch to your misc tree?

Thanks,
Vaibhav

On Wed, Nov 1, 2023 at 10:41 AM Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
>
> 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/ipack/ipack.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ipack/ipack.c b/drivers/ipack/ipack.c
> index cc1ecfd49928..b1471ba016a5 100644
> --- a/drivers/ipack/ipack.c
> +++ b/drivers/ipack/ipack.c
> @@ -207,7 +207,7 @@ struct ipack_bus_device *ipack_bus_register(struct device *parent, int slots,
>         if (!bus)
>                 return NULL;
>
> -       bus_nr = ida_simple_get(&ipack_ida, 0, 0, GFP_KERNEL);
> +       bus_nr = ida_alloc(&ipack_ida, GFP_KERNEL);
>         if (bus_nr < 0) {
>                 kfree(bus);
>                 return NULL;
> @@ -237,7 +237,7 @@ int ipack_bus_unregister(struct ipack_bus_device *bus)
>  {
>         bus_for_each_dev(&ipack_bus_type, NULL, bus,
>                 ipack_unregister_bus_member);
> -       ida_simple_remove(&ipack_ida, bus->bus_nr);
> +       ida_free(&ipack_ida, bus->bus_nr);
>         kfree(bus);
>         return 0;
>  }
> --
> 2.34.1
>

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

* Re: [PATCH] ipack: Remove usage of the deprecated ida_simple_xx() API
  2023-11-07  7:04 ` Vaibhav Gupta
@ 2023-11-07  7:20   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2023-11-07  7:20 UTC (permalink / raw)
  To: Vaibhav Gupta
  Cc: Christophe JAILLET, Jens Taprogge, linux-kernel, kernel-janitors,
	industrypack-devel

On Tue, Nov 07, 2023 at 08:04:45AM +0100, Vaibhav Gupta wrote:
> Hello Christophe,
> Thank you for your patch.
> 
> Acked-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
> 
> Hey Greg, could you please add this patch to your misc tree?

Will do after -rc1 is out.

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

end of thread, other threads:[~2023-11-07  7:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-01  9:41 [PATCH] ipack: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2023-11-07  7:04 ` Vaibhav Gupta
2023-11-07  7:20   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox