vfio: Avoid repeated user pointer cast in vfio_device_fops_unl_ioctl()
authorYi Liu <yi.l.liu@intel.com>
Tue, 18 Jul 2023 13:55:46 +0000 (06:55 -0700)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 25 Jul 2023 16:20:15 +0000 (10:20 -0600)
commitca9e45b414709b9a7279d396ec3d338b057349a8
treee20647f824e200d23d2e7ceae9605089eee3cc9b
parent1c9dc07487cb0f246075b2d3b305bba91156d376
vfio: Avoid repeated user pointer cast in vfio_device_fops_unl_ioctl()

This adds a local variable to store the user pointer cast result from arg.
It avoids the repeated casts in the code when more ioctls are added.

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Tested-by: Yanting Jiang <yanting.jiang@intel.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Link: https://lore.kernel.org/r/20230718135551.6592-22-yi.l.liu@intel.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio_main.c