diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2021-03-26 22:03:05 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2021-04-02 16:41:08 +0200 |
commit | a7f3d3d3600c8ed119eb0d2483de0062ce2e3707 (patch) | |
tree | 7953f4c8999648567a3d3578ff7fe3c0f3e234d2 /include/linux/dma-mapping.h | |
parent | ca947482b0b30443e6da1f0f5ba7244e34a4f65a (diff) | |
download | lwn-a7f3d3d3600c8ed119eb0d2483de0062ce2e3707.tar.gz lwn-a7f3d3d3600c8ed119eb0d2483de0062ce2e3707.zip |
dma-mapping: add unlikely hint to error path in dma_mapping_error
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 <hkallweit1@gmail.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/dma-mapping.h')
-rw-r--r-- | include/linux/dma-mapping.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index e9d19b974f26..183e7103a66d 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -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; } |