* [PATCH] PCI: vmd: Remove usage of the deprecated ida_simple_xx() API
@ 2023-12-10 17:50 Christophe JAILLET
2023-12-13 19:26 ` Krzysztof Wilczyński
0 siblings, 1 reply; 3+ messages in thread
From: Christophe JAILLET @ 2023-12-10 17:50 UTC (permalink / raw)
To: Nirmal Patel, Jonathan Derrick, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-pci
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/pci/controller/vmd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index 94ba61fe1c44..00a4264711f1 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -984,7 +984,7 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
return -ENOMEM;
vmd->dev = dev;
- vmd->instance = ida_simple_get(&vmd_instance_ida, 0, 0, GFP_KERNEL);
+ vmd->instance = ida_alloc(&vmd_instance_ida, GFP_KERNEL);
if (vmd->instance < 0)
return vmd->instance;
@@ -1026,7 +1026,7 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
return 0;
out_release_instance:
- ida_simple_remove(&vmd_instance_ida, vmd->instance);
+ ida_free(&vmd_instance_ida, vmd->instance);
return err;
}
@@ -1048,7 +1048,7 @@ static void vmd_remove(struct pci_dev *dev)
vmd_cleanup_srcu(vmd);
vmd_detach_resources(vmd);
vmd_remove_irq_domain(vmd);
- ida_simple_remove(&vmd_instance_ida, vmd->instance);
+ ida_free(&vmd_instance_ida, vmd->instance);
}
static void vmd_shutdown(struct pci_dev *dev)
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI: vmd: Remove usage of the deprecated ida_simple_xx() API
2023-12-10 17:50 [PATCH] PCI: vmd: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
@ 2023-12-13 19:26 ` Krzysztof Wilczyński
2023-12-31 11:21 ` Krzysztof Wilczyński
0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Wilczyński @ 2023-12-13 19:26 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Nirmal Patel, Jonathan Derrick, Lorenzo Pieralisi, Rob Herring,
Bjorn Helgaas, linux-kernel, kernel-janitors, linux-pci
Hello,
> ida_alloc() and ida_free() should be preferred to the deprecated
> ida_simple_get() and ida_simple_remove().
>
> This is less verbose.
Applied to controller/vmd, thank you!
[1/1] PCI: vmd: Remove usage of the deprecated ida_simple_xx() API
https://git.kernel.org/pci/pci/c/991801bc4722
Krzysztof
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI: vmd: Remove usage of the deprecated ida_simple_xx() API
2023-12-13 19:26 ` Krzysztof Wilczyński
@ 2023-12-31 11:21 ` Krzysztof Wilczyński
0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Wilczyński @ 2023-12-31 11:21 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Nirmal Patel, Jonathan Derrick, Lorenzo Pieralisi, Rob Herring,
Bjorn Helgaas, linux-kernel, kernel-janitors, linux-pci
Hello,
> > ida_alloc() and ida_free() should be preferred to the deprecated
> > ida_simple_get() and ida_simple_remove().
> >
> > This is less verbose.
>
> Applied to controller/vmd, thank you!
>
> [1/1] PCI: vmd: Remove usage of the deprecated ida_simple_xx() API
> https://git.kernel.org/pci/pci/c/991801bc4722
Given two other similar changes:
- https://lore.kernel.org/linux-pci/cc01721cec2d416d7bdf47086943b17ef44b7286.1702966181.git.christophe.jaillet@wanadoo.fr
- https://lore.kernel.org/linux-pci/47a30441242c4d5f0e00555cbddd7783350ff1b2.1702966523.git.christophe.jaillet@wanadoo.fr
I moved this particular change to the same branch as the above so that
these are collected together within a single branch. And, as such:
Applied to remove-old-api, thank you!
[1/1] PCI: vmd: Remove usage of the deprecated ida_simple_*() API
https://git.kernel.org/pci/pci/c/0eccea7150e3
Krzysztof
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-31 11:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-10 17:50 [PATCH] PCI: vmd: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2023-12-13 19:26 ` Krzysztof Wilczyński
2023-12-31 11:21 ` Krzysztof Wilczyński
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox