From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752080AbdKHLjs (ORCPT ); Wed, 8 Nov 2017 06:39:48 -0500 Received: from smtprelay0117.hostedemail.com ([216.40.44.117]:42750 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751826AbdKHLjq (ORCPT ); Wed, 8 Nov 2017 06:39:46 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1431:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3165:3354:3622:3865:3866:3867:3868:3870:3871:3872:3874:4250:4321:4605:5007:7514:7875:7903:8531:8957:9121:10004:10400:10848:11026:11232:11233:11657:11658:11914:12043:12048:12262:12296:12438:12555:12679:12700:12737:12740:12760:12895:12986:13439:14093:14096:14097:14181:14659:14721:21080:21324:21365:21433:21451:21611:21627:30012:30030:30034:30051:30054:30064:30070:30075:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: war40_1acd7c4559018 X-Filterd-Recvd-Size: 3754 Message-ID: <1510141182.15768.17.camel@perches.com> Subject: Re: [PATCH] staging: fsl-dpaa2: Fix multiple assignments should be avoided From: Joe Perches To: Dan Carpenter , Greg KH , Randy Dunlap , Andy Whitcroft Cc: Joshua Abraham , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Wed, 08 Nov 2017 03:39:42 -0800 In-Reply-To: <20171108094033.d2swiivinynlatlm@mwanda> References: <20171108004503.GA27756@josharch> <20171108092048.GB22620@kroah.com> <20171108094033.d2swiivinynlatlm@mwanda> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2017-11-08 at 12:40 +0300, Dan Carpenter wrote: > On Wed, Nov 08, 2017 at 10:20:48AM +0100, Greg KH wrote: > > On Tue, Nov 07, 2017 at 07:45:03PM -0500, Joshua Abraham wrote: > > > This patch fixes the checkpatch.pl warning: > > > "CHECK: multiple assignments should be avoided" > > > > > > Signed-off-by: Joshua Abraham > > > --- > > > drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c > > > index 0d8ed002adcb..384218946108 100644 > > > --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c > > > +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c > > > @@ -1661,7 +1661,8 @@ static void set_fq_affinity(struct dpaa2_eth_priv *priv) > > > * This may well change at runtime, either through irqbalance or > > > * through direct user intervention. > > > */ > > > - rx_cpu = txc_cpu = cpumask_first(&priv->dpio_cpumask); > > > + rx_cpu = cpumask_first(&priv->dpio_cpumask); > > > + txc_cpu = rx_cpu; > > > > The original code here makes much more sense, doesn't it? > > > > Sometimes checkpatch is wrong :) > > It feels like the majority of these multiple assignment warnings are > wrong. I thought it would be a good idea at first but after looking at > a bunch of the patches it feels like we should just remove the check. I don't have a particular opinion one way or another. That bit was added to CodingStyle by Randy Dunlap back in 2006 by commit b3fc9941fbc6efe5cb77728adb0fb12be363e73e Author: Randy Dunlap Date: Sun Dec 10 02:18:56 2006 -0800 [PATCH] CodingStyle updates Add some kernel coding style comments, mostly pulled from emails by Andrew Morton, Jesper Juhl, and Randy Dunlap. - add paragraph on switch/case indentation (with fixes) - add paragraph on multiple-assignments - add more on Braces - add section on Spaces; add typeof, alignof, & __attribute__ with sizeof; add more on postfix/prefix increment/decrement operators - add paragraph on function breaks in source files; add info on function prototype parameter names - add paragraph on EXPORT_SYMBOL placement - add section on /*-comment style, long-comment style, and data declarations and comments - correct some chapter number references that were missed when chapters were renumbered Signed-off-by: Randy Dunlap Acked-by: Jesper Juhl Acked-by: Jan Engelhardt Signed-off-by: Andrew Morton