dma-pool: turn the end variable in cma_in_zone into a u64
PATCH 1/1 dma-pool: turn the end variable in cma_in_zone into a u64
phys_addr_t can be 32-bit, in which case smatch will complain:
kernel/dma/pool.c:79 cma_in_zone() warn: always true condition '(end <= ((((32) == 64)) ?~0:((1 << (32)) - 1))) => (0-u32max <= u32max)'
Just turn the variable into a u64 to make the range check valid.
Fixes d7e673ec2c8e ("dma-pool: Only allocate from CMA when in same memory zone")
Reported-by kernel test robot <[email protected]>
Signed-off-by Christoph Hellwig <[email protected]>
--- kernel/dma/pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/dma/pool.c +1 -1
@@ -60,7 +60,7 @@ static void dma_atomic_pool_size_add(gfp_t gfp, size_t size)static bool cma_in_zone (gfp_t gfp) {unsigned long size; -phys_addr_t end; +u64 end;struct cma *cma; cma =dev_get_cma_area (NULL );
Signature · 6 lines
2.28.0 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu