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


Groups > linux.kernel > #1609941

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

Path csiph.com!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From David Laight <David.Laight@ACULAB.COM>
Newsgroups linux.kernel
Subject RE: [PATCH] net: netfilter: Remove multiple assignment.
Date Mon, 27 Mar 2017 17:20:02 +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>
Thread-Topic [PATCH] net: netfilter: Remove multiple assignment.
Thread-Index AQHSpvMtgCYm0SZPB0GUBGSTW5HKwaGoyeUA
Accept-Language en-GB, en-US
Content-Language en-US
X-Originating-IP [10.202.99.200]
Content-Type text/plain; charset="Windows-1252"
Content-Transfer-Encoding 8BIT
MIME-Version 1.0
X-Outbound-IP 213.249.233.130
X-Env-From David.Laight@ACULAB.COM
X-Proto esmtps
X-Helo AcuExch.aculab.com
X-Tls TLSv1:AES128-SHA:128
X-Policysmart 3396946, 3397078
X-Virus-Status Scanned by VirusSMART (c)
X-Virus-Status Scanned by VirusSMART (s)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 21
Organization linux.* mail to news gateway
X-Original-Cc Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>, "David S. Miller" <davem@davemloft.net>, "netfilter-devel@vger.kernel.org" <netfilter-devel@vger.kernel.org>, "coreteam@netfilter.org" <coreteam@netfilter.org>, "netdev@vger.kernel.org" <netdev@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "outreachy-kernel@googlegroups.com" <outreachy-kernel@googlegroups.com>
X-Original-Date Mon, 27 Mar 2017 15:09:13 +0000
X-Original-Message-ID <063D6719AE5E284EB5DD2968C1650D6DCFFBAC5F@AcuExch.aculab.com>
X-Original-References <20170325124946.GA9109@arushi-HP-Pavilion-Notebook> <20170327120827.GA15676@salvia>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1609941

Show key headers only | 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