summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-06-04 22:23:26 +0300
committerDavid S. Miller <davem@davemloft.net>2018-06-04 22:23:26 +0300
commit4cd328f83916ce1df69bed43c84af75e0c3d6f2d (patch)
tree7bb1c3acc09276a45a9314f9d462db0511106d1f /drivers/net
parent20677108c51b467e2325554f47f13b5666d49ffe (diff)
parent1100149a23a5053de4709dc4ba14ab14bd826562 (diff)
downloadlinux-4cd328f83916ce1df69bed43c84af75e0c3d6f2d.tar.xz
Merge branch 'sh_eth-fix-and-clean-up-sh_eth_soft_swap'
Sergei Shtylyov says: ==================== sh_eth: fix & clean up sh_eth_soft_swap() Here's a set of 3 patches against DaveM's 'net-next.git' repo. First one fixes an old buffer endiannes issue (luckily, the ARM SoCs are smart enough to not actually care) plus couple clean ups around sh_eth_soft_swap()... ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c11
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.h12
2 files changed, 11 insertions, 12 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index d9cadfb1bc4a..e9007b613f17 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -460,6 +460,17 @@ static u32 sh_eth_tsu_read(struct sh_eth_private *mdp, int enum_index)
return ioread32(mdp->tsu_addr + offset);
}
+static void sh_eth_soft_swap(char *src, int len)
+{
+#ifdef __LITTLE_ENDIAN
+ u32 *p = (u32 *)src;
+ u32 *maxp = p + DIV_ROUND_UP(len, sizeof(u32));
+
+ for (; p < maxp; p++)
+ *p = swab32(*p);
+#endif
+}
+
static void sh_eth_select_mii(struct net_device *ndev)
{
struct sh_eth_private *mdp = netdev_priv(ndev);
diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
index 5dee19b61aee..726c55a82dd7 100644
--- a/drivers/net/ethernet/renesas/sh_eth.h
+++ b/drivers/net/ethernet/renesas/sh_eth.h
@@ -560,18 +560,6 @@ struct sh_eth_private {
unsigned wol_enabled:1;
};
-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));
-
- for (; p < maxp; p++)
- *p = swab32(*p);
-#endif
-}
-
static inline void *sh_eth_tsu_get_offset(struct sh_eth_private *mdp,
int enum_index)
{