lkml.org 
[lkml]   [2013]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -v8 11/11] Move arch/x86 reboot= handling to generic kernel.
On Tue,  7 May 2013 09:39:55 -0500 Robin Holt <holt@sgi.com> wrote:

> Merge together the unicore32, arm, and x86 reboot= command line
> parameter handling.
>
> ...
>
> +static int __init reboot_setup(char *str)
> +{
> + for (;;) {
> + /*
> + * Having anything passed on the command line via
> + * reboot= will cause us to disable DMI checking
> + * below.
> + */
> + reboot_default = 0;
> +
> + switch (*str) {
> +#if defined(CONFIG_X86) || defined(CONFIG_X86_64)
> + case 'w':
> + reboot_mode = REBOOT_WARM;
> + break;
> +
> + case 'c':
> + reboot_mode = REBOOT_COLD;
> + break;
> +
> +#ifdef CONFIG_SMP
> + case 's':
> + if (isdigit(*(str+1))) {
> + reboot_cpu = (int) (*(str+1) - '0');
> + if (isdigit(*(str+2)))
> + reboot_cpu = reboot_cpu*10 + (int)(*(str+2) - '0');
> + }

Boy, that's some weird stuff.

What's wrong with doing

if (isdigit(str[1])) {
reboot_cpu = str[1] - '0';
if (isdigit(str[2]))
reboot_cpu = reboot_cpu * 10 +
str[2] - '0';
}

?

But it's still nonsense - we should eliminate its
you-have-less-than-101-CPUs restriction by using, you know, atoi().



\
 
 \ /
  Last update: 2013-05-08 23:21    [W:0.228 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site