linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] ida: Remove the ida_simple_xxx() API
@ 2025-07-14  8:17 Christophe JAILLET
  2025-07-14  8:17 ` [PATCH v3 1/3] idr test suite: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Christophe JAILLET @ 2025-07-14  8:17 UTC (permalink / raw)
  To: willy, srini
  Cc: linux-fsdevel, linux-mm, linux-kernel, kernel-janitors,
	Christophe JAILLET

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

-- 
2.50.1



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

* [PATCH v3 1/3] idr test suite: Remove usage of the deprecated ida_simple_xx() API
  2025-07-14  8:17 [PATCH v3 0/3] ida: Remove the ida_simple_xxx() API Christophe JAILLET
@ 2025-07-14  8:17 ` Christophe JAILLET
  2025-07-14  8:17 ` [PATCH v3 2/3] ida: Remove the ida_simple_xxx() API Christophe JAILLET
  2025-07-14  8:17 ` [PATCH v3 3/3] nvmem: Update a comment related to struct nvmem_config Christophe JAILLET
  2 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2025-07-14  8:17 UTC (permalink / raw)
  To: willy, srini
  Cc: linux-fsdevel, linux-mm, linux-kernel, kernel-janitors,
	Christophe JAILLET

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 {}.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
Changes in v3:
  - No changes

v2: https://lore.kernel.org/all/715cff763aa4b2c174cc649750e14e404db6e65b.1722853349.git.christophe.jaillet@wanadoo.fr/

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.

v1: https://lore.kernel.org/all/81f44a41b7ccceb26a802af473f931799445821a.1705683269.git.christophe.jaillet@wanadoo.fr/
---
 tools/testing/radix-tree/idr-test.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/tools/testing/radix-tree/idr-test.c b/tools/testing/radix-tree/idr-test.c
index 84b8c3c92c79..2f830ff8396c 100644
--- a/tools/testing/radix-tree/idr-test.c
+++ b/tools/testing/radix-tree/idr-test.c
@@ -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);
 }
-- 
2.50.1



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

* [PATCH v3 2/3] ida: Remove the ida_simple_xxx() API
  2025-07-14  8:17 [PATCH v3 0/3] ida: Remove the ida_simple_xxx() API Christophe JAILLET
  2025-07-14  8:17 ` [PATCH v3 1/3] idr test suite: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
@ 2025-07-14  8:17 ` Christophe JAILLET
  2025-07-14  8:17 ` [PATCH v3 3/3] nvmem: Update a comment related to struct nvmem_config Christophe JAILLET
  2 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2025-07-14  8:17 UTC (permalink / raw)
  To: willy, srini
  Cc: linux-fsdevel, linux-mm, linux-kernel, kernel-janitors,
	Christophe JAILLET

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

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Changes in v3:
  - Synch with latest -next

v2: https://lore.kernel.org/all/2e9b298991fb8cd47815c917a8fc069b553cea10.1722853349.git.christophe.jaillet@wanadoo.fr/

Changes in v2: new patch
---
 include/linux/idr.h | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/include/linux/idr.h b/include/linux/idr.h
index 2267902d29a7..789e23e67444 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -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);
-- 
2.50.1



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

* [PATCH v3 3/3] nvmem: Update a comment related to struct nvmem_config
  2025-07-14  8:17 [PATCH v3 0/3] ida: Remove the ida_simple_xxx() API Christophe JAILLET
  2025-07-14  8:17 ` [PATCH v3 1/3] idr test suite: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
  2025-07-14  8:17 ` [PATCH v3 2/3] ida: Remove the ida_simple_xxx() API Christophe JAILLET
@ 2025-07-14  8:17 ` Christophe JAILLET
  2 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2025-07-14  8:17 UTC (permalink / raw)
  To: willy, srini
  Cc: linux-fsdevel, linux-mm, linux-kernel, kernel-janitors,
	Christophe JAILLET

Update 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")

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Changes in v3:
  - No changes

v2: https://lore.kernel.org/all/10fd5b4afb1a43f4c4665fe4f362e671a729b37f.1722853349.git.christophe.jaillet@wanadoo.fr/

Changes in v2:
  - No changes

v1: https://lore.kernel.org/all/032b8035bd1f2dcc13ffc781c8348d9fbdf9e3b2.1713606957.git.christophe.jaillet@wanadoo.fr/
---
 include/linux/nvmem-provider.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h
index 615a560d9edb..f3b13da78aac 100644
--- a/include/linux/nvmem-provider.h
+++ b/include/linux/nvmem-provider.h
@@ -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).
-- 
2.50.1



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

end of thread, other threads:[~2025-07-14  8:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-14  8:17 [PATCH v3 0/3] ida: Remove the ida_simple_xxx() API Christophe JAILLET
2025-07-14  8:17 ` [PATCH v3 1/3] idr test suite: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2025-07-14  8:17 ` [PATCH v3 2/3] ida: Remove the ida_simple_xxx() API Christophe JAILLET
2025-07-14  8:17 ` [PATCH v3 3/3] nvmem: Update a comment related to struct nvmem_config Christophe JAILLET

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