rt2x00: Optimize unmapping of skbs
authorHelmut Schaa <helmut.schaa@googlemail.com>
Sat, 9 Oct 2010 11:33:43 +0000 (13:33 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 11 Oct 2010 19:04:21 +0000 (15:04 -0400)
Since no skb will be mapped for RX and TX at the same time we can
simply shortcut the check for SKBDESC_DMA_MAPPED_TX.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00queue.c

index 6d41599a090c9c71fbd3fe8eff60ee28cd199d7d..4436ff72c864f2b67bb1fb0c6fb64a59eaf9acbf 100644 (file)
@@ -115,9 +115,7 @@ void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb)
                dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, skb->len,
                                 DMA_FROM_DEVICE);
                skbdesc->flags &= ~SKBDESC_DMA_MAPPED_RX;
-       }
-
-       if (skbdesc->flags & SKBDESC_DMA_MAPPED_TX) {
+       } else if (skbdesc->flags & SKBDESC_DMA_MAPPED_TX) {
                dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, skb->len,
                                 DMA_TO_DEVICE);
                skbdesc->flags &= ~SKBDESC_DMA_MAPPED_TX;