Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

idr test suite: remove usage of the deprecated ida_simple_xx() API

Patch series "ida: Remove the ida_simple_xxx() API", v3.

These are the final steps in removing the ida_simple_xxx() API.

This series 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 all.


This patch (of 3):

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

Link: https://lkml.kernel.org/r/cover.1752480043.git.christophe.jaillet@wanadoo.fr
Link: https://lkml.kernel.org/r/2904fa2006e4fe58eea63aef87fa7f832c7804a1.1752480043.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Christophe JAILLET and committed by
Andrew Morton
8f09142e 1455b6ac

+7 -9
+7 -9
tools/testing/radix-tree/idr-test.c
··· 499 499 goto repeat; 500 500 } 501 501 502 - void ida_simple_get_remove_test(void) 502 + void ida_alloc_free_test(void) 503 503 { 504 504 DEFINE_IDA(ida); 505 505 unsigned long i; 506 506 507 - for (i = 0; i < 10000; i++) { 508 - assert(ida_simple_get(&ida, 0, 20000, GFP_KERNEL) == i); 509 - } 510 - assert(ida_simple_get(&ida, 5, 30, GFP_KERNEL) < 0); 507 + for (i = 0; i < 10000; i++) 508 + assert(ida_alloc_max(&ida, 20000, GFP_KERNEL) == i); 509 + assert(ida_alloc_range(&ida, 5, 30, GFP_KERNEL) < 0); 511 510 512 - for (i = 0; i < 10000; i++) { 513 - ida_simple_remove(&ida, i); 514 - } 511 + for (i = 0; i < 10000; i++) 512 + ida_free(&ida, i); 515 513 assert(ida_is_empty(&ida)); 516 514 517 515 ida_destroy(&ida); ··· 522 524 ida_check_nomem(); 523 525 ida_check_conv_user(); 524 526 ida_check_random(); 525 - ida_simple_get_remove_test(); 527 + ida_alloc_free_test(); 526 528 527 529 radix_tree_cpu_dead(1); 528 530 }