compat_ioctl: move drivers to compat_ptr_ioctl
Each of these drivers has a copy of the same trivial helper function to convert the pointer argument and then call the native ioctl handler. We now have a generic implementation of that, so use it. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Reviewed-by: Jason Gunthorpe <jgg@mellanox.com> Reviewed-by: Jiri Kosina <jkosina@suse.cz> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
此提交包含在:
@@ -532,24 +532,6 @@ out:
|
||||
return rets;
|
||||
}
|
||||
|
||||
/**
|
||||
* mei_compat_ioctl - the compat IOCTL function
|
||||
*
|
||||
* @file: pointer to file structure
|
||||
* @cmd: ioctl command
|
||||
* @data: pointer to mei message structure
|
||||
*
|
||||
* Return: 0 on success , <0 on error
|
||||
*/
|
||||
#ifdef CONFIG_COMPAT
|
||||
static long mei_compat_ioctl(struct file *file,
|
||||
unsigned int cmd, unsigned long data)
|
||||
{
|
||||
return mei_ioctl(file, cmd, (unsigned long)compat_ptr(data));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* mei_poll - the poll function
|
||||
*
|
||||
@@ -898,9 +880,7 @@ static const struct file_operations mei_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.read = mei_read,
|
||||
.unlocked_ioctl = mei_ioctl,
|
||||
#ifdef CONFIG_COMPAT
|
||||
.compat_ioctl = mei_compat_ioctl,
|
||||
#endif
|
||||
.compat_ioctl = compat_ptr_ioctl,
|
||||
.open = mei_open,
|
||||
.release = mei_release,
|
||||
.write = mei_write,
|
||||
|
新增問題並參考
封鎖使用者