All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firmware: arm_scmi: Remove usage of the deprecated ida_simple_xxx API
@ 2022-06-16  5:50 ` Bo Liu
  0 siblings, 0 replies; 6+ messages in thread
From: Bo Liu @ 2022-06-16  5:50 UTC (permalink / raw)
  To: sudeep.holla, cristian.marussi; +Cc: linux-arm-kernel, 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>
---
 drivers/firmware/arm_scmi/bus.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
index f6fe723ab869..d4e23101448a 100644
--- a/drivers/firmware/arm_scmi/bus.c
+++ b/drivers/firmware/arm_scmi/bus.c
@@ -181,7 +181,7 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol,
 		return NULL;
 	}
 
-	id = ida_simple_get(&scmi_bus_id, 1, 0, GFP_KERNEL);
+	id = ida_alloc_min(&scmi_bus_id, 1, GFP_KERNEL);
 	if (id < 0) {
 		kfree_const(scmi_dev->name);
 		kfree(scmi_dev);
@@ -204,7 +204,7 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol,
 put_dev:
 	kfree_const(scmi_dev->name);
 	put_device(&scmi_dev->dev);
-	ida_simple_remove(&scmi_bus_id, id);
+	ida_free(&scmi_bus_id, id);
 	return NULL;
 }
 
@@ -212,7 +212,7 @@ void scmi_device_destroy(struct scmi_device *scmi_dev)
 {
 	kfree_const(scmi_dev->name);
 	scmi_handle_put(scmi_dev->handle);
-	ida_simple_remove(&scmi_bus_id, scmi_dev->id);
+	ida_free(&scmi_bus_id, scmi_dev->id);
 	device_unregister(&scmi_dev->dev);
 }
 
-- 
2.27.0


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

* [PATCH] firmware: arm_scmi: Remove usage of the deprecated ida_simple_xxx API
@ 2022-06-16  5:50 ` Bo Liu
  0 siblings, 0 replies; 6+ messages in thread
From: Bo Liu @ 2022-06-16  5:50 UTC (permalink / raw)
  To: sudeep.holla, cristian.marussi; +Cc: linux-arm-kernel, 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>
---
 drivers/firmware/arm_scmi/bus.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
index f6fe723ab869..d4e23101448a 100644
--- a/drivers/firmware/arm_scmi/bus.c
+++ b/drivers/firmware/arm_scmi/bus.c
@@ -181,7 +181,7 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol,
 		return NULL;
 	}
 
-	id = ida_simple_get(&scmi_bus_id, 1, 0, GFP_KERNEL);
+	id = ida_alloc_min(&scmi_bus_id, 1, GFP_KERNEL);
 	if (id < 0) {
 		kfree_const(scmi_dev->name);
 		kfree(scmi_dev);
@@ -204,7 +204,7 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol,
 put_dev:
 	kfree_const(scmi_dev->name);
 	put_device(&scmi_dev->dev);
-	ida_simple_remove(&scmi_bus_id, id);
+	ida_free(&scmi_bus_id, id);
 	return NULL;
 }
 
@@ -212,7 +212,7 @@ void scmi_device_destroy(struct scmi_device *scmi_dev)
 {
 	kfree_const(scmi_dev->name);
 	scmi_handle_put(scmi_dev->handle);
-	ida_simple_remove(&scmi_bus_id, scmi_dev->id);
+	ida_free(&scmi_bus_id, scmi_dev->id);
 	device_unregister(&scmi_dev->dev);
 }
 
-- 
2.27.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] firmware: arm_scmi: Remove usage of the deprecated ida_simple_xxx API
  2022-06-16  5:50 ` Bo Liu
@ 2022-06-27 11:54   ` Cristian Marussi
  -1 siblings, 0 replies; 6+ messages in thread
From: Cristian Marussi @ 2022-06-27 11:54 UTC (permalink / raw)
  To: Bo Liu; +Cc: sudeep.holla, linux-arm-kernel, linux-kernel

On Thu, Jun 16, 2022 at 01:50:52AM -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.
> 
> Signed-off-by: Bo Liu <liubo03@inspur.com>
> ---

Hi Bo,

I've missed this patch of yours and I recently posted something similar
using a bare ida_alloc() (so starting with id 0 instead).

Anyway AFAIU, Sudeep will pick up your patch with a small change to use
ida_alloc.

Thanks for this,
Cristian


>  drivers/firmware/arm_scmi/bus.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
> index f6fe723ab869..d4e23101448a 100644
> --- a/drivers/firmware/arm_scmi/bus.c
> +++ b/drivers/firmware/arm_scmi/bus.c
> @@ -181,7 +181,7 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol,
>  		return NULL;
>  	}
>  
> -	id = ida_simple_get(&scmi_bus_id, 1, 0, GFP_KERNEL);
> +	id = ida_alloc_min(&scmi_bus_id, 1, GFP_KERNEL);
>  	if (id < 0) {
>  		kfree_const(scmi_dev->name);
>  		kfree(scmi_dev);
> @@ -204,7 +204,7 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol,
>  put_dev:
>  	kfree_const(scmi_dev->name);
>  	put_device(&scmi_dev->dev);
> -	ida_simple_remove(&scmi_bus_id, id);
> +	ida_free(&scmi_bus_id, id);
>  	return NULL;
>  }
>  
> @@ -212,7 +212,7 @@ void scmi_device_destroy(struct scmi_device *scmi_dev)
>  {
>  	kfree_const(scmi_dev->name);
>  	scmi_handle_put(scmi_dev->handle);
> -	ida_simple_remove(&scmi_bus_id, scmi_dev->id);
> +	ida_free(&scmi_bus_id, scmi_dev->id);
>  	device_unregister(&scmi_dev->dev);
>  }
>  
> -- 
> 2.27.0
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] firmware: arm_scmi: Remove usage of the deprecated ida_simple_xxx API
@ 2022-06-27 11:54   ` Cristian Marussi
  0 siblings, 0 replies; 6+ messages in thread
From: Cristian Marussi @ 2022-06-27 11:54 UTC (permalink / raw)
  To: Bo Liu; +Cc: sudeep.holla, linux-arm-kernel, linux-kernel

On Thu, Jun 16, 2022 at 01:50:52AM -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.
> 
> Signed-off-by: Bo Liu <liubo03@inspur.com>
> ---

Hi Bo,

I've missed this patch of yours and I recently posted something similar
using a bare ida_alloc() (so starting with id 0 instead).

Anyway AFAIU, Sudeep will pick up your patch with a small change to use
ida_alloc.

Thanks for this,
Cristian


>  drivers/firmware/arm_scmi/bus.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
> index f6fe723ab869..d4e23101448a 100644
> --- a/drivers/firmware/arm_scmi/bus.c
> +++ b/drivers/firmware/arm_scmi/bus.c
> @@ -181,7 +181,7 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol,
>  		return NULL;
>  	}
>  
> -	id = ida_simple_get(&scmi_bus_id, 1, 0, GFP_KERNEL);
> +	id = ida_alloc_min(&scmi_bus_id, 1, GFP_KERNEL);
>  	if (id < 0) {
>  		kfree_const(scmi_dev->name);
>  		kfree(scmi_dev);
> @@ -204,7 +204,7 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol,
>  put_dev:
>  	kfree_const(scmi_dev->name);
>  	put_device(&scmi_dev->dev);
> -	ida_simple_remove(&scmi_bus_id, id);
> +	ida_free(&scmi_bus_id, id);
>  	return NULL;
>  }
>  
> @@ -212,7 +212,7 @@ void scmi_device_destroy(struct scmi_device *scmi_dev)
>  {
>  	kfree_const(scmi_dev->name);
>  	scmi_handle_put(scmi_dev->handle);
> -	ida_simple_remove(&scmi_bus_id, scmi_dev->id);
> +	ida_free(&scmi_bus_id, scmi_dev->id);
>  	device_unregister(&scmi_dev->dev);
>  }
>  
> -- 
> 2.27.0
> 

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

* Re: [PATCH] firmware: arm_scmi: Remove usage of the deprecated ida_simple_xxx API
  2022-06-16  5:50 ` Bo Liu
@ 2022-06-29 10:05   ` Sudeep Holla
  -1 siblings, 0 replies; 6+ messages in thread
From: Sudeep Holla @ 2022-06-29 10:05 UTC (permalink / raw)
  To: Bo Liu, cristian.marussi; +Cc: Sudeep Holla, linux-kernel, linux-arm-kernel

On Thu, 16 Jun 2022 01:50:52 -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 sudeep.holla/linux (for-next/scmi), thanks!

[1/1] firmware: arm_scmi: Remove usage of the deprecated ida_simple_xxx API
      https://git.kernel.org/sudeep.holla/c/4ce7e51dc7

--
Regards,
Sudeep


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

* Re: [PATCH] firmware: arm_scmi: Remove usage of the deprecated ida_simple_xxx API
@ 2022-06-29 10:05   ` Sudeep Holla
  0 siblings, 0 replies; 6+ messages in thread
From: Sudeep Holla @ 2022-06-29 10:05 UTC (permalink / raw)
  To: Bo Liu, cristian.marussi; +Cc: Sudeep Holla, linux-kernel, linux-arm-kernel

On Thu, 16 Jun 2022 01:50:52 -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 sudeep.holla/linux (for-next/scmi), thanks!

[1/1] firmware: arm_scmi: Remove usage of the deprecated ida_simple_xxx API
      https://git.kernel.org/sudeep.holla/c/4ce7e51dc7

--
Regards,
Sudeep


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-06-29 10:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-16  5:50 [PATCH] firmware: arm_scmi: Remove usage of the deprecated ida_simple_xxx API Bo Liu
2022-06-16  5:50 ` Bo Liu
2022-06-27 11:54 ` Cristian Marussi
2022-06-27 11:54   ` Cristian Marussi
2022-06-29 10:05 ` Sudeep Holla
2022-06-29 10:05   ` Sudeep Holla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.