linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mux: Remove usage of the deprecated ida_simple_xx() API
@ 2023-12-10 17:17 Christophe JAILLET
  2024-02-08 17:57 ` Christophe JAILLET
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2023-12-10 17:17 UTC (permalink / raw)
  To: Peter Rosin; +Cc: linux-kernel, kernel-janitors, Christophe JAILLET

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

diff --git a/drivers/mux/core.c b/drivers/mux/core.c
index 775816112932..78c0022697ec 100644
--- a/drivers/mux/core.c
+++ b/drivers/mux/core.c
@@ -64,7 +64,7 @@ static void mux_chip_release(struct device *dev)
 {
 	struct mux_chip *mux_chip = to_mux_chip(dev);
 
-	ida_simple_remove(&mux_ida, mux_chip->id);
+	ida_free(&mux_ida, mux_chip->id);
 	kfree(mux_chip);
 }
 
@@ -111,7 +111,7 @@ struct mux_chip *mux_chip_alloc(struct device *dev,
 	mux_chip->dev.of_node = dev->of_node;
 	dev_set_drvdata(&mux_chip->dev, mux_chip);
 
-	mux_chip->id = ida_simple_get(&mux_ida, 0, 0, GFP_KERNEL);
+	mux_chip->id = ida_alloc(&mux_ida, GFP_KERNEL);
 	if (mux_chip->id < 0) {
 		int err = mux_chip->id;
 
-- 
2.34.1


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

* Re: [PATCH] mux: Remove usage of the deprecated ida_simple_xx() API
  2023-12-10 17:17 [PATCH] mux: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
@ 2024-02-08 17:57 ` Christophe JAILLET
  0 siblings, 0 replies; 2+ messages in thread
From: Christophe JAILLET @ 2024-02-08 17:57 UTC (permalink / raw)
  To: Peter Rosin; +Cc: linux-kernel, kernel-janitors

Le 10/12/2023 à 18:17, Christophe JAILLET a écrit :
> 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/mux/core.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mux/core.c b/drivers/mux/core.c
> index 775816112932..78c0022697ec 100644
> --- a/drivers/mux/core.c
> +++ b/drivers/mux/core.c
> @@ -64,7 +64,7 @@ static void mux_chip_release(struct device *dev)
>   {
>   	struct mux_chip *mux_chip = to_mux_chip(dev);
>   
> -	ida_simple_remove(&mux_ida, mux_chip->id);
> +	ida_free(&mux_ida, mux_chip->id);
>   	kfree(mux_chip);
>   }
>   
> @@ -111,7 +111,7 @@ struct mux_chip *mux_chip_alloc(struct device *dev,
>   	mux_chip->dev.of_node = dev->of_node;
>   	dev_set_drvdata(&mux_chip->dev, mux_chip);
>   
> -	mux_chip->id = ida_simple_get(&mux_ida, 0, 0, GFP_KERNEL);
> +	mux_chip->id = ida_alloc(&mux_ida, GFP_KERNEL);
>   	if (mux_chip->id < 0) {
>   		int err = mux_chip->id;
>   

Hi,

gentle reminder.

All patches to remove the ida_simple API have been sent.
And Matthew Wilcox seems happy with the on going work. (see [1])

Based on next-20240207
$git grep ida_simple_get | wc -l
38

https://elixir.bootlin.com/linux/v6.8-rc3/A/ident/ida_simple_get
50

https://elixir.bootlin.com/linux/v6.7.4/A/ident/ida_simple_get
81

Thanks
CJ

[1]: https://lore.kernel.org/all/ZaqruGVz734zjxrZ@casper.infradead.org/

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

end of thread, other threads:[~2024-02-08 17:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-10 17:17 [PATCH] mux: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2024-02-08 17:57 ` Christophe JAILLET

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).