All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] mm/slab.c: Delete the if statement
@ 2023-01-11  9:27 lvqian
  2023-01-12 23:53 ` David Rientjes
  0 siblings, 1 reply; 3+ messages in thread
From: lvqian @ 2023-01-11  9:27 UTC (permalink / raw)
  To: cl, penberg, rientjes, kim, akpm, vbabka, roman.gushchin, 42.hyeyoo
  Cc: linux-mm, linux-kernel, lvqian

From: lvqian <lvqian@nfschina.com>

	Remove the if statement to increase code readability.

Signed-off-by: lvqian <lvqian@nfschina.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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] mm/slab.c: Delete the if statement
  2023-01-11  9:27 [PATCH V2] mm/slab.c: Delete the if statement lvqian
@ 2023-01-12 23:53 ` David Rientjes
  2023-01-13 11:20   ` Vlastimil Babka
  0 siblings, 1 reply; 3+ messages in thread
From: David Rientjes @ 2023-01-12 23:53 UTC (permalink / raw)
  To: lvqian
  Cc: cl, penberg, kim, akpm, vbabka, roman.gushchin, 42.hyeyoo,
	linux-mm, linux-kernel

On Wed, 11 Jan 2023, lvqian@nfschina.com wrote:

> From: lvqian <lvqian@nfschina.com>
> 
> 	Remove the if statement to increase code readability.
> 
> Signed-off-by: lvqian <lvqian@nfschina.com>

Acked-by: David Rientjes <rientjes@google.com>

Will rely on Vlastimil to remove the spurious tab in the commit 
description.  Function could be inline, but no strong preference.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] mm/slab.c: Delete the if statement
  2023-01-12 23:53 ` David Rientjes
@ 2023-01-13 11:20   ` Vlastimil Babka
  0 siblings, 0 replies; 3+ messages in thread
From: Vlastimil Babka @ 2023-01-13 11:20 UTC (permalink / raw)
  To: David Rientjes, lvqian
  Cc: cl, penberg, kim, akpm, roman.gushchin, 42.hyeyoo, linux-mm,
	linux-kernel

On 1/13/23 00:53, David Rientjes wrote:
> On Wed, 11 Jan 2023, lvqian@nfschina.com wrote:
> 
>> From: lvqian <lvqian@nfschina.com>
>> 
>> 	Remove the if statement to increase code readability.
>> 
>> Signed-off-by: lvqian <lvqian@nfschina.com>
> 
> Acked-by: David Rientjes <rientjes@google.com>
> 
> Will rely on Vlastimil to remove the spurious tab in the commit 
> description.

Right, also changed subject to:
mm/slab.c: cleanup is_debug_pagealloc_cache()

Function could be inline, but no strong preference.

Good point, did that too.

Added to
slab/for-6.3/cleanups

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-13 11:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-11  9:27 [PATCH V2] mm/slab.c: Delete the if statement lvqian
2023-01-12 23:53 ` David Rientjes
2023-01-13 11:20   ` Vlastimil Babka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.