Thread (58 messages) 58 messages, 10 authors, 2009-12-06

Re: [net-next-2.6 PATCH] net/ipv4: Move && and || to end of previous line

From: Ilpo Järvinen <hidden>
Date: 2009-11-23 22:32:53

On Mon, 23 Nov 2009, Joe Perches wrote:
On Tue, 2009-11-24 at 00:08 +0200, Ilpo Järvinen wrote:
quoted
Certainly better in general already but there is still some work to be 
done here as now you have an && only line. I guess it mostly has to do 
with comments but #if... blahblahs could be another type of failure (in 
automation like this).
The current form is

	if (foo 
#ifdef BAR
	    && bar
#endif
	   )

Another option could be:

#ifdef BAR
	if (foo && bar)
#else
	if (foo)
#endif

In any case, it won't be pretty.
But wouldn't your automation produce:

#ifdef BAR
	if (foo
#endif
	    &&
	    bar

? Like it did for the case where there was a comment between.

As I didn't go through the whole patch I don't know if there were in fact 
any #if things that got made into that kind of construct or not (just 
mentioned it that such places might also be affected incorrectly by your 
automation). I only noticed one of such after comment (ie., && on 
otherwise empty line) and hit reply.

-- 
 i.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help