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>
This commit is contained in:
David S. Miller 2018-06-04 15:23:26 -04:00
commit 4cd328f839
2 changed files with 11 additions and 12 deletions

View File

@ -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);

View File

@ -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)
{