From: Jiri Slaby <jirislaby@kernel.org>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
linux-serial@vger.kernel.org,
"Greg KH" <gregkh@linuxfoundation.org>,
"Paul Cercueil" <paul@crapouillou.net>,
linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org
Cc: "Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Lukas Wunner" <lukas.wunner@intel.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: Re: [PATCH v6 1/6] serial: 8250: make saved LSR larger
Date: Mon, 13 Jun 2022 10:26:49 +0200 [thread overview]
Message-ID: <670010a1-7727-f2d9-87ad-18ddbeb0cbef@kernel.org> (raw)
In-Reply-To: <20220613075227.10394-2-ilpo.jarvinen@linux.intel.com>
On 13. 06. 22, 9:52, Ilpo Järvinen wrote:
> DW flags address received as BIT(8) in LSR. In order to not lose that
> on read, enlarge lsr_saved_flags to u16.
>
> Adjust lsr/status variables and related call chains which used unsigned
> char type previously to unsigned int. Technically, some of these type
> conversion would not be needed but it doesn't hurt to be consistent.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
...
> --- a/include/linux/serial_8250.h
> +++ b/include/linux/serial_8250.h
> @@ -119,7 +119,7 @@ struct uart_8250_port {
> * be immediately processed.
> */
> #define LSR_SAVE_FLAGS UART_LSR_BRK_ERROR_BITS
> - unsigned char lsr_saved_flags;
> + u16 lsr_saved_flags;
> #define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA
> unsigned char msr_saved_flags;
>
> @@ -170,8 +170,8 @@ extern void serial8250_do_set_divisor(struct uart_port *port, unsigned int baud,
> unsigned int quot_frac);
> extern int fsl8250_handle_irq(struct uart_port *port);
> int serial8250_handle_irq(struct uart_port *port, unsigned int iir);
> -unsigned char serial8250_rx_chars(struct uart_8250_port *up, unsigned char lsr);
> -void serial8250_read_char(struct uart_8250_port *up, unsigned char lsr);
> +unsigned int serial8250_rx_chars(struct uart_8250_port *up, unsigned int lsr);
> +void serial8250_read_char(struct uart_8250_port *up, unsigned int lsr);
It looks odd to have
u16 lsr_saved_flags
in the struct and
unsigned int lsr
here and there. You wrote:
Technically, some of these type conversion would not be needed
but it doesn't hurt to be consistent
But it looks like you actually made them a bit inconsistent. So why not
use u16 for everyone?
thanks,
--
js
suse labs
next prev parent reply other threads:[~2022-06-13 8:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-13 7:52 [PATCH v6 0/6] Add RS485 9th bit addressing mode support to DW UART Ilpo Järvinen
2022-06-13 7:52 ` [PATCH v6 1/6] serial: 8250: make saved LSR larger Ilpo Järvinen
2022-06-13 8:26 ` Jiri Slaby [this message]
2022-06-13 9:25 ` Ilpo Järvinen
2022-06-13 7:52 ` [PATCH v6 2/6] serial: 8250: create lsr_save_mask Ilpo Järvinen
2022-06-13 7:52 ` [PATCH v6 3/6] serial: 8250_lpss: Use 32-bit reads Ilpo Järvinen
2022-06-13 7:52 ` [PATCH v6 4/6] serial: take termios_rwsem for .rs485_config() & pass termios as param Ilpo Järvinen
2022-06-13 7:52 ` [PATCH v6 5/6] serial: Support for RS-485 multipoint addresses Ilpo Järvinen
2022-06-13 22:22 ` Lino Sanfilippo
2022-06-13 7:52 ` [PATCH v6 6/6] serial: 8250_dwlib: Support for 9th bit multipoint addressing 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=670010a1-7727-f2d9-87ad-18ddbeb0cbef@kernel.org \
--to=jirislaby@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=lukas.wunner@intel.com \
--cc=paul@crapouillou.net \
--cc=u.kleine-koenig@pengutronix.de \
/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
all inboxes | Powered by JetHome®