Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4cd328f8 authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 20677108 1100149a
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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);
+0 −12
Original line number Diff line number Diff line
@@ -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)
{