ida: Remove the ida_simple_xxx() API
Subsystems (5)
v3 cover ida: Remove the ida_simple_xxx() API
This is the final steps to remove the ida_simple_xxx() API.
This serie was last proposed in August 2024. Since then, some users of the old API have be re-introduced and then removed.
A first time in drivers/misc/rpmb-core.c, added in commit 1e9046e3a154 ("rpmb: add Replay Protected Memory Block (RPMB) subsystem") (2024-08-26) and removed in commit dfc881abca42 ("rpmb: Remove usage of the deprecated ida_simple_xx() API") (2024-10-13).
A second time in drivers/gpio/gpio-mpsse.c, added in commit c46a74ff05c0 ("gpio: add support for FTDI's MPSSE as GPIO") (2024-10-14) and removed in commit f57c08492866 (gpio: mpsse: Remove usage of the deprecated ida_simple_xx() API) (2024-11-22).
Since then, I've not spotted any new usage.
So things being stable now, it's time to end this story once and for good.
Patch 1 updates the test suite. This is the last users of the API.
Patch 2 removes the old API.
Patch 3 is just a minor clean-up that still speak about the old API.
Christophe JAILLET (3):
idr test suite: Remove usage of the deprecated ida_simple_xx() API
ida: Remove the ida_simple_xxx() API
nvmem: Update a comment related to struct nvmem_config
include/linux/idr.h | 8 -------- include/linux/nvmem-provider.h | 2 +- tools/testing/radix-tree/idr-test.c | 16 +++++++--------- 3 files changed, 8 insertions(+), 18 deletions(-)
Signature · 1 line
2.50.1
PATCH v3 1/3 idr test suite: Remove usage of the deprecated ida_simple_xx() API
ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove().
Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_range()/ida_alloc_max() is inclusive. But because of the ranges used for the tests, there is no need to adjust them.
While at it remove some useless {}.
---
Changes in v3:
- No changes
Changes in v2:
- This patch was already proposed see [1]. This one also rename the functions used for the test:
s/ida_simple_get_remove_test/ida_alloc_free_test/. I've kept the A-b tag given at that time.
--- tools/testing/radix-tree/idr-test.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
tools/testing/radix-tree/idr-test.c +7 -9
@@ -499,19 +499,17 @@ void ida_check_random(void) goto repeat; } -void ida_simple_get_remove_test (void ) +void ida_alloc_free_test (void ) {DEFINE_IDA (ida);unsigned long i; -for (i =0 ; i <10000 ; i++) { -assert (ida_simple_get (&ida,0 ,20000 ,GFP_KERNEL ) == i); - } -assert (ida_simple_get (&ida,5 ,30 ,GFP_KERNEL ) <0 ); +for (i =0 ; i <10000 ; i++) +assert (ida_alloc_max (&ida,20000 ,GFP_KERNEL ) == i); +assert (ida_alloc_range (&ida,5 ,30 ,GFP_KERNEL ) <0 ); -for (i =0 ; i <10000 ; i++) { -ida_simple_remove (&ida, i); - } +for (i =0 ; i <10000 ; i++) +ida_free (&ida, i);assert (ida_is_empty (&ida));ida_destroy (&ida);
@@ -524,7 +522,7 @@ void user_ida_checks(void)ida_check_nomem ();ida_check_conv_user ();ida_check_random (); -ida_simple_get_remove_test (); +ida_alloc_free_test ();radix_tree_cpu_dead (1 ); }
Signature · 1 line
2.50.1
PATCH v3 2/3 ida: Remove the ida_simple_xxx() API
In reply to Christophe JAILLETAll users of the ida_simple_xxx() have been converted. In Linux 6.11-rc2, the only callers are in tools/testing/.
So it is now time to remove the definition of this old and deprecated ida_simple_get() and ida_simple_remove().
---
Changes in v3:
- Synch with latest -next
Changes in v2: new patch
--- include/linux/idr.h | 8 -------- 1 file changed, 8 deletions(-)
include/linux/idr.h +0 -8
@@ -334,14 +334,6 @@ static inline void ida_init(struct ida *ida)xa_init_flags (&ida->xa,IDA_INIT_FLAGS ); } -/* -* ida_simple_get() and ida_simple_remove() are deprecated. Use -* ida_alloc() and ida_free() instead respectively. -*/ -#define ida_simple_get (ida, start, end, gfp) \ - ida_alloc_range(ida, start, (end) - 1, gfp) -#define ida_simple_remove (ida, id) ida_free(ida, id) -static inline bool ida_is_empty (const struct ida *ida) {return xa_empty (&ida->xa);
Signature · 1 line
2.50.1
PATCH v3 3/3 nvmem: Update a comment related to struct nvmem_config
In reply to Christophe JAILLETUpdate a comment to match the function used in nvmem_register(). ida_simple_get() was replaced by ida_alloc() in commit 1eb51d6a4fce ("nvmem: switch to simpler IDA interface")
---
Changes in v3:
- No changes
Changes in v2:
- No changes
--- include/linux/nvmem-provider.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/nvmem-provider.h +1 -1
@@ -103,7 +103,7 @@ struct nvmem_cell_info {* * Note: A default "nvmem<id>" name will be assigned to the device if * no name is specified in its configuration. In such case "<id>" is -* generated with ida_simple_get() and provided id field is ignored. +* generated with ida_alloc() and provided id field is ignored. * * Note: Specifying name and setting id to -1 implies a unique device * whose name is provided as-is (kept unaltered).
Signature · 1 line
2.50.1