* [PATCH] most: Remove usage of the deprecated ida_simple_xx() API
@ 2023-12-11 20:31 Christophe JAILLET
2024-02-08 17:58 ` Christophe JAILLET
2024-02-09 8:53 ` Parthiban.Veerasooran
0 siblings, 2 replies; 4+ messages in thread
From: Christophe JAILLET @ 2023-12-11 20:31 UTC (permalink / raw)
To: Parthiban Veerasooran, Christian Gromm
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/most/core.c | 10 +++++-----
drivers/most/most_cdev.c | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/most/core.c b/drivers/most/core.c
index e4412c7d25b0..81d60d4ee8c2 100644
--- a/drivers/most/core.c
+++ b/drivers/most/core.c
@@ -1286,7 +1286,7 @@ int most_register_interface(struct most_interface *iface)
!iface->poison_channel || (iface->num_channels > MAX_CHANNELS))
return -EINVAL;
- id = ida_simple_get(&mdev_id, 0, 0, GFP_KERNEL);
+ id = ida_alloc(&mdev_id, GFP_KERNEL);
if (id < 0) {
dev_err(iface->dev, "Failed to allocate device ID\n");
return id;
@@ -1294,7 +1294,7 @@ int most_register_interface(struct most_interface *iface)
iface->p = kzalloc(sizeof(*iface->p), GFP_KERNEL);
if (!iface->p) {
- ida_simple_remove(&mdev_id, id);
+ ida_free(&mdev_id, id);
return -ENOMEM;
}
@@ -1308,7 +1308,7 @@ int most_register_interface(struct most_interface *iface)
dev_err(iface->dev, "Failed to register interface device\n");
kfree(iface->p);
put_device(iface->dev);
- ida_simple_remove(&mdev_id, id);
+ ida_free(&mdev_id, id);
return -ENOMEM;
}
@@ -1366,7 +1366,7 @@ int most_register_interface(struct most_interface *iface)
}
kfree(iface->p);
device_unregister(iface->dev);
- ida_simple_remove(&mdev_id, id);
+ ida_free(&mdev_id, id);
return -ENOMEM;
}
EXPORT_SYMBOL_GPL(most_register_interface);
@@ -1397,7 +1397,7 @@ void most_deregister_interface(struct most_interface *iface)
device_unregister(&c->dev);
}
- ida_simple_remove(&mdev_id, iface->p->dev_id);
+ ida_free(&mdev_id, iface->p->dev_id);
kfree(iface->p);
device_unregister(iface->dev);
}
diff --git a/drivers/most/most_cdev.c b/drivers/most/most_cdev.c
index 3ed8f461e01e..b9423f82373d 100644
--- a/drivers/most/most_cdev.c
+++ b/drivers/most/most_cdev.c
@@ -100,7 +100,7 @@ static void destroy_cdev(struct comp_channel *c)
static void destroy_channel(struct comp_channel *c)
{
- ida_simple_remove(&comp.minor_id, MINOR(c->devno));
+ ida_free(&comp.minor_id, MINOR(c->devno));
kfifo_free(&c->fifo);
kfree(c);
}
@@ -425,7 +425,7 @@ static int comp_probe(struct most_interface *iface, int channel_id,
if (c)
return -EEXIST;
- current_minor = ida_simple_get(&comp.minor_id, 0, 0, GFP_KERNEL);
+ current_minor = ida_alloc(&comp.minor_id, GFP_KERNEL);
if (current_minor < 0)
return current_minor;
@@ -472,7 +472,7 @@ static int comp_probe(struct most_interface *iface, int channel_id,
err_free_c:
kfree(c);
err_remove_ida:
- ida_simple_remove(&comp.minor_id, current_minor);
+ ida_free(&comp.minor_id, current_minor);
return retval;
}
--
2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] most: Remove usage of the deprecated ida_simple_xx() API
2023-12-11 20:31 [PATCH] most: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
@ 2024-02-08 17:58 ` Christophe JAILLET
2024-02-09 8:53 ` Parthiban.Veerasooran
1 sibling, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2024-02-08 17:58 UTC (permalink / raw)
To: Parthiban Veerasooran, Christian Gromm; +Cc: linux-kernel, kernel-janitors
Le 11/12/2023 à 21:31, 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/most/core.c | 10 +++++-----
> drivers/most/most_cdev.c | 6 +++---
> 2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/most/core.c b/drivers/most/core.c
> index e4412c7d25b0..81d60d4ee8c2 100644
> --- a/drivers/most/core.c
> +++ b/drivers/most/core.c
> @@ -1286,7 +1286,7 @@ int most_register_interface(struct most_interface *iface)
> !iface->poison_channel || (iface->num_channels > MAX_CHANNELS))
> return -EINVAL;
>
> - id = ida_simple_get(&mdev_id, 0, 0, GFP_KERNEL);
> + id = ida_alloc(&mdev_id, GFP_KERNEL);
> if (id < 0) {
> dev_err(iface->dev, "Failed to allocate device ID\n");
> return id;
> @@ -1294,7 +1294,7 @@ int most_register_interface(struct most_interface *iface)
>
> iface->p = kzalloc(sizeof(*iface->p), GFP_KERNEL);
> if (!iface->p) {
> - ida_simple_remove(&mdev_id, id);
> + ida_free(&mdev_id, id);
> return -ENOMEM;
> }
>
> @@ -1308,7 +1308,7 @@ int most_register_interface(struct most_interface *iface)
> dev_err(iface->dev, "Failed to register interface device\n");
> kfree(iface->p);
> put_device(iface->dev);
> - ida_simple_remove(&mdev_id, id);
> + ida_free(&mdev_id, id);
> return -ENOMEM;
> }
>
> @@ -1366,7 +1366,7 @@ int most_register_interface(struct most_interface *iface)
> }
> kfree(iface->p);
> device_unregister(iface->dev);
> - ida_simple_remove(&mdev_id, id);
> + ida_free(&mdev_id, id);
> return -ENOMEM;
> }
> EXPORT_SYMBOL_GPL(most_register_interface);
> @@ -1397,7 +1397,7 @@ void most_deregister_interface(struct most_interface *iface)
> device_unregister(&c->dev);
> }
>
> - ida_simple_remove(&mdev_id, iface->p->dev_id);
> + ida_free(&mdev_id, iface->p->dev_id);
> kfree(iface->p);
> device_unregister(iface->dev);
> }
> diff --git a/drivers/most/most_cdev.c b/drivers/most/most_cdev.c
> index 3ed8f461e01e..b9423f82373d 100644
> --- a/drivers/most/most_cdev.c
> +++ b/drivers/most/most_cdev.c
> @@ -100,7 +100,7 @@ static void destroy_cdev(struct comp_channel *c)
>
> static void destroy_channel(struct comp_channel *c)
> {
> - ida_simple_remove(&comp.minor_id, MINOR(c->devno));
> + ida_free(&comp.minor_id, MINOR(c->devno));
> kfifo_free(&c->fifo);
> kfree(c);
> }
> @@ -425,7 +425,7 @@ static int comp_probe(struct most_interface *iface, int channel_id,
> if (c)
> return -EEXIST;
>
> - current_minor = ida_simple_get(&comp.minor_id, 0, 0, GFP_KERNEL);
> + current_minor = ida_alloc(&comp.minor_id, GFP_KERNEL);
> if (current_minor < 0)
> return current_minor;
>
> @@ -472,7 +472,7 @@ static int comp_probe(struct most_interface *iface, int channel_id,
> err_free_c:
> kfree(c);
> err_remove_ida:
> - ida_simple_remove(&comp.minor_id, current_minor);
> + ida_free(&comp.minor_id, current_minor);
> return retval;
> }
>
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] 4+ messages in thread
* Re: [PATCH] most: Remove usage of the deprecated ida_simple_xx() API
2023-12-11 20:31 [PATCH] most: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2024-02-08 17:58 ` Christophe JAILLET
@ 2024-02-09 8:53 ` Parthiban.Veerasooran
2024-04-14 8:27 ` Christophe JAILLET
1 sibling, 1 reply; 4+ messages in thread
From: Parthiban.Veerasooran @ 2024-02-09 8:53 UTC (permalink / raw)
To: christophe.jaillet, Christian.Gromm; +Cc: linux-kernel, kernel-janitors
On 12/12/23 2:01 am, Christophe JAILLET wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> 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>
Acked-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] most: Remove usage of the deprecated ida_simple_xx() API
2024-02-09 8:53 ` Parthiban.Veerasooran
@ 2024-04-14 8:27 ` Christophe JAILLET
0 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2024-04-14 8:27 UTC (permalink / raw)
To: Parthiban.Veerasooran, Christian.Gromm; +Cc: linux-kernel, kernel-janitors
Le 09/02/2024 à 09:53, Parthiban.Veerasooran@microchip.com a écrit :
> On 12/12/23 2:01 am, Christophe JAILLET wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>
>> 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>
>
> Acked-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
>
Hi,
polite reminder ;-)
CJ
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-04-14 8:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-11 20:31 [PATCH] most: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2024-02-08 17:58 ` Christophe JAILLET
2024-02-09 8:53 ` Parthiban.Veerasooran
2024-04-14 8:27 ` Christophe JAILLET
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®