Thread (64 messages) flat view 64 messages, 10 authors, 2016-12-11

Re: [PATCH] stmmac ethernet: remove cut & paste code

From: Joe Perches <joe@perches.com>
Date: 2016-11-24 22:27:37
Also in: lkml

On Thu, 2016-11-24 at 22:44 +0100, Pavel Machek wrote:
On Thu 2016-11-24 12:05:25, Joe Perches wrote:
quoted
On Thu, 2016-11-24 at 12:05 +0100, Pavel Machek wrote:
quoted
Remove duplicate code from _tx routines.
trivia:
quoted
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
[]
quoted
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help