mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2026-01-27 12:47:24 +01:00
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: Pavel Machek (CIP) <pavel@denx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a624a86510
commit
7d877c35ca
|
|
@ -336,7 +336,7 @@ static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)
|
||||||
if ((addr + size) < addr)
|
if ((addr + size) < addr)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
npgs = div_u64(size, PAGE_SIZE);
|
npgs = size >> PAGE_SHIFT;
|
||||||
if (npgs > U32_MAX)
|
if (npgs > U32_MAX)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user