Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966659AbcKXW1h (ORCPT ); Thu, 24 Nov 2016 17:27:37 -0500 Received: from smtprelay0067.hostedemail.com ([216.40.44.67]:50487 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965961AbcKXW11 (ORCPT ); Thu, 24 Nov 2016 17:27:27 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2110:2194:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3872:4321:5007:9108:10004:10400:10848:11026:11232:11473:11657:11658:11914:12043:12294:12296:12438:12740:12760:13069:13311:13357:13439:14659:14721:21080:30012:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:4,LUA_SUMMARY:none X-HE-Tag: fold53_3f63d1c428156 X-Filterd-Recvd-Size: 2358 Message-ID: <1480026433.19726.17.camel@perches.com> Subject: Re: [PATCH] stmmac ethernet: remove cut & paste code From: Joe Perches To: Pavel Machek Cc: peppe.cavallaro@st.com, netdev@vger.kernel.org, kernel list , ezequiel@vanguardiasur.com.ar, sonic.zhang@analog.com, fabrice.gasnier@st.com Date: Thu, 24 Nov 2016 14:27:13 -0800 In-Reply-To: <20161124214401.GA25662@amd> References: <20161123105125.GA26394@amd> <20161124085506.GA25007@amd> <20161124102901.GA27793@amd> <20161124103630.GB27793@amd> <20161124104619.GA30723@amd> <20161124110548.GB30723@amd> <1480017925.19726.13.camel@perches.com> <20161124214401.GA25662@amd> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.1-0ubuntu2 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 Content-Length: 1283 Lines: 38 On Thu, 2016-11-24 at 22:44 +0100, Pavel Machek wrote: > On Thu 2016-11-24 12:05:25, Joe Perches wrote: > > On Thu, 2016-11-24 at 12:05 +0100, Pavel Machek wrote: > > > Remove duplicate code from _tx routines. > > > > trivia: > > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > > > [] > > > @@ -1960,6 +1960,38 @@ static void stmmac_tso_allocator(struct stmmac_priv *priv, unsigned int des, > > > } > > > } > > > > > > +static void stmmac_xmit_common(struct sk_buff *skb, struct net_device *dev, int nfrags, struct dma_desc *desc) > > > +{ > > > + struct stmmac_priv *priv = netdev_priv(dev); > > > + > > > + if (unlikely(stmmac_tx_avail(priv) <= (MAX_SKB_FRAGS + 1))) { > > > + if (netif_msg_hw(priv)) > > > + pr_debug("%s: stop transmitted packets\n", __func__); > > > > netif_dbg(priv, hw, dev, "%s: stop transmitted packets\n", > > __func__); > > Not now. Modifying the code while de-duplicating would be bad idea. Too many people think overly granular patches are the best and only way to make changes. Deduplication and consolidation can happen simultaneously. > (And it looks like the driver has rather more serious problems than > printk style...) Probably so. cheers, Joe