vfio iommu: typecast corrections
authorKirti Wankhede <kwankhede@nvidia.com>
Tue, 2 Jun 2020 18:42:37 +0000 (00:12 +0530)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 2 Jun 2020 19:44:28 +0000 (13:44 -0600)
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>
drivers/vfio/vfio_iommu_type1.c

index 0e4e717992906ad731a84c70018cd5c6eba865b4..391fafe82c5c06a1df2689d76407a8b93954ec9d 100644 (file)
@@ -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;