linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Make more redeable the kmalloc function
@ 2019-06-04  1:44 Emmanuel Arias
  2019-06-04 11:48 ` Matthew Wilcox
  0 siblings, 1 reply; 2+ messages in thread
From: Emmanuel Arias @ 2019-06-04  1:44 UTC (permalink / raw)
  To: cl, penberg, rientjes, iamjoonsoo.kim, akpm
  Cc: linux-mm, emmanuelarias30, Emmanuel Arias

The ``if```check of size > KMALLOC_MAX_CACHE_SIZE was between the same
preprocessor directive. I join the the directives to be more redeable.

Signed-off-by: Emmanuel Arias <eamanu@eamanu.com>
---
 include/linux/slab.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/linux/slab.h b/include/linux/slab.h
index 11b45f7ae405..90753231c191 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -531,12 +531,10 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags)
 static __always_inline void *kmalloc(size_t size, gfp_t flags)
 {
 	if (__builtin_constant_p(size)) {
-#ifndef CONFIG_SLOB
-		unsigned int index;
-#endif
 		if (size > KMALLOC_MAX_CACHE_SIZE)
 			return kmalloc_large(size, flags);
 #ifndef CONFIG_SLOB
+		unsigned int index;
 		index = kmalloc_index(size);
 
 		if (!index)
-- 
2.11.0


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

end of thread, other threads:[~2019-06-04 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-04  1:44 [PATCH] Make more redeable the kmalloc function Emmanuel Arias
2019-06-04 11:48 ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).