Message ID | 20190416202701.127745-3-arnd@arndb.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | compat_ioctl: cleanups | expand |
On Tue, Apr 16, 2019 at 10:25:35PM +0200, Arnd Bergmann wrote: > +static int atyfb_compat_ioctl(struct fb_info *info, u_int cmd, u_long arg) > +{ > + return atyfb_ioctl(info, cmd, (u_long)compat_ptr(arg)); > +} > +#endif Huh? Why isn't that using compat_ioctl_ptr()?
On Wed, Apr 17, 2019 at 10:27:00PM +0100, Al Viro wrote: > On Tue, Apr 16, 2019 at 10:25:35PM +0200, Arnd Bergmann wrote: > > +static int atyfb_compat_ioctl(struct fb_info *info, u_int cmd, u_long arg) > > +{ > > + return atyfb_ioctl(info, cmd, (u_long)compat_ptr(arg)); > > +} > > +#endif > > Huh? Why isn't that using compat_ioctl_ptr()? Oh, I see... Nevermind, then.
On 04/16/2019 10:25 PM, Arnd Bergmann wrote: > These are two obscure ioctl commands, in a driver that only > has compatible commands, so just let the driver handle this > itself. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics
diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index b6fe103df145..1bc4b6672fdc 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c @@ -48,7 +48,7 @@ ******************************************************************************/ - +#include <linux/compat.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> @@ -235,6 +235,13 @@ static int atyfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info); static int atyfb_blank(int blank, struct fb_info *info); static int atyfb_ioctl(struct fb_info *info, u_int cmd, u_long arg); +#ifdef CONFIG_COMPAT +static int atyfb_compat_ioctl(struct fb_info *info, u_int cmd, u_long arg) +{ + return atyfb_ioctl(info, cmd, (u_long)compat_ptr(arg)); +} +#endif + #ifdef __sparc__ static int atyfb_mmap(struct fb_info *info, struct vm_area_struct *vma); #endif @@ -290,6 +297,9 @@ static struct fb_ops atyfb_ops = { .fb_pan_display = atyfb_pan_display, .fb_blank = atyfb_blank, .fb_ioctl = atyfb_ioctl, +#ifdef CONFIG_COMPAT + .fb_compat_ioctl = atyfb_compat_ioctl, +#endif .fb_fillrect = atyfb_fillrect, .fb_copyarea = atyfb_copyarea, .fb_imageblit = atyfb_imageblit, diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index 6eb7a3f51702..a0f230650de2 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c @@ -637,8 +637,6 @@ COMPATIBLE_IOCTL(CAPI_CLR_FLAGS) COMPATIBLE_IOCTL(CAPI_NCCI_OPENCOUNT) COMPATIBLE_IOCTL(CAPI_NCCI_GETUNIT) /* Misc. */ -COMPATIBLE_IOCTL(0x41545900) /* ATYIO_CLKR */ -COMPATIBLE_IOCTL(0x41545901) /* ATYIO_CLKW */ COMPATIBLE_IOCTL(PCIIOC_CONTROLLER) COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_IO) COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_MEM)
These are two obscure ioctl commands, in a driver that only has compatible commands, so just let the driver handle this itself. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/video/fbdev/aty/atyfb_base.c | 12 +++++++++++- fs/compat_ioctl.c | 2 -- 2 files changed, 11 insertions(+), 3 deletions(-)