Make more redeable the kmalloc function
Subsystems (2)
PATCH 1/1 Make more redeable the kmalloc function
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 <[email protected]>
--- include/linux/slab.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
include/linux/slab.h +1 -3
@@ -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)
Signature · 1 line
2.11.0
Quoted 5 lines · Emmanuel Arias
The ``if```check of size >
KMALLOC_MAX_CACHE_SIZEwas between the same preprocessor directive. I join the the directives to be more redeable.static
__always_inlinevoid *kmalloc(size_t size,gfp_tflags) {
include/linux/slab.h static __always_inline void *kmalloc_large(size_t size, gfp_t flags) · line 538
Quoted 9 lines
include/linux/slab.h +1
-3if (__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);
You didn't get a new warning from -Wdeclaration-after-statement?