patch-2.3.46 linux/arch/sparc64/kernel/sbus.c

Next file: linux/arch/sparc64/kernel/smp.c
Previous file: linux/arch/sparc64/kernel/pci_sabre.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.45/linux/arch/sparc64/kernel/sbus.c linux/arch/sparc64/kernel/sbus.c
@@ -255,11 +255,8 @@
 		return NULL;
 
 	size = PAGE_ALIGN(size);
-	for (order = 0; order < 10; order++) {
-		if ((PAGE_SIZE << order) >= size)
-			break;
-	}
-	if (order == 10)
+	order = get_order(size);
+	if (order >= 10)
 		return NULL;
 	first_page = __get_free_pages(GFP_KERNEL, order);
 	if (first_page == 0UL)
@@ -306,10 +303,7 @@
 	free_consistent_cluster(iommu, dvma, npages);
 	spin_unlock_irq(&iommu->lock);
 
-	for (order = 0; order < 10; order++) {
-		if ((PAGE_SIZE << order) >= size)
-			break;
-	}
+	order = get_order(size);
 	if (order < 10)
 		free_pages((unsigned long)cpu, order);
 }

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