From: Greg KH <gregkh@linuxfoundation.org>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: linux-serial@vger.kernel.org, Jiri Slaby <jirislaby@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] tty: Convert tty_buffer flags to bool
Date: Wed, 19 Oct 2022 12:25:08 +0200 [thread overview]
Message-ID: <Y0/QhJBW1TapqrjC@kroah.com> (raw)
In-Reply-To: <20221019094241.10870-1-ilpo.jarvinen@linux.intel.com>
On Wed, Oct 19, 2022 at 12:42:39PM +0300, Ilpo Järvinen wrote:
> The struct tty_buffer has flags which is only used for storing TTYB_NORMAL.
> There is also a few quite confusing operations for checking the presense
> of TTYB_NORMAL. Simplify things by converting flags to bool.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> ---
> drivers/tty/tty_buffer.c | 28 ++++++++++++++--------------
> include/linux/tty_buffer.h | 5 +----
> include/linux/tty_flip.h | 4 ++--
> 3 files changed, 17 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
> index 5e287dedce01..be3431575a19 100644
> --- a/drivers/tty/tty_buffer.c
> +++ b/drivers/tty/tty_buffer.c
> @@ -107,7 +107,7 @@ static void tty_buffer_reset(struct tty_buffer *p, size_t size)
> p->commit = 0;
> p->lookahead = 0;
> p->read = 0;
> - p->flags = 0;
> + p->flags = true;
> }
>
> /**
> @@ -249,7 +249,7 @@ void tty_buffer_flush(struct tty_struct *tty, struct tty_ldisc *ld)
> * __tty_buffer_request_room - grow tty buffer if needed
> * @port: tty port
> * @size: size desired
> - * @flags: buffer flags if new buffer allocated (default = 0)
> + * @flags: buffer flags if new buffer allocated
If all this does is store TTYB_NORMAL, why not name it "ttyb_normal"?
Leaving it at "flags" and having that be a boolean is just confusing.
thanks,
greg k-h
next prev parent reply other threads:[~2022-10-19 10:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-19 9:42 Ilpo Järvinen
2022-10-19 9:42 ` [PATCH 2/2] tty: Cleanup tty buffer align mask Ilpo Järvinen
2022-10-19 10:25 ` Greg KH [this message]
2022-10-19 10:30 ` [PATCH 1/2] tty: Convert tty_buffer flags to bool Ilpo Järvinen
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=Y0/QhJBW1TapqrjC@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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
Powered by JetHome