Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933192AbcK1OZL (ORCPT ); Mon, 28 Nov 2016 09:25:11 -0500 Received: from smtprelay0118.hostedemail.com ([216.40.44.118]:37097 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932998AbcK1OYv (ORCPT ); Mon, 28 Nov 2016 09:24:51 -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:3354:3622:3865:3866:3867:3868:3870:3871:3872:3874:4321:5007:6691:7807:9108:10004:10400:10848:11026:11232:11473:11657:11658:11914:12043:12294:12296:12438:12740:12760:13069:13311:13357:13439:14096:14097:14659:14721:21080:30012:30041: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:2,LUA_SUMMARY:none X-HE-Tag: toes52_bf8c7d135640 X-Filterd-Recvd-Size: 3054 Message-ID: <1480343068.14294.5.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: Mon, 28 Nov 2016 06:24:28 -0800 In-Reply-To: <20161128115023.GA15034@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> <1480026433.19726.17.camel@perches.com> <20161128115023.GA15034@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: 1897 Lines: 48 On Mon, 2016-11-28 at 12:50 +0100, Pavel Machek wrote: > On Thu 2016-11-24 14:27:13, Joe Perches wrote: > > 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. > > Can, but should not at this point. Please take a look at the driver in > question before commenting on trivial printk style. I had. It's perfectly acceptable and already uses netif_ properly. This consolidation now introduces the _only_ instance where it is now improperly using a netif_msg_ then single pr_ function sequence that should be consolidated into netif_dbg. Every other use of netif_msg_ then either emits multiple lines or is used in an if/else. cheers, Joe