From: lvqian Date: Wed, 11 Jan 2023 09:27:44 +0000 (+0800) Subject: mm/slab.c: cleanup is_debug_pagealloc_cache() X-Git-Tag: v6.3-rc1~123^2~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=81ce2ebd194cf32027854ce1c703b7fd129c86b8;p=thirdparty%2Fkernel%2Flinux.git mm/slab.c: cleanup is_debug_pagealloc_cache() Remove the if statement to increase code readability. Also make the function inline, per David. Signed-off-by: lvqian Acked-by: David Rientjes Signed-off-by: Vlastimil Babka --- diff --git a/mm/slab.c b/mm/slab.c index c7a50fed4c9b8..616140e702aad 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -1410,13 +1410,10 @@ static void kmem_rcu_free(struct rcu_head *head) } #if DEBUG -static bool is_debug_pagealloc_cache(struct kmem_cache *cachep) +static inline bool is_debug_pagealloc_cache(struct kmem_cache *cachep) { - if (debug_pagealloc_enabled_static() && OFF_SLAB(cachep) && - (cachep->size % PAGE_SIZE) == 0) - return true; - - return false; + return debug_pagealloc_enabled_static() && OFF_SLAB(cachep) && + ((cachep->size % PAGE_SIZE) == 0); } #ifdef CONFIG_DEBUG_PAGEALLOC