From 864e880de59ecd891260f264d2884eabb9d6760c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 12 Sep 2018 17:52:23 -0400 Subject: kill capinc_tty_ioctl() NULL ->ioctl() in tty_operations is treated as "returns -ENOIOCTLCMD"... Signed-off-by: Al Viro --- drivers/isdn/capi/capi.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'drivers/isdn') diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index ef5560b848ab..e1da70a9530c 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c @@ -1155,12 +1155,6 @@ static int capinc_tty_chars_in_buffer(struct tty_struct *tty) return mp->outbytes; } -static int capinc_tty_ioctl(struct tty_struct *tty, - unsigned int cmd, unsigned long arg) -{ - return -ENOIOCTLCMD; -} - static void capinc_tty_set_termios(struct tty_struct *tty, struct ktermios *old) { pr_debug("capinc_tty_set_termios\n"); @@ -1236,7 +1230,6 @@ static const struct tty_operations capinc_ops = { .flush_chars = capinc_tty_flush_chars, .write_room = capinc_tty_write_room, .chars_in_buffer = capinc_tty_chars_in_buffer, - .ioctl = capinc_tty_ioctl, .set_termios = capinc_tty_set_termios, .throttle = capinc_tty_throttle, .unthrottle = capinc_tty_unthrottle, -- cgit From e67504c5958f122944d4b9316d1cfc737027c466 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 12 Sep 2018 17:54:22 -0400 Subject: isdn_tty: TCSBRK{,P} won't reach ->ioctl() kill the long-dead code - it's been unreachable since 2008. Redundant, as well - generic will do exact same thing, since ->break_ctl is NULL here... Signed-off-by: Al Viro --- drivers/isdn/i4l/isdn_tty.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'drivers/isdn') diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index b730037a0e2d..1b2239c1d569 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c @@ -1412,31 +1412,12 @@ static int isdn_tty_ioctl(struct tty_struct *tty, uint cmd, ulong arg) { modem_info *info = (modem_info *) tty->driver_data; - int retval; if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_ioctl")) return -ENODEV; if (tty_io_error(tty)) return -EIO; switch (cmd) { - case TCSBRK: /* SVID version: non-zero arg --> no break */ -#ifdef ISDN_DEBUG_MODEM_IOCTL - printk(KERN_DEBUG "ttyI%d ioctl TCSBRK\n", info->line); -#endif - retval = tty_check_change(tty); - if (retval) - return retval; - tty_wait_until_sent(tty, 0); - return 0; - case TCSBRKP: /* support for POSIX tcsendbreak() */ -#ifdef ISDN_DEBUG_MODEM_IOCTL - printk(KERN_DEBUG "ttyI%d ioctl TCSBRKP\n", info->line); -#endif - retval = tty_check_change(tty); - if (retval) - return retval; - tty_wait_until_sent(tty, 0); - return 0; case TIOCSERGETLSR: /* Get line status register */ #ifdef ISDN_DEBUG_MODEM_IOCTL printk(KERN_DEBUG "ttyI%d ioctl TIOCSERGETLSR\n", info->line); -- cgit From 09d88c85769262aadc85a49d6d4e91d35c115db1 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 12 Sep 2018 18:45:29 -0400 Subject: gigaset: don't try to printk userland buffer contents especially when you've just copied it in... Signed-off-by: Al Viro --- drivers/isdn/gigaset/interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/isdn') diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c index 600c79b030cd..f9698c0c3885 100644 --- a/drivers/isdn/gigaset/interface.c +++ b/drivers/isdn/gigaset/interface.c @@ -206,7 +206,7 @@ static int if_ioctl(struct tty_struct *tty, ? -EFAULT : 0; if (retval >= 0) { gigaset_dbg_buffer(DEBUG_IF, "GIGASET_BRKCHARS", - 6, (const unsigned char *) arg); + 6, buf); retval = cs->ops->brkchars(cs, buf); } break; -- cgit From 969ec01e992009200ecf7ba760f9fe8a95abf32a Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 12 Sep 2018 20:02:50 -0400 Subject: gigaset: add ->compat_ioctl() ... and get rid of COMPAT_IOCTL() for its private ioctls Signed-off-by: Al Viro --- drivers/isdn/gigaset/interface.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/isdn') diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c index f9698c0c3885..d9a578ac32cd 100644 --- a/drivers/isdn/gigaset/interface.c +++ b/drivers/isdn/gigaset/interface.c @@ -233,6 +233,14 @@ static int if_ioctl(struct tty_struct *tty, return retval; } +#ifdef CONFIG_COMPAT +static long if_compat_ioctl(struct tty_struct *tty, + unsigned int cmd, unsigned long arg) +{ + return if_ioctl(tty, cmd, (unsigned long)compat_ptr(arg)); +} +#endif + static int if_tiocmget(struct tty_struct *tty) { struct cardstate *cs = tty->driver_data; @@ -472,6 +480,9 @@ static const struct tty_operations if_ops = { .open = if_open, .close = if_close, .ioctl = if_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = if_compat_ioctl, +#endif .write = if_write, .write_room = if_write_room, .chars_in_buffer = if_chars_in_buffer, -- cgit