Skip to contentSkip to conversation

net: replace commatas with semicolons

PATCH Applied Thomas Gleixner 4 participants 5 messages Feb 13, 2009 – Feb 16, 2009 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: replace commatas with semicolons

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),

---
 net/ipv4/proc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv4/proc.c +2 -2
Index: 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);
#1 lore raw
Quoted 6 lines · Thomas Gleixner

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 :-)

maintainer
#2 lore raw

From: Peter Zijlstra <[email protected]>
Date: Fri, 13 Feb 2009 23:59:43 +0100

Quoted 10 lines · Thomas Gleixner
Quoted 6 lines

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. :-)

maintainer Applied
#3 lore raw
In reply to Thomas Gleixner

From: Thomas Gleixner <[email protected]>
Date: Fri, 13 Feb 2009 22:46:21 +0100 (CET)

Quoted 8 lines

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),

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

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

Thank you.

Quoted 19 lines
---
 net/ipv4/proc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/net/ipv4/proc.c
===================================================================

net/ipv4/proc.c +2 -2
@@ -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);
#4 lore raw
In reply to Thomas Gleixner
Quoted 6 lines · Thomas Gleixner

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