linux-stable/kernel/dma
Arnd Bergmann 9c106119f6 swiotlb: fix phys_addr_t overflow warning
On architectures that have a larger dma_addr_t than phys_addr_t,
the swiotlb_tbl_map_single() function truncates its return code
in the failure path, making it impossible to identify the error
later, as we compare to the original value:

kernel/dma/swiotlb.c:551:9: error: implicit conversion from 'dma_addr_t' (aka 'unsigned long long') to 'phys_addr_t' (aka 'unsigned int') changes value from 18446744073709551615 to 4294967295 [-Werror,-Wconstant-conversion]
        return DMA_MAPPING_ERROR;

Use an explicit typecast here to convert it to the narrower type,
and use the same expression in the error handling later.

Fixes: b907e20508 ("swiotlb: remove SWIOTLB_MAP_ERROR")
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2019-06-19 10:28:54 -04:00
..
coherent.c dma-mapping: remove a few unused exports 2019-01-04 09:03:17 +01:00
contiguous.c dma-mapping: fix panic caused by passing empty cma command line argument 2018-09-20 09:01:08 +02:00
debug.c dma-mapping: remove a few unused exports 2019-01-04 09:03:17 +01:00
direct.c DMA mapping updates for Linux 4.21 2018-12-28 14:12:21 -08:00
dummy.c dma-mapping: factor out dummy DMA ops 2018-12-13 21:06:12 +01:00
Kconfig dma-mapping: always build the direct mapping code 2018-12-13 21:06:11 +01:00
Makefile dma-mapping: factor out dummy DMA ops 2018-12-13 21:06:12 +01:00
mapping.c dma-mapping: remove dmam_{declare,release}_coherent_memory 2019-01-04 09:03:17 +01:00
remap.c dma-direct: fix DMA_ATTR_NO_KERNEL_MAPPING for remapped allocations 2019-01-05 08:28:29 +01:00
swiotlb.c swiotlb: fix phys_addr_t overflow warning 2019-06-19 10:28:54 -04:00
virt.c dma-mapping: zero memory returned from dma_alloc_* 2018-12-20 08:13:52 +01:00