From: Namhyung Kim <namhyung@gmail.com>
To: Ingo Molnar <mingo@elte.hu>, Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] init/main.c: refactor maxcpus()
Date: Sun, 15 Aug 2010 18:35:33 +0900 [thread overview]
Message-ID: <1281864933-6145-1-git-send-email-namhyung@gmail.com> (raw)
get_option() requires 2nd arg to be a pointer to int but setup_max_cpus is a
pointer to unsigned int. Use max_cpus instead and update setup_max_cpus only
if given value is in the proper range.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
init/main.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/init/main.c b/init/main.c
index 86cbfd0..b06b8f2 100644
--- a/init/main.c
+++ b/init/main.c
@@ -165,9 +165,13 @@ early_param("nr_cpus", nrcpus);
static int __init maxcpus(char *str)
{
- get_option(&str, &setup_max_cpus);
- if (setup_max_cpus == 0)
- arch_disable_smp_support();
+ int max_cpus;
+
+ get_option(&str, &max_cpus);
+ if (max_cpus == 0)
+ nosmp(NULL);
+ else if (0 < max_cpus && max_cpus < NR_CPUS)
+ setup_max_cpus = max_cpus;
return 0;
}
--
1.7.0.4
reply other threads:[~2010-08-15 16:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1281864933-6145-1-git-send-email-namhyung@gmail.com \
--to=namhyung@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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
all inboxes | Powered by JetHome®