lkml.org 
[lkml]   [2019]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4] tty: rocket: Remove the rp_ioctl
From
Date
On 16. 04. 19, 16:53, Fuqian Huang wrote:
> --- a/drivers/tty/rocket.c
> +++ b/drivers/tty/rocket.c
...
> -/* IOCTL call handler into the driver */
> -static int rp_ioctl(struct tty_struct *tty,
> - unsigned int cmd, unsigned long arg)
> -{
> - struct r_port *info = tty->driver_data;
> - void __user *argp = (void __user *)arg;
> - int ret = 0;
> -
> - if (cmd != RCKP_GET_PORTS && rocket_paranoia_check(info, "rp_ioctl"))
> - return -ENXIO;
> -
> - switch (cmd) {
> - case RCKP_GET_STRUCT:
> - if (copy_to_user(argp, info, sizeof (struct r_port)))
> - ret = -EFAULT;
> - break;

I am not sure what Greg meant, but I had only this particular ioctl on
mind when I was writing about removal. The other ones might be used _in
theory_. Even though they are not exposed to userspace either. So if
they are not source of potential issues, I would keep them:

> - case RCKP_GET_CONFIG:
> - ret = get_config(info, argp);
> - break;
> - case RCKP_SET_CONFIG:
> - ret = set_config(tty, info, argp);
> - break;
> - case RCKP_GET_PORTS:
> - ret = get_ports(info, argp);
> - break;
> - case RCKP_RESET_RM2:
> - ret = reset_rm2(info, argp);
> - break;
> - case RCKP_GET_VERSION:
> - ret = get_version(info, argp);
> - break;
> - default:
> - ret = -ENOIOCTLCMD;
> - }
> - return ret;
> -}

thanks,
--
js
suse labs

\
 
 \ /
  Last update: 2019-04-17 08:29    [W:0.059 / U:23.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site