@@ -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)
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(-)