]> Git Repo - linux.git/commitdiff
dma-mapping: add unlikely hint to error path in dma_mapping_error
authorHeiner Kallweit <[email protected]>
Fri, 26 Mar 2021 21:03:05 +0000 (22:03 +0100)
committerChristoph Hellwig <[email protected]>
Fri, 2 Apr 2021 14:41:08 +0000 (16:41 +0200)
Zillions of drivers use the unlikely() hint when checking the result of
dma_mapping_error(). This is an inline function anyway, so we can move
the hint into the function and remove it from drivers over time.

Signed-off-by: Heiner Kallweit <[email protected]>
Reviewed-by: Robin Murphy <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
include/linux/dma-mapping.h

index e9d19b974f2670131a7fde14b37a3cc3836c373d..183e7103a66dfbc04aa0bb0bbccfd6fe7ddca243 100644 (file)
@@ -95,7 +95,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 {
        debug_dma_mapping_error(dev, dma_addr);
 
-       if (dma_addr == DMA_MAPPING_ERROR)
+       if (unlikely(dma_addr == DMA_MAPPING_ERROR))
                return -ENOMEM;
        return 0;
 }
This page took 0.062507 seconds and 4 git commands to generate.