aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXie Yongji <[email protected]>2022-01-21 16:39:39 +0800
committerMichael S. Tsirkin <[email protected]>2022-03-04 11:56:34 -0500
commitb9d102dafec6af1c07b610faf0a6d4e8aee14ae0 (patch)
tree18480671daf70bc912b39ae7747e07c54f1276b3
parented0f849fc3a63ed2ddf5e72cdb1de3bdbbb0f8eb (diff)
vduse: Fix returning wrong type in vduse_domain_alloc_iova()
This fixes the following smatch warnings: drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type? Fixes: 8c773d53fb7b ("vduse: Implement an MMU-based software IOTLB") Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Xie Yongji <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]>
-rw-r--r--drivers/vdpa/vdpa_user/iova_domain.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vdpa/vdpa_user/iova_domain.c b/drivers/vdpa/vdpa_user/iova_domain.c
index 2b1143f11d8f..0a4d93edc4c0 100644
--- a/drivers/vdpa/vdpa_user/iova_domain.c
+++ b/drivers/vdpa/vdpa_user/iova_domain.c
@@ -294,7 +294,7 @@ vduse_domain_alloc_iova(struct iova_domain *iovad,
iova_pfn = alloc_iova_fast(iovad, iova_len, limit >> shift, true);
- return iova_pfn << shift;
+ return (dma_addr_t)iova_pfn << shift;
}
static void vduse_domain_free_iova(struct iova_domain *iovad,