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 <l...@intel.com>
Signed-off-by: Christoph Hellwig <h...@lst.de>
---
 kernel/dma/pool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c
index 1281c0f0442bc5..b59325bad8edda 100644
--- a/kernel/dma/pool.c
+++ b/kernel/dma/pool.c
@@ -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);
-- 
2.28.0

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to