patch-2.3.46 linux/arch/sparc/kernel/ioport.c
Next file: linux/arch/sparc/kernel/sparc_ksyms.c
Previous file: linux/arch/ppc/kernel/process.c
Back to the patch index
Back to the overall index
- Lines: 64
- Date:
Mon Feb 14 15:34:21 2000
- Orig file:
v2.3.45/linux/arch/sparc/kernel/ioport.c
- Orig date:
Sun Feb 13 19:29:03 2000
diff -u --recursive --new-file v2.3.45/linux/arch/sparc/kernel/ioport.c linux/arch/sparc/kernel/ioport.c
@@ -44,7 +44,6 @@
#include <asm/pgtable.h>
struct resource *_sparc_find_resource(struct resource *r, unsigned long);
-int _sparc_len2order(unsigned long len);
static void *_sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz);
static void *_sparc_alloc_io(unsigned int busno, unsigned long phys,
@@ -280,7 +279,7 @@
return NULL;
}
- order = _sparc_len2order(len_total);
+ order = get_order(len_total);
va = __get_free_pages(GFP_KERNEL, order);
if (va == 0) {
/*
@@ -341,7 +340,7 @@
pgp = (unsigned long) phys_to_virt(mmu_translate_dvma(ba));
mmu_unmap_dma_area(ba, n);
- free_pages(pgp, _sparc_len2order(n));
+ free_pages(pgp, get_order(n));
}
/*
@@ -482,7 +481,7 @@
return NULL;
}
- order = _sparc_len2order(len_total);
+ order = get_order(len_total);
va = __get_free_pages(GFP_KERNEL, order);
if (va == 0) {
printk("pci_alloc_consistent: no %ld pages\n", len_total>>PAGE_SHIFT);
@@ -569,7 +568,7 @@
release_resource(res);
kfree(res);
- free_pages(pgp, _sparc_len2order(n));
+ free_pages(pgp, get_order(n));
}
/* Map a single buffer of the indicated size for DMA in streaming mode.
@@ -737,19 +736,6 @@
return tmp;
}
return NULL;
-}
-
-int
-_sparc_len2order(unsigned long len)
-{
- int order;
-
- for (order = 0; order < 7; order++) /* 2^6 pages == 256K */
- if ((1 << (order + PAGE_SHIFT)) >= len)
- return order;
- printk("len2order: from %p: len %lu(0x%lx) yields order >=7.\n",
- __builtin_return_address(0), len, len);
- return 1;
}
/*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)