From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>,
Greg KH <gregkh@linuxfoundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 09/50] amiserial: switch to ->[sg]et_serial()
Date: Thu, 11 Oct 2018 19:58:28 +0200 [thread overview]
Message-ID: <CAMuHMdXqfzz-eE+SDnun-SHm0ma69sYipgMjVhn1ipLrfXzD8w@mail.gmail.com> (raw)
In-Reply-To: <20180913024049.24567-9-viro@ZenIV.linux.org.uk>
Hi Al,
On Thu, Sep 13, 2018 at 4:45 AM Al Viro <viro@zeniv.linux.org.uk> wrote:
> From: Al Viro <viro@zeniv.linux.org.uk>
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> --- a/drivers/tty/amiserial.c
> +++ b/drivers/tty/amiserial.c
> -static int set_serial_info(struct tty_struct *tty, struct serial_state *state,
> - struct serial_struct __user * new_info)
> +static int set_serial_info(struct tty_struct *tty, struct serial_struct *ss)
> {
> + struct serial_state *state = tty->driver_data;
> struct tty_port *port = &state->tport;
> - struct serial_struct new_serial;
> bool change_spd;
> - int retval = 0;
"retval" is still used...
>
> - if (copy_from_user(&new_serial,new_info,sizeof(new_serial)))
> - return -EFAULT;
> + if (serial_paranoia_check(state, tty->name, "rs_ioctl"))
> + return -ENODEV;
>
> tty_lock(tty);
> - change_spd = ((new_serial.flags ^ port->flags) & ASYNC_SPD_MASK) ||
> - new_serial.custom_divisor != state->custom_divisor;
> - if (new_serial.irq || new_serial.port != state->port ||
> - new_serial.xmit_fifo_size != state->xmit_fifo_size) {
> + change_spd = ((ss->flags ^ port->flags) & ASYNC_SPD_MASK) ||
> + ss->custom_divisor != state->custom_divisor;
> + if (ss->irq || ss->port != state->port ||
> + ss->xmit_fifo_size != state->xmit_fifo_size) {
> tty_unlock(tty);
> return -EINVAL;
> }
>
> if (!serial_isroot()) {
> - if ((new_serial.baud_base != state->baud_base) ||
> - (new_serial.close_delay != port->close_delay) ||
> - (new_serial.xmit_fifo_size != state->xmit_fifo_size) ||
> - ((new_serial.flags & ~ASYNC_USR_MASK) !=
> + if ((ss->baud_base != state->baud_base) ||
> + (ss->close_delay != port->close_delay) ||
> + (ss->xmit_fifo_size != state->xmit_fifo_size) ||
> + ((ss->flags & ~ASYNC_USR_MASK) !=
> (port->flags & ~ASYNC_USR_MASK))) {
> tty_unlock(tty);
> return -EPERM;
> }
> port->flags = ((port->flags & ~ASYNC_USR_MASK) |
> - (new_serial.flags & ASYNC_USR_MASK));
> - state->custom_divisor = new_serial.custom_divisor;
> + (ss->flags & ASYNC_USR_MASK));
> + state->custom_divisor = ss->custom_divisor;
> goto check_and_exit;
> }
>
> - if (new_serial.baud_base < 9600) {
> + if (ss->baud_base < 9600) {
> tty_unlock(tty);
> return -EINVAL;
> }
> @@ -1062,19 +1059,19 @@ static int set_serial_info(struct tty_struct *tty, struct serial_state *state,
> * At this point, we start making changes.....
> */
>
> - state->baud_base = new_serial.baud_base;
> + state->baud_base = ss->baud_base;
> port->flags = ((port->flags & ~ASYNC_FLAGS) |
> - (new_serial.flags & ASYNC_FLAGS));
> - state->custom_divisor = new_serial.custom_divisor;
> - port->close_delay = new_serial.close_delay * HZ/100;
> - port->closing_wait = new_serial.closing_wait * HZ/100;
> + (ss->flags & ASYNC_FLAGS));
> + state->custom_divisor = ss->custom_divisor;
> + port->close_delay = ss->close_delay * HZ/100;
> + port->closing_wait = ss->closing_wait * HZ/100;
> port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
>
> check_and_exit:
> if (tty_port_initialized(port)) {
> if (change_spd) {
> /* warn about deprecation unless clearing */
> - if (new_serial.flags & ASYNC_SPD_MASK)
> + if (ss->flags & ASYNC_SPD_MASK)
> dev_warn_ratelimited(tty->dev, "use of SPD flags is deprecated\n");
> change_speed(tty, state, NULL);
> }
> @@ -1084,7 +1081,6 @@ static int set_serial_info(struct tty_struct *tty, struct serial_state *state,
> return retval;
... here, and in the line above (out of context). leading to
drivers/tty/amiserial.c:1076:3: error: 'retval' undeclared (first use
in this function)
http://kisskb.ellerman.id.au/kisskb/buildresult/13544535/
http://kisskb.ellerman.id.au/kisskb/buildresult/13544413/
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2018-10-11 17:58 UTC|newest]
Thread overview: 95+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-13 2:31 [PATCHES] tty ioctls cleanups, compat and not only Al Viro
2018-09-13 2:40 ` [PATCH 01/50] presence of RS485 ioctls has been unconditional since 2014 Al Viro
2018-09-13 2:40 ` [PATCH 02/50] move compat handling of tty ioctls to tty_compat_ioctl() Al Viro
2018-09-14 15:15 ` Arnd Bergmann
2018-09-14 18:16 ` gregkh
2018-09-14 19:38 ` Arnd Bergmann
2018-09-15 18:51 ` gregkh
2018-09-13 2:40 ` [PATCH 03/50] tty_ioctl(): drop FIONBIO handling Al Viro
2018-09-13 2:40 ` [PATCH 04/50] mos7720: bury dead TIOCM... in ->ioctl() Al Viro
2018-09-14 13:31 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 05/50] tty_ioctl(): start taking TIOC[SG]SERIAL into separate methods Al Viro
2018-09-14 13:22 ` Johan Hovold
2018-09-14 15:18 ` Al Viro
2018-09-14 16:23 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 06/50] simserial: switch to ->[sg]et_serial() Al Viro
2018-09-13 2:40 ` [PATCH 07/50] fwserial: " Al Viro
2018-09-13 2:40 ` [PATCH 08/50] greybus/uart: " Al Viro
2018-09-14 13:31 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 09/50] amiserial: " Al Viro
2018-09-13 10:33 ` Greg Kroah-Hartman
2018-10-11 17:58 ` Geert Uytterhoeven [this message]
2018-10-13 5:36 ` Al Viro
2018-09-13 2:40 ` [PATCH 10/50] cyclades: " Al Viro
2018-09-13 2:40 ` [PATCH 11/50] ipwireless: " Al Viro
2018-09-14 12:00 ` David Sterba
2018-09-13 2:40 ` [PATCH 12/50] isicom: " Al Viro
2018-09-13 2:40 ` [PATCH 13/50] moxa: " Al Viro
2018-09-13 2:40 ` [PATCH 14/50] mxser: " Al Viro
2018-09-13 2:40 ` [PATCH 15/50] serial_core: " Al Viro
2018-09-13 2:40 ` [PATCH 16/50] rfcomm: get rid of mentioning TIOC[SG]SERIAL Al Viro
2018-09-13 2:40 ` [PATCH 17/50] usb-serial: begin switching to ->[sg]et_serial() Al Viro
2018-09-14 13:39 ` Johan Hovold
2018-09-14 15:23 ` Al Viro
2018-09-14 15:26 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 18/50] cdc-acm: switch " Al Viro
2018-09-13 2:40 ` [PATCH 19/50] ark3116: switch to ->get_serial() Al Viro
2018-09-14 13:41 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 20/50] f81232: " Al Viro
2018-09-14 13:42 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 21/50] f81534: " Al Viro
2018-09-14 13:43 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 22/50] fdti_sio: switch to ->[sg]et_serial() Al Viro
2018-09-14 13:47 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 23/50] io_edgeport: switch to ->get_serial() Al Viro
2018-09-14 13:58 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 24/50] io_ti: " Al Viro
2018-09-14 13:59 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 25/50] mos7720: " Al Viro
2018-09-14 14:02 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 26/50] mos7840: " Al Viro
2018-09-14 14:07 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 27/50] opticon: " Al Viro
2018-09-14 14:08 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 28/50] pl2303: " Al Viro
2018-09-14 14:08 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 29/50] quatech2: " Al Viro
2018-09-14 14:09 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 30/50] ssu100: " Al Viro
2018-09-14 14:10 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 31/50] ti_usb_3410_5052: switch to ->[sg]et_serial() Al Viro
2018-09-14 14:12 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 32/50] whiteheat: switch to ->get_serial() Al Viro
2018-09-14 14:15 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 33/50] usb_wwan: switch to ->[sg]et_serial() Al Viro
2018-09-14 14:18 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 34/50] complete ->[sg]et_serial() switchover Al Viro
2018-09-14 14:20 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 35/50] synclink: reduce pointless checks in ->ioctl() Al Viro
2018-09-13 2:40 ` [PATCH 36/50] take compat TIOC[SG]SERIAL treatment into tty_compat_ioctl() Al Viro
2018-09-13 2:40 ` [PATCH 37/50] kill capinc_tty_ioctl() Al Viro
2018-09-13 2:40 ` [PATCH 38/50] isdn_tty: TCSBRK{,P} won't reach ->ioctl() Al Viro
2018-09-13 2:40 ` [PATCH 39/50] dgnc: TIOCM... " Al Viro
2018-09-13 2:40 ` [PATCH 40/50] kill the rest of tty COMPAT_IOCTL() entries Al Viro
2018-09-13 10:55 ` Arnd Bergmann
2018-09-13 2:40 ` [PATCH 41/50] dgnc: break-related ioctls won't reach ->ioctl() Al Viro
2018-09-13 11:59 ` Greg Kroah-Hartman
2018-09-13 2:40 ` [PATCH 42/50] remove fallback to drivers for TIOCGICOUNT Al Viro
2018-09-14 14:23 ` Johan Hovold
2018-09-13 2:40 ` [PATCH 43/50] dgnc: leave TIOC[GS]SOFTCAR to ldisc Al Viro
2018-09-13 2:40 ` [PATCH 44/50] dgnc: don't bother with (empty) stub for TCXONC Al Viro
2018-09-13 2:40 ` [PATCH 45/50] gigaset: don't try to printk userland buffer contents Al Viro
2018-09-13 2:40 ` [PATCH 46/50] vt_compat_ioctl(): clean up, use compat_ptr() properly Al Viro
2018-09-13 10:10 ` Arnd Bergmann
2018-09-13 2:40 ` [PATCH 47/50] gigaset: add ->compat_ioctl() Al Viro
2018-09-13 2:40 ` [PATCH 48/50] compat_ioctl - kill keyboard ioctl handling Al Viro
2018-09-13 2:40 ` [PATCH 49/50] pty: fix compat ioctls Al Viro
2018-09-13 2:40 ` [PATCH 50/50] synclink_gt(): fix compat_ioctl() Al Viro
2018-09-13 11:19 ` [PATCHES] tty ioctls cleanups, compat and not only Arnd Bergmann
2018-09-13 20:31 ` Al Viro
2018-09-13 20:56 ` Arnd Bergmann
2018-09-14 2:27 ` Al Viro
2018-09-14 8:21 ` Arnd Bergmann
2018-09-14 15:10 ` Al Viro
2018-09-14 15:33 ` Arnd Bergmann
2018-09-13 11:59 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMuHMdXqfzz-eE+SDnun-SHm0ma69sYipgMjVhn1ipLrfXzD8w@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).