From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753460AbdC0PKE convert rfc822-to-8bit (ORCPT ); Mon, 27 Mar 2017 11:10:04 -0400 Received: from smtp-out4.electric.net ([192.162.216.186]:61650 "EHLO smtp-out4.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752297AbdC0PKB (ORCPT ); Mon, 27 Mar 2017 11:10:01 -0400 From: David Laight To: "'Pablo Neira Ayuso'" , Arushi Singhal CC: Jozsef Kadlecsik , "David S. Miller" , "netfilter-devel@vger.kernel.org" , "coreteam@netfilter.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "outreachy-kernel@googlegroups.com" Subject: RE: [PATCH] net: netfilter: Remove multiple assignment. Thread-Topic: [PATCH] net: netfilter: Remove multiple assignment. Thread-Index: AQHSpvMtgCYm0SZPB0GUBGSTW5HKwaGoyeUA Date: Mon, 27 Mar 2017 15:09:13 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DCFFBAC5F@AcuExch.aculab.com> References: <20170325124946.GA9109@arushi-HP-Pavilion-Notebook> <20170327120827.GA15676@salvia> In-Reply-To: <20170327120827.GA15676@salvia> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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-Revdns: X-HELO: AcuExch.aculab.com X-TLS: TLSv1:AES128-SHA:128 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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