Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966444AbcKXUFd (ORCPT ); Thu, 24 Nov 2016 15:05:33 -0500 Received: from smtprelay0095.hostedemail.com ([216.40.44.95]:47957 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757372AbcKXUFb (ORCPT ); Thu, 24 Nov 2016 15:05:31 -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:1381:1437:1515:1516:1518:1534:1539:1593:1594:1711:1714:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3350:3622:3876:3877:4321:5007:6114:6642:10004:10400:10848:11026:11232:11473:11657:11658:11914:12043:12048: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:1,LUA_SUMMARY:none X-HE-Tag: cat01_86ee9c5d48631 X-Filterd-Recvd-Size: 1736 Message-ID: <1480017925.19726.13.camel@perches.com> Subject: Re: [PATCH] stmmac ethernet: remove cut & paste code From: Joe Perches To: Pavel Machek , 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 12:05:25 -0800 In-Reply-To: <20161124110548.GB30723@amd> References: <20161123105125.GA26394@amd> <20161124085506.GA25007@amd> <20161124102901.GA27793@amd> <20161124103630.GB27793@amd> <20161124104619.GA30723@amd> <20161124110548.GB30723@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: 750 Lines: 21 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__);