[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230111092744.112038-1-lvqian@nfschina.com>
Date: Wed, 11 Jan 2023 17:27:44 +0800
From: lvqian@...china.com
To: cl@...ux.co, penberg@...nel.org, rientjes@...gle.com, kim@....com,
akpm@...ux-foundation.org, vbabka@...e.cz,
roman.gushchin@...ux.dev, 42.hyeyoo@...il.com
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
lvqian <lvqian@...china.com>
Subject: [PATCH V2] mm/slab.c: Delete the if statement
From: lvqian <lvqian@...china.com>
Remove the if statement to increase code readability.
Signed-off-by: lvqian <lvqian@...china.com>
---
v2: Modify the subject content
---
mm/slab.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
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
Powered by blists - more mailing lists