mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] net: replace commatas with semicolons
@ 2009-02-13 21:46 Thomas Gleixner
  2009-02-13 22:59 ` Peter Zijlstra
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Thomas Gleixner @ 2009-02-13 21:46 UTC (permalink / raw)
  To: LKML; +Cc: David Miller

Impact: syntax fix

Interestingly enough this compiles w/o any complaints:

	orphans = percpu_counter_sum_positive(&tcp_orphan_count),
	sockets = percpu_counter_sum_positive(&tcp_sockets_allocated),

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 net/ipv4/proc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/net/ipv4/proc.c
===================================================================
--- linux-2.6.orig/net/ipv4/proc.c
+++ linux-2.6/net/ipv4/proc.c
@@ -54,8 +54,8 @@ static int sockstat_seq_show(struct seq_
 	int orphans, sockets;
 
 	local_bh_disable();
-	orphans = percpu_counter_sum_positive(&tcp_orphan_count),
-	sockets = percpu_counter_sum_positive(&tcp_sockets_allocated),
+	orphans = percpu_counter_sum_positive(&tcp_orphan_count);
+	sockets = percpu_counter_sum_positive(&tcp_sockets_allocated);
 	local_bh_enable();
 
 	socket_seq_show(seq);

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

* Re: [PATCH] net: replace commatas with semicolons
  2009-02-13 21:46 [PATCH] net: replace commatas with semicolons Thomas Gleixner
@ 2009-02-13 22:59 ` Peter Zijlstra
  2009-02-16  8:11   ` David Miller
  2009-02-16  8:09 ` David Miller
  2009-02-16 14:00 ` Johannes Weiner
  2 siblings, 1 reply; 5+ messages in thread
From: Peter Zijlstra @ 2009-02-13 22:59 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: LKML, David Miller

On Fri, 2009-02-13 at 22:46 +0100, Thomas Gleixner wrote:
> Impact: syntax fix
> 
> Interestingly enough this compiles w/o any complaints:
> 
> 	orphans = percpu_counter_sum_positive(&tcp_orphan_count),
> 	sockets = percpu_counter_sum_positive(&tcp_sockets_allocated),

Yep, the wonders of the , operator. Look her up the next time you're
reading the C specs and marvel :-)


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

* Re: [PATCH] net: replace commatas with semicolons
  2009-02-13 21:46 [PATCH] net: replace commatas with semicolons Thomas Gleixner
  2009-02-13 22:59 ` Peter Zijlstra
@ 2009-02-16  8:09 ` David Miller
  2009-02-16 14:00 ` Johannes Weiner
  2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2009-02-16  8:09 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel

From: Thomas Gleixner <tglx@linutronix.de>
Date: Fri, 13 Feb 2009 22:46:21 +0100 (CET)

> Impact: syntax fix
> 
> Interestingly enough this compiles w/o any complaints:
> 
> 	orphans = percpu_counter_sum_positive(&tcp_orphan_count),
> 	sockets = percpu_counter_sum_positive(&tcp_sockets_allocated),
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

Applied, please CC: netdev on future patches so that they
get properly tracked at:

	http://patchwork.ozlabs.org/project/netdev/list/

Thank you.

> ---
>  net/ipv4/proc.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Index: linux-2.6/net/ipv4/proc.c
> ===================================================================
> --- linux-2.6.orig/net/ipv4/proc.c
> +++ linux-2.6/net/ipv4/proc.c
> @@ -54,8 +54,8 @@ static int sockstat_seq_show(struct seq_
>  	int orphans, sockets;
>  
>  	local_bh_disable();
> -	orphans = percpu_counter_sum_positive(&tcp_orphan_count),
> -	sockets = percpu_counter_sum_positive(&tcp_sockets_allocated),
> +	orphans = percpu_counter_sum_positive(&tcp_orphan_count);
> +	sockets = percpu_counter_sum_positive(&tcp_sockets_allocated);
>  	local_bh_enable();
>  
>  	socket_seq_show(seq);

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

* Re: [PATCH] net: replace commatas with semicolons
  2009-02-13 22:59 ` Peter Zijlstra
@ 2009-02-16  8:11   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2009-02-16  8:11 UTC (permalink / raw)
  To: peterz; +Cc: tglx, linux-kernel

From: Peter Zijlstra <peterz@infradead.org>
Date: Fri, 13 Feb 2009 23:59:43 +0100

> On Fri, 2009-02-13 at 22:46 +0100, Thomas Gleixner wrote:
> > Impact: syntax fix
> > 
> > Interestingly enough this compiles w/o any complaints:
> > 
> > 	orphans = percpu_counter_sum_positive(&tcp_orphan_count),
> > 	sockets = percpu_counter_sum_positive(&tcp_sockets_allocated),
> 
> Yep, the wonders of the , operator. Look her up the next time you're
> reading the C specs and marvel :-)

"," has nothing on "sizeof(unsigned (long))" which is accepted
by C compilers too. :-)


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

* Re: [PATCH] net: replace commatas with semicolons
  2009-02-13 21:46 [PATCH] net: replace commatas with semicolons Thomas Gleixner
  2009-02-13 22:59 ` Peter Zijlstra
  2009-02-16  8:09 ` David Miller
@ 2009-02-16 14:00 ` Johannes Weiner
  2 siblings, 0 replies; 5+ messages in thread
From: Johannes Weiner @ 2009-02-16 14:00 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: LKML, David Miller

On Fri, Feb 13, 2009 at 10:46:21PM +0100, Thomas Gleixner wrote:
> Impact: syntax fix
> 
> Interestingly enough this compiles w/o any complaints:
> 
> 	orphans = percpu_counter_sum_positive(&tcp_orphan_count),
> 	sockets = percpu_counter_sum_positive(&tcp_sockets_allocated),

C's equivalent of Common Lisps PROGN.  Try:

	a = (foo(), 2);

it's magic!

	Hannes

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

end of thread, other threads:[~2009-02-16 13:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-13 21:46 [PATCH] net: replace commatas with semicolons Thomas Gleixner
2009-02-13 22:59 ` Peter Zijlstra
2009-02-16  8:11   ` David Miller
2009-02-16  8:09 ` David Miller
2009-02-16 14:00 ` Johannes Weiner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome