Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1609941

RE: [PATCH] net: netfilter: Remove multiple assignment.

From David Laight <David.Laight@ACULAB.COM>
Newsgroups linux.kernel
Subject RE: [PATCH] net: netfilter: Remove multiple assignment.
Date 2017-03-27 17:20 +0200
Message-ID <tpEB3-1AA-3@gated-at.bofh.it> (permalink)
References <toTst-WD-3@gated-at.bofh.it> <tpBDc-7On-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Pablo Neira Ayuso
> Sent: 27 March 2017 13:08
> On Sat, Mar 25, 2017 at 06:19:47PM +0530, Arushi Singhal wrote:
> > This patch removes multiple assignments.
> > Done using coccinelle.
> > @@
> > identifier i1,i2;
> > constant c;
> > @@
> > - i1=i2=c;
> > + i1=c;
> > + i2=c;
> 
> You have to explain why this is bad.

And your substituted code isn't equivalent.
The correct replacement is:
	i2 = c;
	i1 = i2;

	David

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] net: netfilter: Remove multiple assignment. Arushi Singhal <arushisinghal19971997@gmail.com> - 2017-03-25 14:00 +0100
  Re: [PATCH] net: netfilter: Remove multiple assignment. Pablo Neira Ayuso <pablo@netfilter.org> - 2017-03-27 14:10 +0200
    Re: [Outreachy kernel] Re: [PATCH] net: netfilter: Remove multiple  assignment. Pablo Neira Ayuso <pablo@netfilter.org> - 2017-03-27 14:30 +0200
    RE: [PATCH] net: netfilter: Remove multiple assignment. David Laight <David.Laight@ACULAB.COM> - 2017-03-27 17:20 +0200

csiph-web