aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-01-17 16:43:16 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-01-17 19:27:30 -0500
commita036119f977eeeae2089ddf5b4759de9ca5fbdb6 (patch)
treeb2375e6d37a5e79fb1a3e890c00c15c15ca2d57a
parentdc4d5ea2218b80eb8cd323082f09c506ba75fb6f (diff)
[PATCH] sky2: optimize for 32 bit dma
Small optimization, if dma addresses are 32 bits, then high bits are always zero. Signed-off-by: Stephen Hemminger <shemminger@osdl.or> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
-rw-r--r--drivers/net/sky2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 3c5d00403e5e..92ea915c1d4b 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -745,7 +745,7 @@ static inline struct sky2_rx_le *sky2_next_rx(struct sky2_port *sky2)
745/* Return high part of DMA address (could be 32 or 64 bit) */ 745/* Return high part of DMA address (could be 32 or 64 bit) */
746static inline u32 high32(dma_addr_t a) 746static inline u32 high32(dma_addr_t a)
747{ 747{
748 return (a >> 16) >> 16; 748 return sizeof(a) > sizeof(u32) ? (a >> 16) >> 16 : 0;
749} 749}
750 750
751/* Build description to hardware about buffer */ 751/* Build description to hardware about buffer */
@@ -1225,7 +1225,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
1225 1225
1226 mapping = pci_map_page(hw->pdev, frag->page, frag->page_offset, 1226 mapping = pci_map_page(hw->pdev, frag->page, frag->page_offset,
1227 frag->size, PCI_DMA_TODEVICE); 1227 frag->size, PCI_DMA_TODEVICE);
1228 addr64 = (mapping >> 16) >> 16; 1228 addr64 = high32(mapping);
1229 if (addr64 != sky2->tx_addr64) { 1229 if (addr64 != sky2->tx_addr64) {
1230 le = get_tx_le(sky2); 1230 le = get_tx_le(sky2);
1231 le->tx.addr = cpu_to_le32(addr64); 1231 le->tx.addr = cpu_to_le32(addr64);