Commit 1100149a authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by David S. Miller

sh_eth: use DIV_ROUND_UP() in sh_eth_soft_swap()

When initializing 'maxp' in sh_eth_soft_swap(), the buffer length needs
to be rounded  up -- that's just asking for DIV_ROUND_UP()!
Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bb2fa4e8
......@@ -464,7 +464,7 @@ static void sh_eth_soft_swap(char *src, int len)
{
#ifdef __LITTLE_ENDIAN
u32 *p = (u32 *)src;
u32 *maxp = p + ((len + sizeof(u32) - 1) / sizeof(u32));
u32 *maxp = p + DIV_ROUND_UP(len, sizeof(u32));
for (; p < maxp; p++)
*p = swab32(*p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment