mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Harvey Harrison <harvey.harrison@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 21/21] arch: use aligned-endian get/put helpers
Date: Tue, 20 May 2008 11:06:18 -0700	[thread overview]
Message-ID: <1211306778.5915.180.camel@brick> (raw)

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 arch/parisc/lib/iomap.c         |    4 ++--
 arch/powerpc/sysdev/qe_lib/qe.c |    2 +-
 arch/sparc64/kernel/unaligned.c |    8 ++++----
 arch/sparc64/lib/PeeCeeI.c      |    6 +++---
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/parisc/lib/iomap.c b/arch/parisc/lib/iomap.c
index 9abed07..ac2f0eb 100644
--- a/arch/parisc/lib/iomap.c
+++ b/arch/parisc/lib/iomap.c
@@ -278,7 +278,7 @@ unsigned int ioread16(void __iomem *addr)
 {
 	if (unlikely(INDIRECT_ADDR(addr)))
 		return iomap_ops[ADDR_TO_REGION(addr)]->read16(addr);
-	return le16_to_cpup((u16 *)addr);
+	return get_le16(addr);
 }
 
 unsigned int ioread16be(void __iomem *addr)
@@ -292,7 +292,7 @@ unsigned int ioread32(void __iomem *addr)
 {
 	if (unlikely(INDIRECT_ADDR(addr)))
 		return iomap_ops[ADDR_TO_REGION(addr)]->read32(addr);
-	return le32_to_cpup((u32 *)addr);
+	return get_le32(addr);
 }
 
 unsigned int ioread32be(void __iomem *addr)
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index cff550e..9f09707 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -528,7 +528,7 @@ int qe_upload_firmware(const struct qe_firmware *firmware)
 	}
 
 	/* Validate the CRC */
-	crc = be32_to_cpu(*(__be32 *)((void *)firmware + calc_size));
+	crc = get_be32((void *)firmware + calc_size);
 	if (crc != crc32(0, firmware, calc_size)) {
 		printk(KERN_ERR "qe-firmware: firmware CRC is invalid\n");
 		return -EIO;
diff --git a/arch/sparc64/kernel/unaligned.c b/arch/sparc64/kernel/unaligned.c
index 1a511e9..fe5b7fb 100644
--- a/arch/sparc64/kernel/unaligned.c
+++ b/arch/sparc64/kernel/unaligned.c
@@ -535,11 +535,11 @@ int handle_ldf_stq(u32 insn, struct pt_regs *regs)
 			u64 tmp;
 
 			switch (size) {
-			case 1: data[0] = le32_to_cpup(data + 0); break;
-			default:*(u64 *)(data + 0) = le64_to_cpup((u64 *)(data + 0));
+			case 1: data[0] = get_le32(data + 0); break;
+			default:*(u64 *)(data + 0) = get_le64(data + 0));
 				break;
-			case 4: tmp = le64_to_cpup((u64 *)(data + 0));
-				*(u64 *)(data + 0) = le64_to_cpup((u64 *)(data + 2));
+			case 4: tmp = get_le64(data + 0);
+				*(u64 *)(data + 0) = get_le64(data + 2);
 				*(u64 *)(data + 2) = tmp;
 				break;
 			}
diff --git a/arch/sparc64/lib/PeeCeeI.c b/arch/sparc64/lib/PeeCeeI.c
index 3c6cfbb..f85a50f 100644
--- a/arch/sparc64/lib/PeeCeeI.c
+++ b/arch/sparc64/lib/PeeCeeI.c
@@ -25,14 +25,14 @@ void outsw(unsigned long __addr, const void *src, unsigned long count)
 		u32 *pi;
 
 		if (((u64)src) & 0x2) {
-			u16 val = le16_to_cpup(ps);
+			u16 val = get_le16(ps);
 			outw(val, addr);
 			ps++;
 			count--;
 		}
 		pi = (u32 *)ps;
 		while (count >= 2) {
-			u32 w = le32_to_cpup(pi);
+			u32 w = get_le32(pi);
 
 			pi++;
 			outw(w >> 0, addr);
@@ -41,7 +41,7 @@ void outsw(unsigned long __addr, const void *src, unsigned long count)
 		}
 		ps = (u16 *)pi;
 		if (count) {
-			u16 val = le16_to_cpup(ps);
+			u16 val = get_le16(ps);
 			outw(val, addr);
 		}
 	}
-- 
1.5.5.1.570.g26b5e


                 reply	other threads:[~2008-05-20 18:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1211306778.5915.180.camel@brick \
    --to=harvey.harrison@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@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 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®