Patchwork [U-Boot,05/10] microblaze: Fix unaligned.h for endians

login
register
mail settings
Submitter Michal Simek
Date Aug. 31, 2011, 8:35 a.m.
Message ID <1314779721-1113-6-git-send-email-monstr@monstr.eu>
Download mbox | patch
Permalink /patch/112462/
State Changes Requested
Headers show

Comments

Michal Simek - Aug. 31, 2011, 8:35 a.m.
Based on ARM unaligned.h.

Signed-off-by: Michal Simek <monstr@monstr.eu>
---
 arch/microblaze/include/asm/unaligned.h |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
Mike Frysinger - Aug. 31, 2011, 7:20 p.m.
On Wednesday, August 31, 2011 04:35:16 Michal Simek wrote:
> Based on ARM unaligned.h.

can't you just include asm-generic/unaligned.h ?  the ARM peeps are just being 
lazy at this point :P.
-mike
Michal Simek - Sept. 1, 2011, 12:51 p.m.
Mike Frysinger wrote:
> On Wednesday, August 31, 2011 04:35:16 Michal Simek wrote:
>> Based on ARM unaligned.h.
> 
> can't you just include asm-generic/unaligned.h ?  the ARM peeps are just being 
> lazy at this point :P.

Can.

Thanks,
Michal

Patch

diff --git a/arch/microblaze/include/asm/unaligned.h b/arch/microblaze/include/asm/unaligned.h
index 785c2e9..faf1b02 100644
--- a/arch/microblaze/include/asm/unaligned.h
+++ b/arch/microblaze/include/asm/unaligned.h
@@ -1,16 +1,16 @@ 
 #ifndef _ASM_MICROBLAZE_UNALIGNED_H
 #define _ASM_MICROBLAZE_UNALIGNED_H
 
-#ifdef __KERNEL__
-
-/*
- * The Microblaze can do unaligned accesses itself in big endian mode.
- */
-#include <linux/unaligned/access_ok.h>
+#include <linux/unaligned/le_byteshift.h>
+#include <linux/unaligned/be_byteshift.h>
 #include <linux/unaligned/generic.h>
 
-#define get_unaligned	__get_unaligned_be
-#define put_unaligned	__put_unaligned_be
+#ifdef __MICROBLAZEEL__
+# define get_unaligned	__get_unaligned_le
+# define put_unaligned	__put_unaligned_le
+#else
+# define get_unaligned	__get_unaligned_be
+# define put_unaligned	__put_unaligned_be
+#endif
 
-#endif	/* __KERNEL__ */
 #endif	/* _ASM_MICROBLAZE_UNALIGNED_H */