summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>2018-06-02 22:40:16 +0300
committerDavid S. Miller <davem@davemloft.net>2018-06-04 22:23:25 +0300
commit1100149a23a5053de4709dc4ba14ab14bd826562 (patch)
tree7bb1c3acc09276a45a9314f9d462db0511106d1f /drivers/net
parentbb2fa4e847d779c0c3eba78c1abbe142134dcc3d (diff)
downloadlinux-1100149a23a5053de4709dc4ba14ab14bd826562.tar.xz
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: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 82b03f13243e..e9007b613f17 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -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);