mirror of https://github.com/torvalds/linux.git
vfio: Remove the get_region_info op
No driver uses it now, all are using get_region_info_caps(). Reviewed-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/22-v2-2a9e24d62f1b+e10a-vfio_get_region_info_op_jgg@nvidia.com Signed-off-by: Alex Williamson <alex@shazbot.org>
This commit is contained in:
parent
dc10734610
commit
56c069307d
|
|
@ -1267,12 +1267,14 @@ static long vfio_get_region_info(struct vfio_device *device,
|
||||||
struct vfio_info_cap caps = {};
|
struct vfio_info_cap caps = {};
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (unlikely(!device->ops->get_region_info_caps))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
if (copy_from_user(&info, arg, minsz))
|
if (copy_from_user(&info, arg, minsz))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
if (info.argsz < minsz)
|
if (info.argsz < minsz)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (device->ops->get_region_info_caps) {
|
|
||||||
ret = device->ops->get_region_info_caps(device, &info, &caps);
|
ret = device->ops->get_region_info_caps(device, &info, &caps);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
|
|
@ -1284,8 +1286,7 @@ static long vfio_get_region_info(struct vfio_device *device,
|
||||||
info.cap_offset = 0;
|
info.cap_offset = 0;
|
||||||
} else {
|
} else {
|
||||||
vfio_info_cap_shift(&caps, sizeof(info));
|
vfio_info_cap_shift(&caps, sizeof(info));
|
||||||
if (copy_to_user(arg + 1, caps.buf,
|
if (copy_to_user(arg + 1, caps.buf, caps.size)) {
|
||||||
caps.size)) {
|
|
||||||
ret = -EFAULT;
|
ret = -EFAULT;
|
||||||
goto out_free;
|
goto out_free;
|
||||||
}
|
}
|
||||||
|
|
@ -1297,13 +1298,6 @@ static long vfio_get_region_info(struct vfio_device *device,
|
||||||
ret = -EFAULT;
|
ret = -EFAULT;
|
||||||
goto out_free;
|
goto out_free;
|
||||||
}
|
}
|
||||||
} else if (device->ops->get_region_info) {
|
|
||||||
ret = device->ops->get_region_info(device, arg);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
} else {
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
out_free:
|
out_free:
|
||||||
kfree(caps.buf);
|
kfree(caps.buf);
|
||||||
|
|
|
||||||
|
|
@ -133,8 +133,6 @@ struct vfio_device_ops {
|
||||||
size_t count, loff_t *size);
|
size_t count, loff_t *size);
|
||||||
long (*ioctl)(struct vfio_device *vdev, unsigned int cmd,
|
long (*ioctl)(struct vfio_device *vdev, unsigned int cmd,
|
||||||
unsigned long arg);
|
unsigned long arg);
|
||||||
int (*get_region_info)(struct vfio_device *vdev,
|
|
||||||
struct vfio_region_info __user *arg);
|
|
||||||
int (*get_region_info_caps)(struct vfio_device *vdev,
|
int (*get_region_info_caps)(struct vfio_device *vdev,
|
||||||
struct vfio_region_info *info,
|
struct vfio_region_info *info,
|
||||||
struct vfio_info_cap *caps);
|
struct vfio_info_cap *caps);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue