diff options
author | Kirti Wankhede <kwankhede@nvidia.com> | 2020-06-02 20:42:37 +0200 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2020-06-02 21:44:28 +0200 |
commit | c8e9df4744a3e4d897a6ac6e71a38aa8d7b65aa0 (patch) | |
tree | bcbd1d2c1aa5506732f8dc211d07adea5e76b239 /drivers/vfio | |
parent | vfio iommu: Use shift operation for 64-bit integer division (diff) | |
download | linux-c8e9df4744a3e4d897a6ac6e71a38aa8d7b65aa0.tar.xz linux-c8e9df4744a3e4d897a6ac6e71a38aa8d7b65aa0.zip |
vfio iommu: typecast corrections
Fixes sparse warnings by adding '__user' in typecast for
copy_[from,to]_user()
Fixes: d6a4c185660c ("vfio iommu: Implementation of ioctl for dirty pages tracking")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio')
-rw-r--r-- | drivers/vfio/vfio_iommu_type1.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 0e4e71799290..391fafe82c5c 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -998,14 +998,14 @@ static int update_user_bitmap(u64 __user *bitmap, struct vfio_iommu *iommu, nbits + shift); if (copy_from_user(&leftover, - (const void *)(bitmap + copy_offset), + (void __user *)(bitmap + copy_offset), sizeof(leftover))) return -EFAULT; bitmap_or(dma->bitmap, dma->bitmap, &leftover, shift); } - if (copy_to_user((void *)(bitmap + copy_offset), dma->bitmap, + if (copy_to_user((void __user *)(bitmap + copy_offset), dma->bitmap, DIRTY_BITMAP_BYTES(nbits + shift))) return -EFAULT; |