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

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>

authored by

Heiner Kallweit and committed by
Christoph Hellwig
a7f3d3d3 ca947482

+1 -1
+1 -1
include/linux/dma-mapping.h
··· 95 95 { 96 96 debug_dma_mapping_error(dev, dma_addr); 97 97 98 - if (dma_addr == DMA_MAPPING_ERROR) 98 + if (unlikely(dma_addr == DMA_MAPPING_ERROR)) 99 99 return -ENOMEM; 100 100 return 0; 101 101 }