Commit 7d877c35 authored by Pavel Machek's avatar Pavel Machek Committed by David S. Miller
Browse files

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: default avatarPavel Machek (CIP) <pavel@denx.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a624a865
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;