* [PATCH v2 0/3] ida: Remove the ida_simple_xxx() API
@ 2024-08-05 10:29 Christophe JAILLET
2024-08-05 10:29 ` [PATCH v2 1/3] idr test suite: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Christophe JAILLET @ 2024-08-05 10:29 UTC (permalink / raw)
To: willy, srinivas.kandagatla
Cc: linux-fsdevel, linux-kernel, kernel-janitors, Christophe JAILLET
This is the final steps to remove the ida_simple_xxx() API.
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.45.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/3] idr test suite: Remove usage of the deprecated ida_simple_xx() API
2024-08-05 10:29 [PATCH v2 0/3] ida: Remove the ida_simple_xxx() API Christophe JAILLET
@ 2024-08-05 10:29 ` Christophe JAILLET
2024-08-05 10:29 ` [PATCH v2 2/3] ida: Remove the ida_simple_xxx() API Christophe JAILLET
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Christophe JAILLET @ 2024-08-05 10:29 UTC (permalink / raw)
To: willy, srinivas.kandagatla
Cc: linux-fsdevel, 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 v2:
- This patch was already proposed see [1]. This one also rename the function
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.45.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/3] ida: Remove the ida_simple_xxx() API
2024-08-05 10:29 [PATCH v2 0/3] ida: Remove the ida_simple_xxx() API Christophe JAILLET
2024-08-05 10:29 ` [PATCH v2 1/3] idr test suite: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
@ 2024-08-05 10:29 ` Christophe JAILLET
2024-08-05 10:29 ` [PATCH v2 3/3] nvmem: Update a comment related to struct nvmem_config Christophe JAILLET
2024-08-07 12:57 ` [PATCH v2 0/3] ida: Remove the ida_simple_xxx() API Dan Carpenter
3 siblings, 0 replies; 5+ messages in thread
From: Christophe JAILLET @ 2024-08-05 10:29 UTC (permalink / raw)
To: willy, srinivas.kandagatla
Cc: linux-fsdevel, 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>
---
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 da5f5fa4a3a6..60216f8fc04c 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -316,14 +316,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.45.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 3/3] nvmem: Update a comment related to struct nvmem_config
2024-08-05 10:29 [PATCH v2 0/3] ida: Remove the ida_simple_xxx() API Christophe JAILLET
2024-08-05 10:29 ` [PATCH v2 1/3] idr test suite: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2024-08-05 10:29 ` [PATCH v2 2/3] ida: Remove the ida_simple_xxx() API Christophe JAILLET
@ 2024-08-05 10:29 ` Christophe JAILLET
2024-08-07 12:57 ` [PATCH v2 0/3] ida: Remove the ida_simple_xxx() API Dan Carpenter
3 siblings, 0 replies; 5+ messages in thread
From: Christophe JAILLET @ 2024-08-05 10:29 UTC (permalink / raw)
To: willy, srinivas.kandagatla
Cc: linux-fsdevel, 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 v2:
- No chnages
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 3ebeaa0ded00..9a5f262d20f5 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.45.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/3] ida: Remove the ida_simple_xxx() API
2024-08-05 10:29 [PATCH v2 0/3] ida: Remove the ida_simple_xxx() API Christophe JAILLET
` (2 preceding siblings ...)
2024-08-05 10:29 ` [PATCH v2 3/3] nvmem: Update a comment related to struct nvmem_config Christophe JAILLET
@ 2024-08-07 12:57 ` Dan Carpenter
3 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2024-08-07 12:57 UTC (permalink / raw)
To: Christophe JAILLET
Cc: willy, srinivas.kandagatla, linux-fsdevel, linux-kernel,
kernel-janitors
On Mon, Aug 05, 2024 at 12:29:46PM +0200, Christophe JAILLET wrote:
> This is the final steps to remove the ida_simple_xxx() API.
>
> 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
Congrats. :)
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-08-07 12:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-05 10:29 [PATCH v2 0/3] ida: Remove the ida_simple_xxx() API Christophe JAILLET
2024-08-05 10:29 ` [PATCH v2 1/3] idr test suite: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2024-08-05 10:29 ` [PATCH v2 2/3] ida: Remove the ida_simple_xxx() API Christophe JAILLET
2024-08-05 10:29 ` [PATCH v2 3/3] nvmem: Update a comment related to struct nvmem_config Christophe JAILLET
2024-08-07 12:57 ` [PATCH v2 0/3] ida: Remove the ida_simple_xxx() API Dan Carpenter
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).