All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <mani@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: "Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH] misc: pci_endpoint_test: Remove usage of the deprecated ida_simple_xx() API
Date: Wed, 20 Dec 2023 17:15:10 +0530	[thread overview]
Message-ID: <20231220114510.GD3544@thinkpad> (raw)
In-Reply-To: <47a30441242c4d5f0e00555cbddd7783350ff1b2.1702966523.git.christophe.jaillet@wanadoo.fr>

On Tue, Dec 19, 2023 at 07:15:37AM +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.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

- Mani

> ---
>  drivers/misc/pci_endpoint_test.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
> index af519088732d..34124bdce68c 100644
> --- a/drivers/misc/pci_endpoint_test.c
> +++ b/drivers/misc/pci_endpoint_test.c
> @@ -860,7 +860,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev,
>  
>  	pci_set_drvdata(pdev, test);
>  
> -	id = ida_simple_get(&pci_endpoint_test_ida, 0, 0, GFP_KERNEL);
> +	id = ida_alloc(&pci_endpoint_test_ida, GFP_KERNEL);
>  	if (id < 0) {
>  		err = id;
>  		dev_err(dev, "Unable to get id\n");
> @@ -907,7 +907,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev,
>  	kfree(test->name);
>  
>  err_ida_remove:
> -	ida_simple_remove(&pci_endpoint_test_ida, id);
> +	ida_free(&pci_endpoint_test_ida, id);
>  
>  err_iounmap:
>  	for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
> @@ -943,7 +943,7 @@ static void pci_endpoint_test_remove(struct pci_dev *pdev)
>  	misc_deregister(&test->miscdev);
>  	kfree(misc_device->name);
>  	kfree(test->name);
> -	ida_simple_remove(&pci_endpoint_test_ida, id);
> +	ida_free(&pci_endpoint_test_ida, id);
>  	for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
>  		if (test->bar[bar])
>  			pci_iounmap(pdev, test->bar[bar]);
> -- 
> 2.34.1
> 

-- 
மணிவண்ணன் சதாசிவம்

  reply	other threads:[~2023-12-20 11:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19  6:15 [PATCH] misc: pci_endpoint_test: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2023-12-20 11:45 ` Manivannan Sadhasivam [this message]
2023-12-31 11:16 ` Krzysztof Wilczyński

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=20231220114510.GD3544@thinkpad \
    --to=mani@kernel.org \
    --cc=arnd@arndb.de \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    /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 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.