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

Next file: linux/include/asm-alpha/param.h
Previous file: linux/include/asm-alpha/io.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.49/linux/include/asm-alpha/lca.h linux/include/asm-alpha/lca.h
@@ -143,6 +143,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 < LCA_DMA_WIN_BASE)
+		return 0;
 	return phys_to_virt(address - LCA_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