From: Greg KH <gregkh@linuxfoundation.org>
To: Jiri Slaby <jslaby@suse.cz>
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] tty: serial: define UART_LCR_WLEN() macro
Date: Thu, 24 Feb 2022 12:23:41 +0100 [thread overview]
Message-ID: <YhdqvS+LPYk7/4lL@kroah.com> (raw)
In-Reply-To: <b8e3d88c-2340-2247-2e1a-37c089d9065a@suse.cz>
On Thu, Feb 24, 2022 at 11:42:20AM +0100, Jiri Slaby wrote:
> On 24. 02. 22, 11:10, Greg KH wrote:
> > On Thu, Feb 24, 2022 at 10:55:54AM +0100, Jiri Slaby wrote:
> > > Define a generic UART_LCR_WLEN() macro with a size argument. It can be
> > > used to encode byte size into an LCR value. Therefore we can use it to
> > > simplify the drivers using tty_get_char_size() in the next patches.
> > >
> > > Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> > > ---
> > > include/uapi/linux/serial_reg.h | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h
> > > index f51bc8f36813..c9d5ff6dd4c6 100644
> > > --- a/include/uapi/linux/serial_reg.h
> > > +++ b/include/uapi/linux/serial_reg.h
> > > @@ -111,6 +111,7 @@
> > > #define UART_LCR_WLEN6 0x01 /* Wordlength: 6 bits */
> > > #define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */
> > > #define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */
> > > +#define UART_LCR_WLEN(x) ((x) - 5)
> >
> > I'm all for this, but why does it need to be in a uapi .h file?
>
> I'd love to put it somewhere else. But I didn't find an appropriate place.
> Should I put it simply to
> include/linux/serial_core.h
> or
> include/linux/serial.h
This one would make sense.
> ? Or create a new:
> include/linux/serial_reg.h
> to contain only this def?
Nah, no need to create a whole .h file for a single macro :)
thanks,
greg k-h
next prev parent reply other threads:[~2022-02-24 11:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 9:55 [PATCH 0/5] UART_LCR_WLEN cleanups Jiri Slaby
2022-02-24 9:55 ` [PATCH 1/5] tty: serial: define UART_LCR_WLEN() macro Jiri Slaby
2022-02-24 9:55 ` [PATCH 2/5] tty: serial: make use of UART_LCR_WLEN() + tty_get_char_size() Jiri Slaby
2022-02-24 16:38 ` Thierry Reding
2022-02-24 9:55 ` [PATCH 3/5] USB: " Jiri Slaby
2022-02-24 9:55 ` [PATCH 4/5] sdio_uart: " Jiri Slaby
2022-02-28 16:16 ` Ulf Hansson
2022-02-24 9:55 ` [PATCH 5/5] mxser: " Jiri Slaby
2022-02-24 10:10 ` [PATCH 1/5] tty: serial: define UART_LCR_WLEN() macro Greg KH
2022-02-24 10:42 ` Jiri Slaby
2022-02-24 11:23 ` Greg KH [this message]
2022-02-25 9:40 ` Greg KH
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=YhdqvS+LPYk7/4lL@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.