* [PATCH] ipmi: Remove usage of the deprecated ida_simple_xx() API
@ 2023-12-19 5:00 Christophe JAILLET
2023-12-19 12:34 ` Corey Minyard
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2023-12-19 5:00 UTC (permalink / raw)
To: Corey Minyard
Cc: linux-kernel, kernel-janitors, Christophe JAILLET,
openipmi-developer
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/char/ipmi/ipmi_msghandler.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index d6f14279684d..b0eedc4595b3 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -3053,7 +3053,7 @@ static void cleanup_bmc_work(struct work_struct *work)
int id = bmc->pdev.id; /* Unregister overwrites id */
platform_device_unregister(&bmc->pdev);
- ida_simple_remove(&ipmi_bmc_ida, id);
+ ida_free(&ipmi_bmc_ida, id);
}
static void
@@ -3169,7 +3169,7 @@ static int __ipmi_bmc_register(struct ipmi_smi *intf,
bmc->pdev.name = "ipmi_bmc";
- rv = ida_simple_get(&ipmi_bmc_ida, 0, 0, GFP_KERNEL);
+ rv = ida_alloc(&ipmi_bmc_ida, GFP_KERNEL);
if (rv < 0) {
kfree(bmc);
goto out;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ipmi: Remove usage of the deprecated ida_simple_xx() API
2023-12-19 5:00 [PATCH] ipmi: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
@ 2023-12-19 12:34 ` Corey Minyard
0 siblings, 0 replies; 2+ messages in thread
From: Corey Minyard @ 2023-12-19 12:34 UTC (permalink / raw)
To: Christophe JAILLET; +Cc: linux-kernel, kernel-janitors, openipmi-developer
On Tue, Dec 19, 2023 at 06:00:39AM +0100, Christophe JAILLET wrote:
> ida_alloc() and ida_free() should be preferred to the deprecated
> ida_simple_get() and ida_simple_remove().
>
> This is less verbose.
Thanks, queued for next release.
-corey
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/char/ipmi/ipmi_msghandler.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
> index d6f14279684d..b0eedc4595b3 100644
> --- a/drivers/char/ipmi/ipmi_msghandler.c
> +++ b/drivers/char/ipmi/ipmi_msghandler.c
> @@ -3053,7 +3053,7 @@ static void cleanup_bmc_work(struct work_struct *work)
> int id = bmc->pdev.id; /* Unregister overwrites id */
>
> platform_device_unregister(&bmc->pdev);
> - ida_simple_remove(&ipmi_bmc_ida, id);
> + ida_free(&ipmi_bmc_ida, id);
> }
>
> static void
> @@ -3169,7 +3169,7 @@ static int __ipmi_bmc_register(struct ipmi_smi *intf,
>
> bmc->pdev.name = "ipmi_bmc";
>
> - rv = ida_simple_get(&ipmi_bmc_ida, 0, 0, GFP_KERNEL);
> + rv = ida_alloc(&ipmi_bmc_ida, GFP_KERNEL);
> if (rv < 0) {
> kfree(bmc);
> goto out;
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-12-19 12:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-19 5:00 [PATCH] ipmi: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2023-12-19 12:34 ` Corey Minyard
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.