Thread (10 messages) 10 messages, 6 authors, 2007-07-13

Re: [PATCH] sb1250-duart.c: SB1250 DUART serial support

From: Alistair John Strachan <alistair@devzero.co.uk>
Date: 2007-07-12 19:16:23
Also in: linux-serial, lkml

On Thursday 12 July 2007 19:16:20 Maciej W. Rozycki wrote:
On Thu, 12 Jul 2007, Andy Whitcroft wrote:
[snip]
quoted
WARNING: declaring multiple variables together should be avoided
#372: FILE: drivers/serial/sb1250-duart.c:246:
+	unsigned int mctrl, status;
 Well, this is probably superfluous -- why would anyone prefer:

	int r0;
	int r1;
	int r2;
	int r3;
	int r4;

to:

	int r0, r1, r2, r3, r4;

unconditionally?
Imagine you're working on a piece of kernel code that has a lot of parallel 
churn. Conflicts on lines like "int a,b,c,d;" are more likely to cause Andrew 
et al pain, which I guess is the rationale for discouraging it. Conversely, 
if the variables are kept separate, diff handles it fine.

I think as long as the variables are logically grouped, the pain is minimised, 
but there's a few good reasons for the verbose style.

-- 
Cheers,
Alistair.

137/1 Warrender Park Road, Edinburgh, UK.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help