projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a624a86
)
net/xdp: use shift instead of 64 bit division
author
Pavel Machek
<pavel@ucw.cz>
Thu, 4 Jun 2020 21:42:59 +0000
(23:42 +0200)
committer
David S. Miller
<davem@davemloft.net>
Thu, 4 Jun 2020 23:02:58 +0000
(16:02 -0700)
64bit division is kind of expensive, and shift should do the job here.
Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/xdp/xdp_umem.c
patch
|
blob
|
history
diff --git
a/net/xdp/xdp_umem.c
b/net/xdp/xdp_umem.c
index
1bbaf17
..
a0d2b75
100644
(file)
--- a/
net/xdp/xdp_umem.c
+++ b/
net/xdp/xdp_umem.c
@@
-336,7
+336,7
@@
static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)
if ((addr + size) < addr)
return -EINVAL;
- npgs =
div_u64(size, PAGE_SIZE)
;
+ npgs =
size >> PAGE_SHIFT
;
if (npgs > U32_MAX)
return -EINVAL;