s390/dma: fix mapping_error detection
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Tue, 18 Jun 2013 15:32:26 +0000 (17:32 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 19 Jun 2013 07:25:42 +0000 (09:25 +0200)
The map_page implementation of s390 returns DMA_ERROR_CODE in an error
situation. Correctly test if a mapping was erroneous (DMA_ERROR_CODE is
defined as ~0).

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Acked-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/dma-mapping.h

index 886ac7d4937a85c8cbe25d9ca52fd67d8cd28795..9f15a36f6fd9541e51a4ccd5ce4fde83b5bce08a 100644 (file)
@@ -52,7 +52,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 
        if (dma_ops->mapping_error)
                return dma_ops->mapping_error(dev, dma_addr);
-       return (dma_addr == 0UL);
+       return (dma_addr == DMA_ERROR_CODE);
 }
 
 static inline void *dma_alloc_coherent(struct device *dev, size_t size,