Skip to contentSkip to conversation

net: netfilter: Remove multiple assignment.

PATCH In review Arushi Singhal 2 participants 2 messages Mar 27, 2017 – Apr 6, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: netfilter: Remove multiple assignment.

This patch removes multiple assignments to follow the kernel coding style as also reported by checkpatch.pl.
Done using coccinelle.
@@
identifier i1,i2;
constant c;
@@
- i1=i2=c;
+ i1=c;
+ i2=i1;

---
changes in v2
-Make the commit message more clear and appropriate.

 net/netfilter/nf_conntrack_proto_sctp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/netfilter/nf_conntrack_proto_sctp.c +2 -1
index 33279aab583d..723386bcc2cb 100644
@@ -346,7 +346,8 @@ static int sctp_packet(struct nf_conn *ct,
 		goto out;
 	}
 
-	old_state = new_state = SCTP_CONNTRACK_NONE;
+	old_state = SCTP_CONNTRACK_NONE;
+	new_state = old_state;
 	spin_lock_bh(&ct->lock);
 	for_each_sctp_chunk (skb, sch, _sch, offset, dataoff, count) {
 		/* Special cases of Verification tag check (Sec 8.5.1) */
Signature · 1 line
2.11.0
#1 lore raw

Hi Arushi,

Quoted 10 lines · Arushi Singhal

This patch removes multiple assignments to follow the kernel coding style as also reported by checkpatch.pl.
Done using coccinelle.
@@
identifier i1,i2;
constant c;
@@
- i1=i2=c;
+ i1=c;
+ i2=i1;

I see more multiple assignments like this under:

net/netfilter/
net/ipv4/netfilter/
net/ipv6/netfilter/
net/bridge/netfilter/

So I would prefer whether fix them all or none.

Thanks!