diff options
author | lvqian <lvqian@nfschina.com> | 2023-01-11 17:27:44 +0800 |
---|---|---|
committer | Vlastimil Babka <vbabka@suse.cz> | 2023-01-13 12:19:01 +0100 |
commit | 81ce2ebd194cf32027854ce1c703b7fd129c86b8 (patch) | |
tree | 19458575f86e660c14d427c29abbf5d21bfc8d76 /mm/slab.c | |
parent | c034c6a45c977fdf33de5974d7def75bda9dcadc (diff) |
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>
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/mm/slab.c b/mm/slab.c index c7a50fed4c9b..616140e702aa 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 |