提交 7d877c35 编写于 作者: P Pavel Machek 提交者: David S. Miller

net/xdp: use shift instead of 64 bit division

64bit division is kind of expensive, and shift should do the job here.
Signed-off-by: NPavel Machek (CIP) <pavel@denx.de>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a624a865
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册