[RFC 02/10] lib/idr.c: delete useless condition

From: Rasmus Villemoes
Date: Wed Dec 07 2016 - 20:32:22 EST


Whether or not we have a spare ida_bitmap hanging off ida->free_bitmap
doesn't seem related to whether the embedded struct idr may have a
spare struct idr_layer in its free list. So the only thing this
condition does is increase the chance that we end up calling
get_from_free_list in vain.

Signed-off-by: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
---
lib/idr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/idr.c b/lib/idr.c
index 9cbfae251d77..1e786f817e66 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -991,7 +991,7 @@ int ida_get_new_above(struct ida *ida, int starting_id, int *p_id)
* Throw away extra resources one by one after each successful
* allocation.
*/
- if (ida->idr.id_free_cnt || ida->free_bitmap) {
+ if (ida->idr.id_free_cnt) {
struct idr_layer *p = get_from_free_list(&ida->idr);
if (p)
kmem_cache_free(idr_layer_cache, p);
--
2.1.4