diff mbox

cxgb4: Remove need_skb_unmap and adjust its callers.

Message ID 1267326024-3610-1-git-send-email-dm@chelsio.com
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Dimitris Michailidis Feb. 28, 2010, 3 a.m. UTC
Applies on top of the V3 patches.

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
 drivers/net/cxgb4/sge.c |   29 +++--------------------------
 1 files changed, 3 insertions(+), 26 deletions(-)

Comments

David Miller Feb. 28, 2010, 8:27 a.m. UTC | #1
From: Dimitris Michailidis <dm@chelsio.com>
Date: Sat, 27 Feb 2010 19:00:24 -0800

> Applies on top of the V3 patches.
> 
> Signed-off-by: Dimitris Michailidis <dm@chelsio.com>

Please just post a V4 that doesn't have this code in it.
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/cxgb4/sge.c b/drivers/net/cxgb4/sge.c
index 34617f8..eb81d73 100644
--- a/drivers/net/cxgb4/sge.c
+++ b/drivers/net/cxgb4/sge.c
@@ -298,25 +298,6 @@  unmap:			dma_unmap_page(dev, be64_to_cpu(p->addr[0]),
 }
 
 /**
- *	need_skb_unmap - does the platform need unmapping of sk_buffs?
- *
- *	Returns true if the platfrom needs sk_buff unmapping.  The compiler
- *	optimizes away unecessary code if this returns true.
- */
-static inline int need_skb_unmap(void)
-{
-	/*
-	 * This structure is used to tell if the platfrom needs buffer
-	 * unmapping by checking if DECLARE_PCI_UNMAP_ADDR defines anything.
-	 */
-	struct dummy {
-		DECLARE_PCI_UNMAP_ADDR(addr);
-	};
-
-	return sizeof(struct dummy) != 0;
-}
-
-/**
  *	free_tx_desc - reclaims Tx descriptors and their buffers
  *	@adapter: the adapter
  *	@q: the Tx queue to reclaim descriptors from
@@ -333,12 +314,10 @@  static void free_tx_desc(struct adapter *adap, struct sge_txq *q,
 	unsigned int cidx = q->cidx;
 	struct device *dev = adap->pdev_dev;
 
-	const int need_unmap = need_skb_unmap() && unmap;
-
 	d = &q->sdesc[cidx];
 	while (n--) {
 		if (d->skb) {                       /* an SGL is present */
-			if (need_unmap)
+			if (unmap)
 				unmap_sgl(dev, d->skb, d->sgl, q);
 			kfree_skb(d->skb);
 			d->skb = NULL;
@@ -1300,10 +1279,8 @@  static void service_ofldq(struct sge_ofld_txq *q)
 				  pos + flits, hdr_len,
 				  (dma_addr_t *)skb->head);
 
-			if (need_skb_unmap()) {
-				skb->dev = q->adap->port[0];
-				skb->destructor = deferred_unmap_destructor;
-			}
+			skb->dev = q->adap->port[0];
+			skb->destructor = deferred_unmap_destructor;
 
 			last_desc = q->q.pidx + ndesc - 1;
 			if (last_desc >= q->q.size)