diff options
author | Pavel Machek <pavel@ucw.cz> | 2020-06-04 23:42:59 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-06-04 16:02:58 -0700 |
commit | 7d877c35ca84cfa634fd63c2b64bf7b6ae9c71cb (patch) | |
tree | 04858f775f70dc3efcaa0a196127defad701e260 /net/xdp | |
parent | a624a86510adaeefd33aac224751e89348596d2a (diff) | |
download | linux-7d877c35ca84cfa634fd63c2b64bf7b6ae9c71cb.tar.gz linux-7d877c35ca84cfa634fd63c2b64bf7b6ae9c71cb.tar.bz2 linux-7d877c35ca84cfa634fd63c2b64bf7b6ae9c71cb.zip |
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>
Diffstat (limited to 'net/xdp')
-rw-r--r-- | net/xdp/xdp_umem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c index 1bbaf1747e4f..a0d2b757807f 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; |