projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb2fa4e
)
sh_eth: use DIV_ROUND_UP() in sh_eth_soft_swap()
author
Sergei Shtylyov
<
[email protected]
>
Sat, 2 Jun 2018 19:40:16 +0000
(22:40 +0300)
committer
David S. Miller
<
[email protected]
>
Mon, 4 Jun 2018 19:23:25 +0000
(15:23 -0400)
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 <
[email protected]
>
Reviewed-by: Geert Uytterhoeven <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/ethernet/renesas/sh_eth.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/renesas/sh_eth.c
b/drivers/net/ethernet/renesas/sh_eth.c
index 82b03f13243e558c10b8fd24697c5e7c72407a77..e9007b613f17ca8de16b67e054df42a800522fb5 100644
(file)
--- 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);