summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@toblux.com>2024-02-28 23:49:12 +0100
committerAndrew Morton <akpm@linux-foundation.org>2024-03-06 13:04:18 -0800
commit72741db6836b4fc3c810e33a53f7cb9cf2cd48a7 (patch)
treedcf9d8f372934e78311422314d3ff7959d01a5ff /mm
parentf1cce6f7fa302e2ea996de33eeeeb3a70d93a3e7 (diff)
mm: page_alloc: use div64_ul() instead of do_div()
Fixes Coccinelle/coccicheck warning reported by do_div.cocci. Compared to do_div(), div64_ul() does not implicitly cast the divisor and does not unnecessarily calculate the remainder. Link: https://lkml.kernel.org/r/20240228224911.1164-2-thorsten.blum@toblux.com Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page_alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 29c982542dcc..cc7f9b322193 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5848,7 +5848,7 @@ static void __setup_per_zone_wmarks(void)
spin_lock_irqsave(&zone->lock, flags);
tmp = (u64)pages_min * zone_managed_pages(zone);
- do_div(tmp, lowmem_pages);
+ tmp = div64_ul(tmp, lowmem_pages);
if (is_highmem(zone) || zone_idx(zone) == ZONE_MOVABLE) {
/*
* __GFP_HIGH and PF_MEMALLOC allocations usually don't