idr-add-ida_is_empty.patch removed from -mm tree
The patch titled
Subject: idr: add ida_is_empty
has been removed from the -mm tree. Its filename was
idr-add-ida_is_empty.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Matthew Wilcox <[email protected]>
Subject: idr: add ida_is_empty
Two of the USB Gadgets were poking around in the internals of struct ida in order to determine if it is empty. Add the appropriate abstraction.
Signed-off-by Matthew Wilcox <[email protected]>
Tested-by Kirill A. Shutemov <[email protected]>
Cc Ross Zwisler <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Michal Nazarewicz <[email protected]>
Cc Matthew Wilcox <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/usb/gadget/function/f_hid.c | 6 +++--- drivers/usb/gadget/function/f_printer.c | 6 +++--- include/linux/idr.h | 5 +++++ 3 files changed, 11 insertions(+), 6 deletions(-)
drivers/usb/gadget/function/f_hid.c renamed from drivers/usb/gadget/function/f_hid.c~idr-add-ida_is_empty +3 -3
@@ -905,7 +905,7 @@ static void hidg_free_inst(struct usb_fumutex_lock (&hidg_ida_lock);hidg_put_minor (opts->minor); -if (idr_is_empty (&hidg_ida.idr)) +if (ida_is_empty (&hidg_ida))ghid_cleanup ();mutex_unlock (&hidg_ida_lock);
@@ -931,7 +931,7 @@ static struct usb_function_instance *hidmutex_lock (&hidg_ida_lock); -if (idr_is_empty (&hidg_ida.idr)) { +if (ida_is_empty (&hidg_ida)) { status =ghid_setup (NULL ,HIDG_MINORS );if (status) { ret =ERR_PTR (status);
@@ -944,7 +944,7 @@ static struct usb_function_instance *hidif (opts->minor <0 ) { ret =ERR_PTR (opts->minor);kfree (opts); -if (idr_is_empty (&hidg_ida.idr)) +if (ida_is_empty (&hidg_ida))ghid_cleanup (); goto unlock; }
drivers/usb/gadget/function/f_printer.c renamed from drivers/usb/gadget/function/f_printer.c~idr-add-ida_is_empty +3 -3
@@ -1265,7 +1265,7 @@ static void gprinter_free_inst(struct usmutex_lock (&printer_ida_lock);gprinter_put_minor (opts->minor); -if (idr_is_empty (&printer_ida.idr)) +if (ida_is_empty (&printer_ida))gprinter_cleanup ();mutex_unlock (&printer_ida_lock);
@@ -1289,7 +1289,7 @@ static struct usb_function_instance *gprmutex_lock (&printer_ida_lock); -if (idr_is_empty (&printer_ida.idr)) { +if (ida_is_empty (&printer_ida)) { status =gprinter_setup (PRINTER_MINORS );if (status) { ret =ERR_PTR (status);
@@ -1302,7 +1302,7 @@ static struct usb_function_instance *gprif (opts->minor <0 ) { ret =ERR_PTR (opts->minor);kfree (opts); -if (idr_is_empty (&printer_ida.idr)) +if (ida_is_empty (&printer_ida))gprinter_cleanup (); goto unlock; }
include/linux/idr.h renamed from include/linux/idr.h~idr-add-ida_is_empty +5 -0
@@ -195,6 +195,11 @@ static inline int ida_get_new(struct ida return ida_get_new_above(ida, 0, p_id); } +static inline bool ida_is_empty (struct ida *ida) +{ +return idr_is_empty (&ida->idr); +} +void __init idr_init_cache (void );#endif /* __IDR_H__ */
_
Patches currently in -mm which might be from [email protected] are
reimplement-idr-and-ida-using-the-radix-tree.patch