linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vdpa: Remove usage of the deprecated ida_simple_xx() API
@ 2023-12-10 17:51 Christophe JAILLET
  2023-12-20  3:52 ` Jason Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2023-12-10 17:51 UTC (permalink / raw)
  To: Michael S. Tsirkin, Jason Wang, Xuan Zhuo
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, virtualization

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

diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c
index a7612e0783b3..d0695680b282 100644
--- a/drivers/vdpa/vdpa.c
+++ b/drivers/vdpa/vdpa.c
@@ -131,7 +131,7 @@ static void vdpa_release_dev(struct device *d)
 	if (ops->free)
 		ops->free(vdev);
 
-	ida_simple_remove(&vdpa_index_ida, vdev->index);
+	ida_free(&vdpa_index_ida, vdev->index);
 	kfree(vdev->driver_override);
 	kfree(vdev);
 }
@@ -205,7 +205,7 @@ struct vdpa_device *__vdpa_alloc_device(struct device *parent,
 	return vdev;
 
 err_name:
-	ida_simple_remove(&vdpa_index_ida, vdev->index);
+	ida_free(&vdpa_index_ida, vdev->index);
 err_ida:
 	kfree(vdev);
 err:
-- 
2.34.1


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

* Re: [PATCH] vdpa: Remove usage of the deprecated ida_simple_xx() API
  2023-12-10 17:51 [PATCH] vdpa: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
@ 2023-12-20  3:52 ` Jason Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Wang @ 2023-12-20  3:52 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Michael S. Tsirkin, Xuan Zhuo, linux-kernel, kernel-janitors,
	virtualization

On Mon, Dec 11, 2023 at 1:52 AM Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
>
> 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: Jason Wang <jasowang@redhat.com>

Thanks

> ---
>  drivers/vdpa/vdpa.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c
> index a7612e0783b3..d0695680b282 100644
> --- a/drivers/vdpa/vdpa.c
> +++ b/drivers/vdpa/vdpa.c
> @@ -131,7 +131,7 @@ static void vdpa_release_dev(struct device *d)
>         if (ops->free)
>                 ops->free(vdev);
>
> -       ida_simple_remove(&vdpa_index_ida, vdev->index);
> +       ida_free(&vdpa_index_ida, vdev->index);
>         kfree(vdev->driver_override);
>         kfree(vdev);
>  }
> @@ -205,7 +205,7 @@ struct vdpa_device *__vdpa_alloc_device(struct device *parent,
>         return vdev;
>
>  err_name:
> -       ida_simple_remove(&vdpa_index_ida, vdev->index);
> +       ida_free(&vdpa_index_ida, vdev->index);
>  err_ida:
>         kfree(vdev);
>  err:
> --
> 2.34.1
>


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

end of thread, other threads:[~2023-12-20  3:53 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:51 [PATCH] vdpa: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2023-12-20  3:52 ` Jason Wang

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