lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1267326024-3610-1-git-send-email-dm@chelsio.com>
Date:	Sat, 27 Feb 2010 19:00:24 -0800
From:	Dimitris Michailidis <dm@...lsio.com>
To:	netdev@...r.kernel.org
Subject: [PATCH] cxgb4: Remove need_skb_unmap and adjust its callers.

Applies on top of the V3 patches.

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

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)
-- 
1.5.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ