aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavem <davem>2001-12-11 11:13:06 +0000
committerdavem <davem>2001-12-11 11:13:06 +0000
commitd4556a16dda21d9e0f5a8411520606a8693a59c6 (patch)
tree9f008a383426efc1d1a522b2781fcfa32724364b
parenta774639a8ed1012610933c9bf8ad89aeb5c79c7e (diff)
downloadnetdev-vger-cvs-d4556a16dda21d9e0f5a8411520606a8693a59c6.tar.gz
Dont code very late at night kiddies or you too
will make mistakes like this...
-rw-r--r--arch/sparc64/kernel/iommu_common.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/sparc64/kernel/iommu_common.c b/arch/sparc64/kernel/iommu_common.c
index 084d8a242..4269e264c 100644
--- a/arch/sparc64/kernel/iommu_common.c
+++ b/arch/sparc64/kernel/iommu_common.c
@@ -1,4 +1,4 @@
-/* $Id: iommu_common.c,v 1.7 2001-12-11 04:55:51 davem Exp $
+/* $Id: iommu_common.c,v 1.8 2001-12-11 11:13:06 davem Exp $
* iommu_common.c: UltraSparc SBUS/PCI common iommu code.
*
* Copyright (C) 1999 David S. Miller (davem@redhat.com)
@@ -205,7 +205,10 @@ unsigned long prepare_sg(struct scatterlist *sg, int nents)
sg->address :
page_address(sg->page) + sg->offset);
prev += (unsigned long) (dent_len = sg->length);
- dent_addr = (u32) (prev & (IO_PAGE_SIZE - 1UL));
+ dent_addr = (u32) ((unsigned long)(sg->address ?
+ sg->address :
+ page_address(sg->page) + sg->offset)
+ & (IO_PAGE_SIZE - 1UL));
while (--nents) {
unsigned long addr;