Skip to content

Commit 81ce2eb

Browse files
nfs-lvqiantehcaster
authored andcommitted
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 <lvqian@nfschina.com> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
1 parent c034c6a commit 81ce2eb

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

mm/slab.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,13 +1410,10 @@ static void kmem_rcu_free(struct rcu_head *head)
14101410
}
14111411

14121412
#if DEBUG
1413-
static bool is_debug_pagealloc_cache(struct kmem_cache *cachep)
1413+
static inline bool is_debug_pagealloc_cache(struct kmem_cache *cachep)
14141414
{
1415-
if (debug_pagealloc_enabled_static() && OFF_SLAB(cachep) &&
1416-
(cachep->size % PAGE_SIZE) == 0)
1417-
return true;
1418-
1419-
return false;
1415+
return debug_pagealloc_enabled_static() && OFF_SLAB(cachep) &&
1416+
((cachep->size % PAGE_SIZE) == 0);
14201417
}
14211418

14221419
#ifdef CONFIG_DEBUG_PAGEALLOC

0 commit comments

Comments
 (0)