From: Huang Shijie <shijie8@gmail.com>
To: tj@kernel.org
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
Huang Shijie <shijie8@gmail.com>
Subject: [PATCH] percpu: simplify the pcpu_alloc()
Date: Tue, 10 Aug 2010 23:00:40 +0800 [thread overview]
Message-ID: <1281452440-22346-1-git-send-email-shijie8@gmail.com> (raw)
The `while' is not needed, replaced it with `if' to reduce
an unnecessary check.
Signed-off-by: Huang Shijie <shijie8@gmail.com>
---
mm/percpu.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/mm/percpu.c b/mm/percpu.c
index e61dc2c..2e50004 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -724,7 +724,8 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved)
goto fail_unlock;
}
- while ((new_alloc = pcpu_need_to_extend(chunk))) {
+ new_alloc = pcpu_need_to_extend(chunk);
+ if (new_alloc) {
spin_unlock_irqrestore(&pcpu_lock, flags);
if (pcpu_extend_area_map(chunk, new_alloc) < 0) {
err = "failed to extend area map of reserved chunk";
--
1.6.6.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2010-08-10 14:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-10 15:00 Huang Shijie [this message]
2010-08-10 15:05 ` [PATCH] percpu: simplify the pcpu_alloc() Tejun Heo
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=1281452440-22346-1-git-send-email-shijie8@gmail.com \
--to=shijie8@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=tj@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).