From 407e9ef72476e64937ebec44cc835e03a25fb408 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 11 Sep 2018 17:23:00 +0200 Subject: 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 Acked-by: Michael S. Tsirkin Acked-by: David S. Miller Acked-by: Jarkko Sakkinen Reviewed-by: Jarkko Sakkinen Reviewed-by: Jason Gunthorpe Reviewed-by: Jiri Kosina Reviewed-by: Stefan Hajnoczi Reviewed-by: Cornelia Huck Signed-off-by: Arnd Bergmann --- drivers/hwtracing/stm/core.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'drivers/hwtracing/stm') diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index 603b83ac5085..2712e699ba08 100644 --- a/drivers/hwtracing/stm/core.c +++ b/drivers/hwtracing/stm/core.c @@ -832,23 +832,13 @@ stm_char_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return err; } -#ifdef CONFIG_COMPAT -static long -stm_char_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) -{ - return stm_char_ioctl(file, cmd, (unsigned long)compat_ptr(arg)); -} -#else -#define stm_char_compat_ioctl NULL -#endif - static const struct file_operations stm_fops = { .open = stm_char_open, .release = stm_char_release, .write = stm_char_write, .mmap = stm_char_mmap, .unlocked_ioctl = stm_char_ioctl, - .compat_ioctl = stm_char_compat_ioctl, + .compat_ioctl = compat_ptr_ioctl, .llseek = no_llseek, }; -- cgit v1.2.3-59-g8ed1b