patch-2.3.46 linux/drivers/char/esp.c

Next file: linux/drivers/char/ftape/lowlevel/ftape-buffer.c
Previous file: linux/drivers/char/dz.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.45/linux/drivers/char/esp.c linux/drivers/char/esp.c
@@ -203,20 +203,6 @@
 	outb(value, info->port+offset);
 }
 
-static inline int __get_order(unsigned long size)
-{
-	int order;
-
-	size = (size + PAGE_SIZE -1) >> PAGE_SHIFT;
-	order = -1;
-	do {
-		size >>= 1;
-		order++;
-	} while (size);
-
-	return order;
-}
-
 /*
  * ------------------------------------------------------------
  * rs_stop() and rs_start()
@@ -965,14 +951,14 @@
 
 	if (!(info->stat_flags & ESP_STAT_USE_PIO) && !dma_buffer) {
 		dma_buffer = (char *)__get_dma_pages(
-			GFP_KERNEL, __get_order(DMA_BUFFER_SZ));
+			GFP_KERNEL, get_order(DMA_BUFFER_SZ));
 
 		/* use PIO mode if DMA buf/chan cannot be allocated */
 		if (!dma_buffer)
 			info->stat_flags |= ESP_STAT_USE_PIO;
 		else if (request_dma(dma, "esp serial")) {
 			free_pages((unsigned int)dma_buffer,
-				   __get_order(DMA_BUFFER_SZ));
+				   get_order(DMA_BUFFER_SZ));
 			dma_buffer = 0;
 			info->stat_flags |= ESP_STAT_USE_PIO;
 		}
@@ -1076,7 +1062,7 @@
 		if (!current_port) {
 			free_dma(dma);
 			free_pages((unsigned int)dma_buffer,
-				   __get_order(DMA_BUFFER_SZ));
+				   get_order(DMA_BUFFER_SZ));
 			dma_buffer = 0;
 		}		
 	}
@@ -2785,7 +2771,7 @@
 
 	if (dma_buffer)
 		free_pages((unsigned int)dma_buffer,
-			__get_order(DMA_BUFFER_SZ));
+			get_order(DMA_BUFFER_SZ));
 
 	if (tmp_buf)
 		free_page((unsigned long)tmp_buf);

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