patch-2.4.20 linux-2.4.20/arch/sparc/mm/io-unit.c
Next file: linux-2.4.20/arch/sparc/mm/iommu.c
Previous file: linux-2.4.20/arch/sparc/mm/init.c
Back to the patch index
Back to the overall index
- Lines: 20
- Date:
Thu Nov 28 15:53:12 2002
- Orig file:
linux-2.4.19/arch/sparc/mm/io-unit.c
- Orig date:
Sun Feb 18 19:49:54 2001
diff -urN linux-2.4.19/arch/sparc/mm/io-unit.c linux-2.4.20/arch/sparc/mm/io-unit.c
@@ -130,7 +130,8 @@
/* FIXME: Cache some resolved pages - often several sg entries are to the same page */
spin_lock_irqsave(&iounit->lock, flags);
- for (; sz >= 0; sz--) {
+ while (sz != 0) {
+ sz--;
sg[sz].dvma_address = iounit_get_area(iounit, (unsigned long)sg[sz].address, sg[sz].length);
sg[sz].dvma_length = sg[sz].length;
}
@@ -158,7 +159,8 @@
struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
spin_lock_irqsave(&iounit->lock, flags);
- for (; sz >= 0; sz--) {
+ while (sz != 0) {
+ --sz;
len = ((sg[sz].dvma_address & ~PAGE_MASK) + sg[sz].length + (PAGE_SIZE-1)) >> PAGE_SHIFT;
vaddr = (sg[sz].dvma_address - IOUNIT_DMA_BASE) >> PAGE_SHIFT;
IOD(("iounit_release %08lx-%08lx\n", (long)vaddr, (long)len+vaddr));
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)