From 033fd1bd3c50fdda267d27d02f9bc656f0b9ddb8 Mon Sep 17 00:00:00 2001 From: Wei Yang Date: Thu, 5 Nov 2015 18:45:48 -0800 Subject: mm/slub: use get_order() instead of fls() get_order() is more easy to understand. This patch just replaces it. Signed-off-by: Wei Yang Cc: Christoph Lameter Cc: David Rientjes Cc: Joonsoo Kim Reviewed-by: Pekka Enberg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/slub.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mm/slub.c') diff --git a/mm/slub.c b/mm/slub.c index a94b9f46261b..e309ed140fd1 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2912,8 +2912,7 @@ static inline int slab_order(int size, int min_objects, if (order_objects(min_order, size, reserved) > MAX_OBJS_PER_PAGE) return get_order(size * MAX_OBJS_PER_PAGE) - 1; - for (order = max(min_order, - fls(min_objects * size - 1) - PAGE_SHIFT); + for (order = max(min_order, get_order(min_objects * size)); order <= max_order; order++) { unsigned long slab_size = PAGE_SIZE << order; -- cgit v1.2.3