Skip to contentSkip to conversation

X86: Fix trailing statements should be on next line

PATCH In review Paolo Ciarrocchi 4 participants 4 messages Jan 28, 2008 – Feb 1, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 3/7 X86: Fix trailing statements should be on next line

Fix trailing statements should be on next line

---
 arch/x86/math-emu/errors.c |   39 ++++++++++++++++++++++++++-------------
 1 files changed, 26 insertions(+), 13 deletions(-)
arch/x86/math-emu/errors.c +26 -13
index 7f96db4..4419339 100644
@@ -93,19 +93,32 @@ void FPU_printall(void)
   partial_status = status_word();
 
 #ifdef DEBUGGING
-if ( partial_status & SW_Backward )    printk("SW: backward compatibility\n");
-if ( partial_status & SW_C3 )          printk("SW: condition bit 3\n");
-if ( partial_status & SW_C2 )          printk("SW: condition bit 2\n");
-if ( partial_status & SW_C1 )          printk("SW: condition bit 1\n");
-if ( partial_status & SW_C0 )          printk("SW: condition bit 0\n");
-if ( partial_status & SW_Summary )     printk("SW: exception summary\n");
-if ( partial_status & SW_Stack_Fault ) printk("SW: stack fault\n");
-if ( partial_status & SW_Precision )   printk("SW: loss of precision\n");
-if ( partial_status & SW_Underflow )   printk("SW: underflow\n");
-if ( partial_status & SW_Overflow )    printk("SW: overflow\n");
-if ( partial_status & SW_Zero_Div )    printk("SW: divide by zero\n");
-if ( partial_status & SW_Denorm_Op )   printk("SW: denormalized operand\n");
-if ( partial_status & SW_Invalid )     printk("SW: invalid operation\n");
+if ( partial_status & SW_Backward )
+printk("SW: backward compatibility\n");
+if ( partial_status & SW_C3 )
+printk("SW: condition bit 3\n");
+if ( partial_status & SW_C2 )
+printk("SW: condition bit 2\n");
+if ( partial_status & SW_C1 )
+printk("SW: condition bit 1\n");
+if ( partial_status & SW_C0 )
+printk("SW: condition bit 0\n");
+if ( partial_status & SW_Summary )
+printk("SW: exception summary\n");
+if ( partial_status & SW_Stack_Fault )
+printk("SW: stack fault\n");
+if ( partial_status & SW_Precision )
+printk("SW: loss of precision\n");
+if ( partial_status & SW_Underflow )
+printk("SW: underflow\n");
+if ( partial_status & SW_Overflow )
+printk("SW: overflow\n");
+if ( partial_status & SW_Zero_Div )
+printk("SW: divide by zero\n");
+if ( partial_status & SW_Denorm_Op )
+printk("SW: denormalized operand\n");
+if ( partial_status & SW_Invalid )
+printk("SW: invalid operation\n");
 #endif /* DEBUGGING */
 
   printk(" SW: b=%d st=%ld es=%d sf=%d cc=%d%d%d%d ef=%d%d%d%d%d%d\n",
Signature · 1 line
1.5.4.rc3
#1 lore raw

Hi Paolo,

Quoted 32 lines · Paolo Ciarrocchi

Fix trailing statements should be on next line

(quoted diff) +17 -12
-if ( partial_status & SW_C3 )          printk("SW: condition bit 3\n");
-if ( partial_status & SW_C2 )          printk("SW: condition bit 2\n");
-if ( partial_status & SW_C1 )          printk("SW: condition bit 1\n");
-if ( partial_status & SW_C0 )          printk("SW: condition bit 0\n");
-if ( partial_status & SW_Summary )     printk("SW: exception summary\n");
-if ( partial_status & SW_Stack_Fault ) printk("SW: stack fault\n");
-if ( partial_status & SW_Precision )   printk("SW: loss of precision\n");
-if ( partial_status & SW_Underflow )   printk("SW: underflow\n");
-if ( partial_status & SW_Overflow )    printk("SW: overflow\n");
-if ( partial_status & SW_Zero_Div )    printk("SW: divide by zero\n");
-if ( partial_status & SW_Denorm_Op )   printk("SW: denormalized operand\n");
-if ( partial_status & SW_Invalid )     printk("SW: invalid operation\n");
 
+if ( partial_status & SW_Backward )
+printk("SW: backward compatibility\n");
+if ( partial_status & SW_C3 )
+printk("SW: condition bit 3\n");
+if ( partial_status & SW_C2 )
+printk("SW: condition bit 2\n");
+if ( partial_status & SW_C1 )
+printk("SW: condition bit 1\n");
+if ( partial_status & SW_C0 )
+printk("SW: condition bit 0\n");
+if ( partial_status & SW_Summary )
+printk("SW: exception summary\n");
+if ( partial_status & SW_Stack_Fault )
+printk("SW: stack fault\n");
+if ( partial_status & SW_Precision )
+printk("SW: loss of precision\n");
+if ( partial_status & SW_Underflow )

Review

Quoted 10 lines
(quoted diff) +9 -0
+printk("SW: underflow\n");
+if ( partial_status & SW_Overflow )
+printk("SW: overflow\n");
+if ( partial_status & SW_Zero_Div )
+printk("SW: divide by zero\n");
+if ( partial_status & SW_Denorm_Op )
+printk("SW: denormalized operand\n");
+if ( partial_status & SW_Invalid )
+printk("SW: invalid operation\n");
 #endif /* DEBUGGING */

Well, IMHO, the code was more readable and checkable in the initial version. I think this is one example of exceptions where code appearance is more important than style correctness.

Regards,
Willy

#2 lore raw
Quoted 6 lines · Willy Tarreau

Hi Paolo,

Quoted 3 lines · Paolo Ciarrocchi

Fix trailing statements should be on next line

-if ( partial_status & SW_C3 ) printk("SW: condition bit 3\n");

...

Quoted 2 lines
Quoted 2 lines
arch/x86/math-emu/errors.c +2 -0
+if ( partial_status & SW_Backward )
+printk("SW: backward compatibility\n");

...

Quoted 4 lines

Well, IMHO, the code was more readable and checkable in the initial version. I think this is one example of exceptions where code appearance is more important than style correctness.

Besides, the proposed style "fix" itself violates CodingStyle in at least two obvious ways.

Signature · 3 lines
Stefan Richter
-=====-==--- ---= ===-=
http://arcgraph.de/sr/
#3 lore raw
In reply to Willy Tarreau
Quoted 41 lines · Willy Tarreau

Hi Paolo,

Quoted 38 lines · Paolo Ciarrocchi

Fix trailing statements should be on next line

(quoted diff) +23 -12
-if ( partial_status & SW_C3 )          printk("SW: condition bit 3\n");
-if ( partial_status & SW_C2 )          printk("SW: condition bit 2\n");
-if ( partial_status & SW_C1 )          printk("SW: condition bit 1\n");
-if ( partial_status & SW_C0 )          printk("SW: condition bit 0\n");
-if ( partial_status & SW_Summary )     printk("SW: exception summary\n");
-if ( partial_status & SW_Stack_Fault ) printk("SW: stack fault\n");
-if ( partial_status & SW_Precision )   printk("SW: loss of precision\n");
-if ( partial_status & SW_Underflow )   printk("SW: underflow\n");
-if ( partial_status & SW_Overflow )    printk("SW: overflow\n");
-if ( partial_status & SW_Zero_Div )    printk("SW: divide by zero\n");
-if ( partial_status & SW_Denorm_Op )   printk("SW: denormalized operand\n");
-if ( partial_status & SW_Invalid )     printk("SW: invalid operation\n");
 
+if ( partial_status & SW_Backward )
+printk("SW: backward compatibility\n");
+if ( partial_status & SW_C3 )
+printk("SW: condition bit 3\n");
+if ( partial_status & SW_C2 )
+printk("SW: condition bit 2\n");
+if ( partial_status & SW_C1 )
+printk("SW: condition bit 1\n");
+if ( partial_status & SW_C0 )
+printk("SW: condition bit 0\n");
+if ( partial_status & SW_Summary )
+printk("SW: exception summary\n");
+if ( partial_status & SW_Stack_Fault )
+printk("SW: stack fault\n");
+if ( partial_status & SW_Precision )
+printk("SW: loss of precision\n");
+if ( partial_status & SW_Underflow )
+printk("SW: underflow\n");
+if ( partial_status & SW_Overflow )
+printk("SW: overflow\n");
+if ( partial_status & SW_Zero_Div )
+printk("SW: divide by zero\n");
+if ( partial_status & SW_Denorm_Op )
Quoted 8 lines

arch/x86/math-emu/errors.c void FPU_printall(void) · line 122

Quoted 4 lines
arch/x86/math-emu/errors.c +3 -0
+printk("SW: denormalized operand\n");
+if ( partial_status & SW_Invalid )
+printk("SW: invalid operation\n");
 #endif /* DEBUGGING */

Well, IMHO, the code was more readable and checkable in the initial version. I think this is one example of exceptions where code appearance is more important than style correctness.

definitely so. The rule of thumb is: if in doubt, use your human taste. Does it 'look' better? If not, dont do the change.

Ingo