From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF04B3A1688 for ; Mon, 1 Jun 2026 11:15:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780312510; cv=none; b=ZVjaUVvbyUEkCGuGVBE7Hd3tHL1EYbxLrNzC0os2aB5V3OZIuLa4eVqck6yVEjIsQuY0COtUjveT6woxq8adNbjCt41XDeOM/zkIP64N7BKobnHHC0QJpjsMbhd971UjliAkL7tyr90xpopIwcqSyQpaGxev357LiYWKak0KPK8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780312510; c=relaxed/simple; bh=0xP+fy0qxzkPjCP6gZogU3bYiTodx38yFWBNuyNByR0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=r/z62GLFNOqTUVpWnfQGugmFv/t/dZKf461e966yfzus4mkLDC9TjlBVCIBbkJIAZP38Y8/iq5hpd+5vQj1M5/z0NblMsu1wu/AtiOxg1rhMPfbHAUZtyNO4bh/+Ge3Sh+EKiQlOH5NnOUlUbUGt4c+ChpSJm2ZVu7eLUkOBqHo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WknMiUk2; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WknMiUk2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA8141F00893; Mon, 1 Jun 2026 11:15:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780312509; bh=6aCdQEidT1zbm+20lHSO0oVsxoz4jxFB9Q2z05FwPro=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=WknMiUk27Rm5jyFgkEggWAdBc0woi0LmOHoYl3nCFeOEzqLdDxyfyJk/Rt/qXc4mQ o3nJAOXL+d+9XeqFftbou6JkatIrGwvoR52t5Yx3rKyeoPDiFD+W52eYvl8gxh1Ocd vhr9TW75IFNyDknV78WWdxHtU+Kz5OR+i1PWmLpDrdNfHk/1zhQjCZekuRzwOrJMvh gl/NwKRIJiuPeIgha/Y+Q96HKfuIKO0agp6KIIScgdwWrv6n63JoYVzrLRGdWODirI F1+/hr8/NbiHp0oUlN8NDro8fA0tGBvrsAdZvuNXSunF/ivFAX40TyZXdVwHH4eAHX wLAbla1absC0g== Date: Mon, 1 Jun 2026 14:15:04 +0300 From: Mike Rapoport To: Giorgi Tchankvetadze Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: mm_init: use div64_ul() instead of do_div() Message-ID: References: <20260601121122.94379-2-giorgitchankvetadze1997@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260601121122.94379-2-giorgitchankvetadze1997@gmail.com> Hi, On Mon, Jun 01, 2026 at 04:11:23PM +0400, Giorgi Tchankvetadze wrote: > 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. Can you describe what are the actual visible effects? > Signed-off-by: Giorgi Tchankvetadze > --- > mm/mm_init.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/mm_init.c b/mm/mm_init.c > index db5568cf36e1..4d335eb799e6 100644 > --- a/mm/mm_init.c > +++ b/mm/mm_init.c > @@ -2426,7 +2426,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); > > -- > 2.52.0 > -- Sincerely yours, Mike.