* [PATCH] pps: Remove usage of the deprecated ida_simple_xx() API
@ 2023-12-10 17:41 Christophe JAILLET
2024-02-08 17:57 ` Christophe JAILLET
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2023-12-10 17:41 UTC (permalink / raw)
To: Rodolfo Giometti; +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/pps/clients/pps_parport.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pps/clients/pps_parport.c b/drivers/pps/clients/pps_parport.c
index 42f93d4c6ee3..af972cdc04b5 100644
--- a/drivers/pps/clients/pps_parport.c
+++ b/drivers/pps/clients/pps_parport.c
@@ -148,7 +148,7 @@ static void parport_attach(struct parport *port)
return;
}
- index = ida_simple_get(&pps_client_index, 0, 0, GFP_KERNEL);
+ index = ida_alloc(&pps_client_index, GFP_KERNEL);
memset(&pps_client_cb, 0, sizeof(pps_client_cb));
pps_client_cb.private = device;
pps_client_cb.irq_func = parport_irq;
@@ -188,7 +188,7 @@ static void parport_attach(struct parport *port)
err_unregister_dev:
parport_unregister_device(device->pardev);
err_free:
- ida_simple_remove(&pps_client_index, index);
+ ida_free(&pps_client_index, index);
kfree(device);
}
@@ -208,7 +208,7 @@ static void parport_detach(struct parport *port)
pps_unregister_source(device->pps);
parport_release(pardev);
parport_unregister_device(pardev);
- ida_simple_remove(&pps_client_index, device->index);
+ ida_free(&pps_client_index, device->index);
kfree(device);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pps: Remove usage of the deprecated ida_simple_xx() API
2023-12-10 17:41 [PATCH] pps: 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: Rodolfo Giometti; +Cc: linux-kernel, kernel-janitors
Le 10/12/2023 à 18:41, 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/pps/clients/pps_parport.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pps/clients/pps_parport.c b/drivers/pps/clients/pps_parport.c
> index 42f93d4c6ee3..af972cdc04b5 100644
> --- a/drivers/pps/clients/pps_parport.c
> +++ b/drivers/pps/clients/pps_parport.c
> @@ -148,7 +148,7 @@ static void parport_attach(struct parport *port)
> return;
> }
>
> - index = ida_simple_get(&pps_client_index, 0, 0, GFP_KERNEL);
> + index = ida_alloc(&pps_client_index, GFP_KERNEL);
> memset(&pps_client_cb, 0, sizeof(pps_client_cb));
> pps_client_cb.private = device;
> pps_client_cb.irq_func = parport_irq;
> @@ -188,7 +188,7 @@ static void parport_attach(struct parport *port)
> err_unregister_dev:
> parport_unregister_device(device->pardev);
> err_free:
> - ida_simple_remove(&pps_client_index, index);
> + ida_free(&pps_client_index, index);
> kfree(device);
> }
>
> @@ -208,7 +208,7 @@ static void parport_detach(struct parport *port)
> pps_unregister_source(device->pps);
> parport_release(pardev);
> parport_unregister_device(pardev);
> - ida_simple_remove(&pps_client_index, device->index);
> + ida_free(&pps_client_index, device->index);
> kfree(device);
> }
>
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:41 [PATCH] pps: 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).