patch-1.3.50 linux/include/asm-alpha/apecs.h

Next file: linux/include/asm-alpha/byteorder.h
Previous file: linux/fs/xiafs/symlink.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.49/linux/include/asm-alpha/apecs.h linux/include/asm-alpha/apecs.h
@@ -170,6 +170,14 @@
 
 extern inline void * bus_to_virt(unsigned long address)
 {
+	/*
+	 * This check is a sanity check but also ensures that bus
+	 * address 0 maps to virtual address 0 which is useful to
+	 * detect null "pointers" (the NCR driver is much simpler if
+	 * NULL pointers are preserved).
+	 */
+	if (address < APECS_DMA_WIN_BASE)
+		return 0;
 	return phys_to_virt(address - APECS_DMA_WIN_BASE);
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this