From: Greg KH <greg@kroah.com>
To: Jamie Iles <jamie@jamieiles.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH] 8250: add a UPIO_DWAPB32 for 32 bit accesses (v2)
Date: Tue, 30 Nov 2010 17:17:58 -0800 [thread overview]
Message-ID: <20101201011758.GA21009@kroah.com> (raw)
In-Reply-To: <1290436007-683-1-git-send-email-jamie@jamieiles.com>
On Mon, Nov 22, 2010 at 02:26:47PM +0000, Jamie Iles wrote:
> Some platforms contain a Synopsys DesignWare APB UART that is attached
> to a 32-bit APB bus where sub-word accesses are not allowed. Add a new
> IO type (UPIO_DWAPB32) that performs 32 bit acccesses to the UART.
>
> Signed-off-by: Jamie Iles <jamie@jamieiles.com>
> ---
> drivers/serial/8250.c | 18 ++++++++++++++++--
> drivers/serial/serial_core.c | 2 ++
> include/linux/serial_core.h | 1 +
> 3 files changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
> index 09a5508..244a982 100644
> --- a/drivers/serial/8250.c
> +++ b/drivers/serial/8250.c
> @@ -464,7 +464,12 @@ static void dwapb_serial_out(struct uart_port *p, int offset, int value)
> struct uart_8250_port *up = (struct uart_8250_port *)p;
> up->lcr = value;
> }
> - writeb(value, p->membase + offset);
> +
> + if (UPIO_DWAPB == p->iotype)
I understand why people feel they have to write code like this, but
please, don't, put the variable test the other way around. The complier
will complain if you accidentally use '=' instead of '=='
> + writeb(value, p->membase + offset);
> + else
> + writel(value, p->membase + offset);
> +
As this is on the "fast path" for writing data out, isn't it going to
slow down the UPIO_DWAPB users as well?
thanks,
greg k-h
next prev parent reply other threads:[~2010-12-01 1:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-22 14:26 [PATCH] 8250: add a UPIO_DWAPB32 for 32 bit accesses (v2) Jamie Iles
2010-12-01 1:17 ` Greg KH [this message]
2010-12-01 8:10 ` Jamie Iles
2010-12-01 17:01 ` Greg KH
2010-12-01 17:17 ` Jamie Iles
2010-12-01 19:27 ` Greg KH
2010-12-01 23:39 ` [PATCH 1/2] 8250: use container_of() instead of casting Jamie Iles
2010-12-01 23:39 ` [PATCH 2/2] 8250: add a UPIO_DWAPB32 for 32 bit accesses Jamie Iles
-- strict thread matches above, loose matches on Subject: below --
2010-01-04 17:11 [PATCH] " Jamie Iles
2010-01-04 17:19 ` Resend of " Jamie Iles
2010-01-04 17:19 ` [PATCH] 8250: add a UPIO_DWAPB32 for 32 bit accesses (v2) Jamie Iles
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=20101201011758.GA21009@kroah.com \
--to=greg@kroah.com \
--cc=jamie@jamieiles.com \
--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.