Skip to contentSkip to conversation

x86, mce: Cleanup param parser

PATCH In review Hidetoshi Seto 2 participants 6 messages Mar 26, 2009 – May 29, 2009 x86

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 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.

---
 arch/x86/kernel/cpu/mcheck/mce_64.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)
arch/x86/kernel/cpu/mcheck/mce_64.c +14 -10
index 863f895..33d612e 100644
@@ -838,25 +838,29 @@ static int __init mcheck_disable(char *str)
 	mce_dont_init = 1;
 	return 1;
 }
+__setup("nomce", mcheck_disable);
 
-/* mce=off disables machine check.
-   mce=TOLERANCELEVEL (number, see above)
-   mce=bootlog Log MCEs from before booting. Disabled by default on AMD.
-   mce=nobootlog Don't log MCEs from before booting. */
+/*
+ * mce=off disables machine check
+ * mce=TOLERANCELEVEL (number, see above)
+ * 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)
 {
 	if (!strcmp(str, "off"))
 		mce_dont_init = 1;
-	else if (!strcmp(str, "bootlog") || !strcmp(str,"nobootlog"))
-		mce_bootlog = str[0] == 'b';
+	else if (!strcmp(str, "bootlog") || !strcmp(str, "nobootlog"))
+		mce_bootlog = (str[0] == 'b');
 	else if (isdigit(str[0]))
 		get_option(&str, &tolerant);
-	else
-		printk("mce= argument %s ignored. Please use /sys", str);
+	else {
+		printk(KERN_INFO "mce= argument %s ignored. Please use /sys\n",
+		       str);
+		return 0;
+	}
 	return 1;
 }
-
-__setup("nomce", mcheck_disable);
 __setup("mce=", mcheck_enable);
 
 /*
Signature · 1 line
1.6.2.1
#1 lore raw
Quoted 4 lines · Hidetoshi Seto

- 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.

Looks good.

-Andi

#2 lore raw
Quoted 7 lines · Andi Kleen
Quoted 4 lines · Hidetoshi Seto

- 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.

Looks good.

Thank you for reviewing!

This cleanup can stand alone, so could you apply this onto -tip? # Or would you request me to resend it with subject stripped "2/3"?

Thanks,
H.Seto

#3 lore raw
Quoted 6 lines · Hidetoshi Seto
Quoted 5 lines · Andi Kleen
Quoted 4 lines · Hidetoshi Seto

- 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.

Quoted 6 lines
Quoted 1 line

Looks good.

Thank you for reviewing!

This cleanup can stand alone, so could you apply this onto -tip? # Or would you request me to resend it with subject stripped "2/3"?

I can add it into my pile. I don't have direct access to tip

-Andi

#4 lore raw
In reply to Hidetoshi Seto
Commit-ID:  38719db5cf9b8b22bbe2731d736bf271c803e0b0
Gitweb:     http://git.kernel.org/tip/38719db5cf9b8b22bbe2731d736bf271c803e0b0
Author:     Hidetoshi Seto <[email protected]>
AuthorDate: Thu, 26 Mar 2009 17:39:20 +0900
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sat, 28 Mar 2009 13:12:55 +0100

x86, mce: Cleanup param parser

Impact: cleanup

- 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.

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/cpu/mcheck/mce_64.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)
arch/x86/kernel/cpu/mcheck/mce_64.c +14 -10
index ca14604..9bf52bd 100644
@@ -838,25 +838,29 @@ static int __init mcheck_disable(char *str)
 	mce_dont_init = 1;
 	return 1;
 }
+__setup("nomce", mcheck_disable);
 
-/* mce=off disables machine check.
-   mce=TOLERANCELEVEL (number, see above)
-   mce=bootlog Log MCEs from before booting. Disabled by default on AMD.
-   mce=nobootlog Don't log MCEs from before booting. */
+/*
+ * mce=off disables machine check
+ * mce=TOLERANCELEVEL (number, see above)
+ * 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)
 {
 	if (!strcmp(str, "off"))
 		mce_dont_init = 1;
-	else if (!strcmp(str, "bootlog") || !strcmp(str,"nobootlog"))
-		mce_bootlog = str[0] == 'b';
+	else if (!strcmp(str, "bootlog") || !strcmp(str, "nobootlog"))
+		mce_bootlog = (str[0] == 'b');
 	else if (isdigit(str[0]))
 		get_option(&str, &tolerant);
-	else
-		printk("mce= argument %s ignored. Please use /sys", str);
+	else {
+		printk(KERN_INFO "mce= argument %s ignored. Please use /sys\n",
+		       str);
+		return 0;
+	}
 	return 1;
 }
-
-__setup("nomce", mcheck_disable);
 __setup("mce=", mcheck_enable);
 
 /*
#5 lore raw
In reply to Hidetoshi Seto
Commit-ID:  13503fa9137d9708d52214e9506c671dbf2fbdce
Gitweb:     http://git.kernel.org/tip/13503fa9137d9708d52214e9506c671dbf2fbdce
Author:     Hidetoshi Seto <[email protected]>
AuthorDate: Thu, 26 Mar 2009 17:39:20 +0900
Committer:  H. Peter Anvin <[email protected]>
CommitDate: Thu, 28 May 2009 09:24:09 -0700

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 ]

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/cpu/mcheck/mce_64.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)
arch/x86/kernel/cpu/mcheck/mce_64.c +14 -10
index 6fb0b35..77effb5 100644
@@ -839,25 +839,29 @@ static int __init mcheck_disable(char *str)
 	mce_dont_init = 1;
 	return 1;
 }
+__setup("nomce", mcheck_disable);
 
-/* mce=off disables machine check.
-   mce=TOLERANCELEVEL (number, see above)
-   mce=bootlog Log MCEs from before booting. Disabled by default on AMD.
-   mce=nobootlog Don't log MCEs from before booting. */
+/*
+ * mce=off disables machine check
+ * mce=TOLERANCELEVEL (number, see above)
+ * 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)
 {
 	if (!strcmp(str, "off"))
 		mce_dont_init = 1;
-	else if (!strcmp(str, "bootlog") || !strcmp(str,"nobootlog"))
-		mce_bootlog = str[0] == 'b';
+	else if (!strcmp(str, "bootlog") || !strcmp(str, "nobootlog"))
+		mce_bootlog = (str[0] == 'b');
 	else if (isdigit(str[0]))
 		get_option(&str, &tolerant);
-	else
-		printk("mce= argument %s ignored. Please use /sys", str);
+	else {
+		printk(KERN_INFO "mce= argument %s ignored. Please use /sys\n",
+		       str);
+		return 0;
+	}
 	return 1;
 }
-
-__setup("nomce", mcheck_disable);
 __setup("mce=", mcheck_enable);
 
 /*