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.

Input: 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() is inclusive. So a -1 has been added when needed.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/a885de14beead2cc3c1c946f192b8b178dac696a.1705349930.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Christophe JAILLET and committed by
Dmitry Torokhov
2a992413 bc499618

+6 -8
+6 -8
drivers/input/input.c
··· 2629 2629 * locking is needed here. 2630 2630 */ 2631 2631 if (legacy_base >= 0) { 2632 - int minor = ida_simple_get(&input_ida, 2633 - legacy_base, 2634 - legacy_base + legacy_num, 2635 - GFP_KERNEL); 2632 + int minor = ida_alloc_range(&input_ida, legacy_base, 2633 + legacy_base + legacy_num - 1, 2634 + GFP_KERNEL); 2636 2635 if (minor >= 0 || !allow_dynamic) 2637 2636 return minor; 2638 2637 } 2639 2638 2640 - return ida_simple_get(&input_ida, 2641 - INPUT_FIRST_DYNAMIC_DEV, INPUT_MAX_CHAR_DEVICES, 2642 - GFP_KERNEL); 2639 + return ida_alloc_range(&input_ida, INPUT_FIRST_DYNAMIC_DEV, 2640 + INPUT_MAX_CHAR_DEVICES - 1, GFP_KERNEL); 2643 2641 } 2644 2642 EXPORT_SYMBOL(input_get_new_minor); 2645 2643 ··· 2650 2652 */ 2651 2653 void input_free_minor(unsigned int minor) 2652 2654 { 2653 - ida_simple_remove(&input_ida, minor); 2655 + ida_free(&input_ida, minor); 2654 2656 } 2655 2657 EXPORT_SYMBOL(input_free_minor); 2656 2658