From: Emmanuel Arias <eamanu@eamanu.com>
To: cl@linux.com, penberg@kernel.org, rientjes@google.com,
iamjoonsoo.kim@lge.com, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, emmanuelarias30@gmail.com,
Emmanuel Arias <eamanu@eamanu.com>
Subject: [PATCH] Make more redeable the kmalloc function
Date: Mon, 3 Jun 2019 22:44:54 -0300 [thread overview]
Message-ID: <20190604014454.6652-1-eamanu@eamanu.com> (raw)
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
next reply other threads:[~2019-06-04 1:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-04 1:44 Emmanuel Arias [this message]
2019-06-04 11:48 ` Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190604014454.6652-1-eamanu@eamanu.com \
--to=eamanu@eamanu.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=emmanuelarias30@gmail.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox