[PATCH] mm/slab.c: Delete the if judgment and return the result directly Remove the if judgment and return the result directly to reduce assembly statements.

From: lvqian
Date: Wed Jan 11 2023 - 03:31:35 EST


From: lvqian <lvqian@xxxxxxxxxxxx>

diff --git a/mm/slab.c b/mm/slab.c
index 7a269db050ee..713265fe2dea 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1415,11 +1415,8 @@ static void kmem_rcu_free(struct rcu_head *head)
#if DEBUG
static 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
--
2.34.1