Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

asm-generic/io.h: check CONFIG_VIRT_TO_BUS

Make asm-generic/io.h check CONFIG_VIRT_TO_BUS before defining
virt_to_bus() and bus_to_virt(), otherwise it's easy to accidentally
have a silently failing incorrect direct mapped definition rather then
no definition at all.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>

+2
+2
include/asm-generic/io.h
··· 332 332 #define xlate_dev_kmem_ptr(p) p 333 333 #define xlate_dev_mem_ptr(p) __va(p) 334 334 335 + #ifdef CONFIG_VIRT_TO_BUS 335 336 #ifndef virt_to_bus 336 337 static inline unsigned long virt_to_bus(volatile void *address) 337 338 { ··· 343 342 { 344 343 return (void *) address; 345 344 } 345 + #endif 346 346 #endif 347 347 348 348 #ifndef memset_io