[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d496d544-fe59-5fa7-5d21-ab6ad025fa75@linux.intel.com>
Date: Fri, 22 Apr 2022 23:09:07 +0300 (EEST)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Greg KH <gregkh@...uxfoundation.org>
cc: linux-serial <linux-serial@...r.kernel.org>,
Jiri Slaby <jirislaby@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
LKML <linux-kernel@...r.kernel.org>,
Gilles Buloz <gilles.buloz@...tron.com>,
Johan Hovold <johan@...nel.org>
Subject: Re: [PATCH v3 3/5] tty: Add lookahead param to receive_buf
On Fri, 22 Apr 2022, Greg KH wrote:
> > diff --git a/drivers/accessibility/speakup/spk_ttyio.c b/drivers/accessibility/speakup/spk_ttyio.c
> > index 08cf8a17754b..b33536eea1d3 100644
> > --- a/drivers/accessibility/speakup/spk_ttyio.c
> > +++ b/drivers/accessibility/speakup/spk_ttyio.c
> > @@ -73,7 +73,7 @@ static void spk_ttyio_ldisc_close(struct tty_struct *tty)
> >
> > static int spk_ttyio_receive_buf2(struct tty_struct *tty,
> > const unsigned char *cp,
> > - const char *fp, int count)
> > + const char *fp, int count, unsigned int lookahead_count)
>
> Ick, adding yet-another-parameter to a function is a mess as it's hard
> to know what to do with this and what it means just by looking at when
> it is called.
To be honest, I didn't like it either but just couldn't find another
way... That is, not until now that you pushed.
I think I can add lookahead_count into n_tty_data, then both layers
(n_tty and tty_buffer) that depend on it will indepedently keep track of
it rather than passing it through the whole callchain.
> > /* Returns true if c is consumed as flow-control character */
> > -static bool n_tty_receive_char_flow_ctrl(struct tty_struct *tty, unsigned char c)
> > +static bool n_tty_receive_char_flow_ctrl(struct tty_struct *tty, unsigned char c,
> > + bool lookahead_done)
> > {
> > if (!n_tty_is_char_flow_ctrl(tty, c))
> > return false;
> >
> > + if (lookahead_done)
> > + return true;
>
> Why would this function be called if this option was true?
Agreed, it makes sense to move the check before call (and then I also
don't need to reorganize this function anymore).
> the overall idea is good, this implementation isn't quite there yet.
Thanks for taking a look.
--
i.
Powered by blists - more mailing lists