Commit 13503fa9 authored by Hidetoshi Seto's avatar Hidetoshi Seto Committed by H. Peter Anvin

x86, mce: Cleanup param parser

- Fix the comment formatting.

- The error path does not return 0, and printk lacks level and "\n".

- Move __setup("nomce") next to mcheck_disable().

- Improve readability etc.

[ Impact: cleanup ]
Signed-off-by: default avatarHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
LKML-Reference: <49CB3F38.7090703@jp.fujitsu.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent b5c42bc8
...@@ -839,25 +839,29 @@ static int __init mcheck_disable(char *str) ...@@ -839,25 +839,29 @@ static int __init mcheck_disable(char *str)
mce_dont_init = 1; mce_dont_init = 1;
return 1; return 1;
} }
__setup("nomce", mcheck_disable);
/* mce=off disables machine check. /*
mce=TOLERANCELEVEL (number, see above) * mce=off disables machine check
mce=bootlog Log MCEs from before booting. Disabled by default on AMD. * mce=TOLERANCELEVEL (number, see above)
mce=nobootlog Don't log MCEs from before booting. */ * mce=bootlog Log MCEs from before booting. Disabled by default on AMD.
* mce=nobootlog Don't log MCEs from before booting.
*/
static int __init mcheck_enable(char *str) static int __init mcheck_enable(char *str)
{ {
if (!strcmp(str, "off")) if (!strcmp(str, "off"))
mce_dont_init = 1; mce_dont_init = 1;
else if (!strcmp(str, "bootlog") || !strcmp(str,"nobootlog")) else if (!strcmp(str, "bootlog") || !strcmp(str, "nobootlog"))
mce_bootlog = str[0] == 'b'; mce_bootlog = (str[0] == 'b');
else if (isdigit(str[0])) else if (isdigit(str[0]))
get_option(&str, &tolerant); get_option(&str, &tolerant);
else else {
printk("mce= argument %s ignored. Please use /sys", str); printk(KERN_INFO "mce= argument %s ignored. Please use /sys\n",
str);
return 0;
}
return 1; return 1;
} }
__setup("nomce", mcheck_disable);
__setup("mce=", mcheck_enable); __setup("mce=", mcheck_enable);
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment