From: Pavel Machek Date: Thu, 4 Jun 2020 21:42:59 +0000 (+0200) Subject: net/xdp: use shift instead of 64 bit division X-Git-Tag: v5.15~3655^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d877c35ca84cfa634fd63c2b64bf7b6ae9c71cb;p=platform%2Fkernel%2Flinux-starfive.git 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) Signed-off-by: David S. Miller --- diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c index 1bbaf17..a0d2b75 100644 --- 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;