From: Giorgi Tchankvetadze Date: Tue, 2 Jun 2026 11:32:45 +0000 (+0400) Subject: mm: mm_init: use div64_ul() instead of do_div() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=00e06cb773fd81d4f2806a6ee69d1aef8f6dd5ca;p=thirdparty%2Fkernel%2Flinux.git mm: mm_init: 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. There are no functional changes. The benefit is purely a semantic cleanup that better communicates the intent of the division and resolves the static analysis warning. Signed-off-by: Giorgi Tchankvetadze Link: https://patch.msgid.link/20260602-mm-div64-cleanup-v1-1-bf5d67d89d93@gmail.com Signed-off-by: Mike Rapoport (Microsoft) --- diff --git a/mm/mm_init.c b/mm/mm_init.c index f9f8e1af921cd..4e0909a721d22 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -2412,7 +2412,7 @@ void *__init alloc_large_system_hash(const char *tablename, /* limit allocation size to 1/16 total memory by default */ if (max == 0) { max = ((unsigned long long)nr_all_pages << PAGE_SHIFT) >> 4; - do_div(max, bucketsize); + max = div64_ul(max, bucketsize); } max = min(max, 0x80000000ULL);