From: Jiri Slaby <jirislaby@kernel.org>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
linux-serial@vger.kernel.org,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] serial: 8250_rt288x: Remove unnecessary UART_REG_UNMAPPED
Date: Fri, 6 Jan 2023 09:16:20 +0100 [thread overview]
Message-ID: <7c569ef3-4dc5-8901-ee12-e5567a21ead9@kernel.org> (raw)
In-Reply-To: <20230105124744.105950-4-ilpo.jarvinen@linux.intel.com>
On 05. 01. 23, 13:47, Ilpo Järvinen wrote:
> As unmapped registers are at the tail of the array, the ARRAY_SIZE()
> condition will catch them just fine. No need to define special
> value for them.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> ---
> drivers/tty/serial/8250/8250_rt288x.c | 16 ++++------------
> 1 file changed, 4 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/tty/serial/8250/8250_rt288x.c b/drivers/tty/serial/8250/8250_rt288x.c
> index 3015afb99722..7399fea6dfc1 100644
> --- a/drivers/tty/serial/8250/8250_rt288x.c
> +++ b/drivers/tty/serial/8250/8250_rt288x.c
> @@ -14,10 +14,8 @@
>
> #define RT288X_DL 0x28
>
> -#define UART_REG_UNMAPPED -1
> -
> /* Au1x00/RT288x UART hardware has a weird register layout */
> -static const s8 au_io_in_map[8] = {
> +static const s8 au_io_in_map[7] = {
> [UART_RX] = 0,
> [UART_IER] = 2,
> [UART_IIR] = 3,
> @@ -25,18 +23,14 @@ static const s8 au_io_in_map[8] = {
> [UART_MCR] = 6,
> [UART_LSR] = 7,
> [UART_MSR] = 8,
> - [UART_SCR] = UART_REG_UNMAPPED,
> };
>
> -static const s8 au_io_out_map[8] = {
> +static const s8 au_io_out_map[5] = {
And what about making them u8 at last?
> [UART_TX] = 1,
> [UART_IER] = 2,
> [UART_FCR] = 4,
> [UART_LCR] = 5,
> [UART_MCR] = 6,
> - [UART_LSR] = UART_REG_UNMAPPED,
> - [UART_MSR] = UART_REG_UNMAPPED,
> - [UART_SCR] = UART_REG_UNMAPPED,
thanks,
--
js
suse labs
prev parent reply other threads:[~2023-01-06 8:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-05 12:47 [PATCH v2 0/3] serial: Separate RT288x/Au1xxx code into own file Ilpo Järvinen
2023-01-05 12:47 ` [PATCH v2 1/3] serial: 8250: RT288x/Au1xxx code away from core Ilpo Järvinen
2023-01-06 7:36 ` Jiri Slaby
2023-01-05 12:47 ` [PATCH v2 2/3] serial: 8250_rt288x: Name non-standard divisor latch reg Ilpo Järvinen
2023-01-05 12:47 ` [PATCH v2 3/3] serial: 8250_rt288x: Remove unnecessary UART_REG_UNMAPPED Ilpo Järvinen
2023-01-06 8:16 ` Jiri Slaby [this message]
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=7c569ef3-4dc5-8901-ee12-e5567a21ead9@kernel.org \
--to=jirislaby@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=philmd@linaro.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