From: Al Viro <viro@ftp•linux.org.uk>
To: linuxppc-dev@ozlabs•org
Subject: [PATCH] UPIO_TSI cleanup
Date: Sat, 23 Sep 2006 01:39:45 +0100 [thread overview]
Message-ID: <E1GQvYX-0002iX-IN@ZenIV.linux.org.uk> (raw)
(le32_to_cpu(x) >> 8) & 0xff is a very odd way to spell (x >> 16) & 0xff,
even if that code is hit only on ppc. The value is host-endian - we've
got it from readl(), after all...
Signed-off-by: Al Viro <viro@zeniv•linux.org.uk>
---
drivers/serial/8250.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 0ae9ced..10c2daa 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -320,8 +320,8 @@ #endif
case UPIO_TSI:
if (offset == UART_IIR) {
- tmp = readl((u32 *)(up->port.membase + UART_RX));
- return (cpu_to_le32(tmp) >> 8) & 0xff;
+ tmp = readl(up->port.membase + (UART_IIR & ~3));
+ return (tmp >> 16) & 0xff; /* UART_IIR % 4 == 2 */
} else
return readb(up->port.membase + offset);
--
1.4.2.GIT
next reply other threads:[~2006-09-23 0:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-23 0:39 Al Viro [this message]
2006-09-24 15:00 ` [PATCH] UPIO_TSI cleanup Sergei Shtylyov
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=E1GQvYX-0002iX-IN@ZenIV.linux.org.uk \
--to=viro@ftp$(echo .)linux.org.uk \
--cc=linuxppc-dev@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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