lkml.org 
[lkml]   [2018]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 02/17] compat_ioctl: move drivers to generic_compat_ioctl_ptrarg
On Wed, Sep 12, 2018 at 05:01:03PM +0200, Arnd Bergmann wrote:
> 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.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> drivers/char/ppdev.c | 12 +---------
> drivers/char/tpm/tpm_vtpm_proxy.c | 12 +---------
> drivers/firewire/core-cdev.c | 12 +---------
> drivers/hid/usbhid/hiddev.c | 11 +--------
> drivers/hwtracing/stm/core.c | 12 +---------
> drivers/misc/mei/main.c | 22 +----------------
> drivers/mtd/ubi/cdev.c | 36 +++-------------------------
> drivers/net/tap.c | 12 +---------
> drivers/staging/pi433/pi433_if.c | 12 +---------
> drivers/usb/core/devio.c | 16 +------------
> drivers/vfio/vfio.c | 39 +++----------------------------
> drivers/vhost/net.c | 12 +---------
> drivers/vhost/scsi.c | 12 +---------
> drivers/vhost/test.c | 12 +---------
> drivers/vhost/vsock.c | 12 +---------
> fs/fat/file.c | 13 +----------
> 16 files changed, 20 insertions(+), 237 deletions(-)
>

> diff --git a/drivers/char/tpm/tpm_vtpm_proxy.c b/drivers/char/tpm/tpm_vtpm_proxy.c
> index 87a0ce47f201..a170f5ca7416 100644
> +++ b/drivers/char/tpm/tpm_vtpm_proxy.c
> @@ -678,20 +678,10 @@ static long vtpmx_fops_ioctl(struct file *f, unsigned int ioctl,
> }
> }
>
> -#ifdef CONFIG_COMPAT
> -static long vtpmx_fops_compat_ioctl(struct file *f, unsigned int ioctl,
> - unsigned long arg)
> -{
> - return vtpmx_fops_ioctl(f, ioctl, (unsigned long)compat_ptr(arg));
> -}
> -#endif
> -
> static const struct file_operations vtpmx_fops = {
> .owner = THIS_MODULE,
> .unlocked_ioctl = vtpmx_fops_ioctl,
> -#ifdef CONFIG_COMPAT
> - .compat_ioctl = vtpmx_fops_compat_ioctl,
> -#endif
> + .compat_ioctl = generic_compat_ioctl_ptrarg,
> .llseek = noop_llseek,
> };

For vtpm:

Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>

Arnd, would you consider including a patch as part of/after this
series to make compat_ioctl in drivers/infiniband/core/uverbs_main.c
use this as well? Looks like a bug too?

Thanks,
Jason

\
 
 \ /
  Last update: 2018-09-12 17:33    [W:1.360 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site