lkml.org 
[lkml]   [2018]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 05/50] tty_ioctl(): start taking TIOC[SG]SERIAL into separate methods
On Fri, Sep 14, 2018 at 04:18:54PM +0100, Al Viro wrote:
> On Fri, Sep 14, 2018 at 03:22:16PM +0200, Johan Hovold wrote:
> > On Thu, Sep 13, 2018 at 03:40:04AM +0100, Al Viro wrote:
> > > From: Al Viro <viro@zeniv.linux.org.uk>
> > >
> > > ->set_serial() and ->get_serial() resp., both taking tty and
> > > a kernel pointer to serial_struct.
> > >
> > > Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> > > ---
> > > drivers/tty/tty_io.c | 36 ++++++++++++++++++++++++++++++------
> > > include/linux/tty_driver.h | 3 +++
> > > 2 files changed, 33 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
> > > index 2b34ccf269e0..91d73732e11c 100644
> > > --- a/drivers/tty/tty_io.c
> > > +++ b/drivers/tty/tty_io.c

> > > + memset(&v, 0, sizeof(struct serial_struct));
> > > +
> > > + if (!tty->ops->set_serial)
> >
> > You want get_serial here.
>
> Nice catch. Fixed.
>
> > > + return -ENOIOCTLCMD;
> > > + err = tty->ops->get_serial(tty, &v);
> > > + if (!err && copy_to_user(ss, &v, sizeof(struct serial_struct)))
> > > + err = -EFAULT;
> > > + return err;
> > > }
> > >
> > > /*
> > > @@ -2602,8 +2621,13 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> > > }
> > > break;
> > > case TIOCSSERIAL:
> > > - tty_warn_deprecated_flags(p);
> > > - break;
> > > + retval = tty_tiocsserial(tty, p);
> > > + if (retval != -ENOIOCTLCMD)
> > > + return retval;
> >
> > Missing break.
>
> *blink*
> Right you are... that's a bisect hazard (in the end of the series returns
> become unconditional anyway). Fixed.

What's in your work branch now looks good, so feel free to add:

Reviewed-by: Johan Hovold <johan@kernel.org>

Thanks,
Johan

\
 
 \ /
  Last update: 2018-09-14 18:24    [W:0.084 / U:2.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site