mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Bo Liu <liubo03@inspur.com>, johan@kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gnss: Remove usage of the deprecated ida_simple_xxx API
Date: Thu, 16 Jun 2022 21:18:37 +0200	[thread overview]
Message-ID: <0ce75f78-4a67-efce-938f-634dc981fbd6@wanadoo.fr> (raw)
In-Reply-To: <20220616044733.3605-1-liubo03@inspur.com>

Le 16/06/2022 à 06:47, Bo Liu a écrit :
> Use ida_alloc_xxx()/ida_free() instead of
> ida_simple_get()/ida_simple_remove().
> The latter is deprecated and more verbose.
> 
> Signed-off-by: Bo Liu <liubo03@inspur.com>

Hi,

even if a more detailed description about the reason of the added -1 
would be welcomed:

Reviewed-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

> ---
>   drivers/gnss/core.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gnss/core.c b/drivers/gnss/core.c
> index e6f94501cb28..1e82b7967570 100644
> --- a/drivers/gnss/core.c
> +++ b/drivers/gnss/core.c
> @@ -217,7 +217,7 @@ static void gnss_device_release(struct device *dev)
>   
>   	kfree(gdev->write_buf);
>   	kfifo_free(&gdev->read_fifo);
> -	ida_simple_remove(&gnss_minors, gdev->id);
> +	ida_free(&gnss_minors, gdev->id);
>   	kfree(gdev);
>   }
>   
> @@ -232,7 +232,7 @@ struct gnss_device *gnss_allocate_device(struct device *parent)
>   	if (!gdev)
>   		return NULL;
>   
> -	id = ida_simple_get(&gnss_minors, 0, GNSS_MINORS, GFP_KERNEL);
> +	id = ida_alloc_max(&gnss_minors, GNSS_MINORS - 1, GFP_KERNEL);
>   	if (id < 0) {
>   		kfree(gdev);
>   		return NULL;


  reply	other threads:[~2022-06-16 19:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16  4:47 Bo Liu
2022-06-16 19:18 ` Christophe JAILLET [this message]
2022-06-21  7:34   ` Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ce75f78-4a67-efce-938f-634dc981fbd6@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liubo03@inspur.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®