blob: 5ede0fa2adb9c266809fdc44c9a73d895f96b129 [file] [log] [blame]
From 5b8cfd0dc22a193aedcb56694e80f758bc125833 Mon Sep 17 00:00:00 2001
From: Sergei Shtylyov <>
Date: Sat, 2 Jun 2018 22:37:42 +0300
Subject: [PATCH 1237/1795] sh_eth: make sh_eth_soft_swap() work on ARM
Browsing thru the driver disassembly, I noticed that ARM gcc generated
no code whatsoever for sh_eth_soft_swap() while building a little-endian
kernel -- apparently __LITTLE_ENDIAN__ was not being #define'd, however
it got implicitly #define'd when building with the SH gcc (I could only
find the explicit #define __LITTLE_ENDIAN that was #include'd when building
a little-endian kernel). Luckily, the Ether controller only doing big-
endian DMA is encountered on the early SH771x SoCs only and all ARM SoCs
implement EDMR.DE and thus set 'sh_eth_cpu_data::hw_swap'. But anyway, we
need to fix the #ifdef inside sh_eth_soft_swap() to something that would
work on all architectures...
Signed-off-by: Sergei Shtylyov <>
Reviewed-by: Geert Uytterhoeven <>
Signed-off-by: David S. Miller <>
(cherry picked from commit 232b6743e4d12d8383aaf2d632d5ed4cc377419e)
Signed-off-by: Simon Horman <>
Signed-off-by: Geert Uytterhoeven <>
drivers/net/ethernet/renesas/sh_eth.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
index 5dee19b61aee..d77de7651d8f 100644
--- a/drivers/net/ethernet/renesas/sh_eth.h
+++ b/drivers/net/ethernet/renesas/sh_eth.h
@@ -562,7 +562,7 @@ struct sh_eth_private {
static inline void sh_eth_soft_swap(char *src, int len)
-#ifdef __LITTLE_ENDIAN__
u32 *p = (u32 *)src;
u32 *maxp;
maxp = p + ((len + sizeof(u32) - 1) / sizeof(u32));