patch-2.4.9 linux/drivers/net/3c505.c

Next file: linux/drivers/net/3c59x.c
Previous file: linux/drivers/mtd/devices/docecc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.8/linux/drivers/net/3c505.c linux/drivers/net/3c505.c
@@ -607,7 +607,7 @@
 
 	skb_reserve(skb, 2);
 	target = skb_put(skb, rlen);
-	if (virt_to_bus(target + rlen) >= MAX_DMA_ADDRESS) {
+	if ((unsigned long)(target + rlen) >= MAX_DMA_ADDRESS) {
 		adapter->current_dma.target = target;
 		target = adapter->dma_buffer;
 	} else {
@@ -1027,10 +1027,12 @@
 	adapter->current_dma.direction = 1;
 	adapter->current_dma.start_time = jiffies;
 
-	target = virt_to_bus(skb->data);
-	if ((target + nlen) >= MAX_DMA_ADDRESS) {
+	if ((unsigned long)(skb->data + nlen) >= MAX_DMA_ADDRESS) {
 		memcpy(adapter->dma_buffer, skb->data, nlen);
 		target = virt_to_bus(adapter->dma_buffer);
+	}
+	else {
+		target = virt_to_bus(skb->data);
 	}
 	adapter->current_dma.skb = skb;
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)