All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/mce: fix misleading indentation in init_nonfatal_mce_checker().
@ 2016-01-22 14:38 Ian Campbell
  2016-01-22 14:47 ` Andrew Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Campbell @ 2016-01-22 14:38 UTC (permalink / raw)
  To: jbeulich, andrew.cooper3, xen-devel
  Cc: Liu Jinsong, 812166, Christoph Egger, 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.

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

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Christoph Egger <chegger@amazon.de>
Cc: Liu Jinsong <jinsong.liu@alibaba-inc.com>
---
 xen/arch/x86/cpu/mcheck/non-fatal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/non-fatal.c b/xen/arch/x86/cpu/mcheck/non-fatal.c
index 526864e..8cd6635 100644
--- a/xen/arch/x86/cpu/mcheck/non-fatal.c
+++ b/xen/arch/x86/cpu/mcheck/non-fatal.c
@@ -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
-- 
2.6.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/mce: fix misleading indentation in init_nonfatal_mce_checker().
  2016-01-22 14:38 [PATCH] x86/mce: fix misleading indentation in init_nonfatal_mce_checker() Ian Campbell
@ 2016-01-22 14:47 ` Andrew Cooper
  2016-01-22 15:12   ` Egger, Christoph
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2016-01-22 14:47 UTC (permalink / raw)
  To: Ian Campbell, jbeulich, xen-devel; +Cc: Liu Jinsong, 812166, Christoph Egger

On 22/01/16 14:38, Ian Campbell wrote:
> 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
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Christoph Egger <chegger@amazon.de>
> Cc: Liu Jinsong <jinsong.liu@alibaba-inc.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/mce: fix misleading indentation in init_nonfatal_mce_checker().
  2016-01-22 14:47 ` Andrew Cooper
@ 2016-01-22 15:12   ` Egger, Christoph
  0 siblings, 0 replies; 3+ messages in thread
From: Egger, Christoph @ 2016-01-22 15:12 UTC (permalink / raw)
  To: Andrew Cooper, Ian Campbell, jbeulich, xen-devel; +Cc: Liu Jinsong, 812166

On 22/01/16 15:47, Andrew Cooper wrote:
> On 22/01/16 14:38, Ian Campbell wrote:
>> 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
>>
>> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>> Cc: Christoph Egger <chegger@amazon.de>
>> Cc: Liu Jinsong <jinsong.liu@alibaba-inc.com>
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 

Acked-by: Christoph Egger <chegger@amazon.de>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-22 15:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-22 14:38 [PATCH] x86/mce: fix misleading indentation in init_nonfatal_mce_checker() Ian Campbell
2016-01-22 14:47 ` Andrew Cooper
2016-01-22 15:12   ` Egger, Christoph

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.