[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170511143314.590cb399@alans-desktop>
Date: Thu, 11 May 2017 14:33:14 +0100
From: Alan Cox <gnomes@...rguk.ukuu.org.uk>
To: Okash Khawaja <okash.khawaja@...il.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Samuel Thibault <samuel.thibault@...-lyon.org>,
linux-kernel@...r.kernel.org, William Hubbs <w.d.hubbs@...il.com>,
Chris Brannon <chris@...-brannons.com>,
Kirk Reiser <kirk@...sers.ca>, speakup@...ux-speakup.org,
devel@...verdev.osuosl.org, John Covici <covici@....covici.com>
Subject: Re: [patch 1/1] staging: speakup: flush tty buffers and ensure
hardware flow control
On Thu, 11 May 2017 09:29:14 +0100
Okash Khawaja <okash.khawaja@...il.com> wrote:
> Hi Alan,
>
> On Wed, May 10, 2017 at 08:41:51PM +0100, Alan Cox wrote:
> > > + if (!(tmp_termios.c_cflag & CRTSCTS)) {
> > > + tmp_termios.c_cflag |= CRTSCTS;
> > > + ret = tty_set_termios(tty, &tmp_termios);
> > > + if (ret)
> > > + pr_warn("speakup: Failed to set hardware flow control\n");
> >
> > You should check the tty c_cflag after the call rather than rely on an
> > error code. Strictly speaking tty_set_termios should error if no tty bits
> > are changed by the request but it never has on Linux. Instead check the
> > tty gave you the result you wanted.
> Thanks. I will replace the check for return value with check for c_cflag.
>
> May be we should fix this in tty_set_termios?
Possibly. It however changes the external kernel ABI. It's also not a
simple memcmp because any undefined bits must be ignored.
Make a patch, try it and see what breaks ? If nothing breaks then yes it
makes sense IMHO too.
Alan
Powered by blists - more mailing lists