MIPS: Fix OCTEON BUG() warnings a different way.
PATCH 1/1 MIPS: Fix OCTEON BUG() warnings a different way.
From: David Daney <[email protected]>
Signed-off-by David Daney <[email protected]>
--- arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h +5 -5
@@ -24,21 +24,21 @@ static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t size) {BUG (); -unreachable (); +return 0 ; }static inline dma_addr_t plat_map_dma_mem_page (struct device *dev,struct page *page) {BUG (); -unreachable (); +return 0 ; }static inline unsigned long plat_dma_addr_to_phys (struct device *dev,dma_addr_t dma_addr) {BUG (); -unreachable (); +return 0 ; } static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
@@ -50,7 +50,7 @@ static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,static inline int plat_dma_supported (struct device *dev,u64 mask) {BUG (); -unreachable (); +return 0 ; }static inline void plat_extra_sync_for_device (struct device *dev)
@@ -67,7 +67,7 @@ static inline int plat_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) {BUG (); -unreachable (); +return 0 ; }dma_addr_t phys_to_dma (struct device *dev,phys_addr_t paddr);
Signature · 1 line
1.7.11.7
Quoted 1 line · David Daney
Signed-off-by David Daney <[email protected]>
I replaced my fix with your fix but left he direct inclusion of <linux/bug.h>.
Let as homework for a later point: make BUG() invoke unreachable() if CONFIG_BUG is diabled, something like that. This will improve code generation for GCC 4.5+ but for older compilers unreachable() is defined as do { } while (1) so will emit extra code.
Thanks,
Ralf