[PATCH] Make more redeable the kmalloc function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux