Skip to contentSkip to conversation

x86/mce: fix misleading indentation in init_nonfatal_mce_checker().

PATCH In review Ian Campbell 3 participants 3 messages Jan 22, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/mce: fix misleading indentation in init_nonfatal_mce_checker().

Debian bug 812166[0] reported this build failure due to Wmisleading-indentation with gcc-6:

non-fatal.c: In function 'init_nonfatal_mce_checker':
non-fatal.c:103:2: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
switch (c->x86_vendor) {
^~~~~~

non-fatal.c:97:5: note: ...this 'if' clause, but it is not

     if ( __get_cpu_var(poll_bankmask) == NULL )
     ^~

I was unable to reproduce (xen builds cleanly for me with "6.0.0 20160117 (experimental) [trunk revision 232481]") but looking at the code the issue above is clearly real.

Correctly reindent the if statement.

This file uses Linux coding style (infact the use of Xen style for this line is the root cause of the wanring) so use tabs and while there remove the whitespace inside the if as Linux does.

[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812166

Cc Christoph Egger <[email protected]>
Cc Liu Jinsong <[email protected]>
---
 xen/arch/x86/cpu/mcheck/non-fatal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
xen/arch/x86/cpu/mcheck/non-fatal.c +2 -2
index 526864e..8cd6635 100644
@@ -94,8 +94,8 @@ static int __init init_nonfatal_mce_checker(void)
 	if (mce_disabled || !mce_available(c))
 		return -ENODEV;
 
-    if ( __get_cpu_var(poll_bankmask) == NULL )
-        return -EINVAL;
+	if (__get_cpu_var(poll_bankmask) == NULL)
+		return -EINVAL;
 
 	/*
 	 * Check for non-fatal errors every MCE_RATE s
Signature · 1 line
2.6.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Ian Campbell

Debian bug 812166[0] reported this build failure due to Wmisleading-indentation with gcc-6:

non-fatal.c: In function 'init_nonfatal_mce_checker':
non-fatal.c:103:2: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
switch (c->x86_vendor) {
^~~~~~

non-fatal.c:97:5: note: ...this 'if' clause, but it is not

     if ( __get_cpu_var(poll_bankmask) == NULL )
     ^~

I was unable to reproduce (xen builds cleanly for me with "6.0.0 20160117 (experimental) [trunk revision 232481]") but looking at the code the issue above is clearly real.

Correctly reindent the if statement.

This file uses Linux coding style (infact the use of Xen style for this line is the root cause of the wanring) so use tabs and while there remove the whitespace inside the if as Linux does.

Quoted 5 lines

[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812166

Cc Christoph Egger <[email protected]>
Cc Liu Jinsong <[email protected]>
#2 lore raw
Quoted 23 lines · Andrew Cooper
Quoted 22 lines · Ian Campbell

Debian bug 812166[0] reported this build failure due to Wmisleading-indentation with gcc-6:

non-fatal.c: In function 'init_nonfatal_mce_checker':
non-fatal.c:103:2: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
switch (c->x86_vendor) {
^~~~~~

non-fatal.c:97:5: note: ...this 'if' clause, but it is not

     if ( __get_cpu_var(poll_bankmask) == NULL )
     ^~

I was unable to reproduce (xen builds cleanly for me with "6.0.0 20160117 (experimental) [trunk revision 232481]") but looking at the code the issue above is clearly real.

Correctly reindent the if statement.

This file uses Linux coding style (infact the use of Xen style for this line is the root cause of the wanring) so use tabs and while there remove the whitespace inside the if as Linux does.

Quoted 8 lines
Quoted 5 lines

[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812166

Cc Christoph Egger <[email protected]>
Cc Liu Jinsong <[email protected]>

Amazon Development Center Germany GmbH
Berlin - Dresden - Aachen
main office: Krausenstr. 38, 10117 Berlin
Geschaeftsfuehrer: Dr. Ralf Herbrich, Christian Schlaeger
Ust-ID: DE289237879
Eingetragen am Amtsgericht Charlottenburg HRB 149173 B