Message ID | 20240228224911.1164-2-thorsten.blum@toblux.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-85806-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp178018dyb; Wed, 28 Feb 2024 20:56:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUsOyDR7JEsOBqC2/fQ3QryeOe+6hEljgVZPUz+tPY1AHf07kZJAQXvK9xPulzoPR1ES2cXyjR0uhBVI0YWJOSHzTr69g== X-Google-Smtp-Source: AGHT+IEJ9j53KhVWLkhRn7AkyH9n/mETtP057MHgTJDcrVEIcpnTV74gU94Uh8BnOGuDlRHw+TzG X-Received: by 2002:a17:906:40c9:b0:a43:3670:a2b7 with SMTP id a9-20020a17090640c900b00a433670a2b7mr636205ejk.44.1709182614010; Wed, 28 Feb 2024 20:56:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709182613; cv=pass; d=google.com; s=arc-20160816; b=GRFZ+G6F5ip/NU1uvtg64au1l72rBua13EG0clI9kokZCCLKfHqkss6Dc2+KAa7kG+ lDiaIWSsDgGu4PKPelFkKmS9tXXg2C3clwbSFMa0KRmuns39mnB8VAfBGH0wMMfv6yPF Utxb5FlQatr4NiBTzB/+3ELLj1LMedCNMr7MF0Uk607i2ahkWVL8qRLUBS1+SyLqYC2W WdFh2jVnGZDS9IR+Qv4WjcShMMZz37Rtaj9pe7pLnf8PKckx08MyeJwd6CaTTo390JU2 88pGk/qX3c9FjxF0H04Ec0qaitIMtn3pSKxwgX8F80c8PQRoG5l/FjSbSdwmax8YfJnA nAEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=p68q64fPKpPRnVU3Ta/zu5aSS1cC7AT3EHsyijjzmko=; fh=NIJldCLSERQ4eObYzkqWqLJPTWQBfDtTTMhq0XtJWdE=; b=Vz5xlux8OTZpAhPSKgNZV1pWCnRNhXvCa90dHTv+fCDNoDEhSoJKgHubK4e8WsUY9z wEs2IUESPvLU7Rb+NKGKoZn7i2E/NIRZfOrTpsDsHJqxIEHWWPVUzgWGOQeJSvhteYvr en2x6lWvOAnIPZMbv0askjPjOgyY2E2u3goP91dJ8GJRZmpH5cHNLzS76gpVq8cxugrc Ji5CXlwJBnrr5HM9JGItmKPnAq6NMXQbQH3Uz2sGYipiKtxklHn8d0ctd5JUAPBr4jrL 6r1mpp9pX4KRdFlvVziOmhsXgGdo5mielxY2l2QDM6xRk5nzdavoP3Ful57dKtnm4GkF 6ZwA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@toblux-com.20230601.gappssmtp.com header.s=20230601 header.b="ba/CQ0Pk"; arc=pass (i=1 dkim=pass dkdomain=toblux-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-85806-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85806-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j2-20020a50ed02000000b005664ee61abbsi236308eds.610.2024.02.28.20.56.53 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 20:56:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85806-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@toblux-com.20230601.gappssmtp.com header.s=20230601 header.b="ba/CQ0Pk"; arc=pass (i=1 dkim=pass dkdomain=toblux-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-85806-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85806-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C20C31F25B36 for <ouuuleilei@gmail.com>; Wed, 28 Feb 2024 22:52:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03D4A72911; Wed, 28 Feb 2024 22:52:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toblux-com.20230601.gappssmtp.com header.i=@toblux-com.20230601.gappssmtp.com header.b="ba/CQ0Pk" Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 611C11EEE7 for <linux-kernel@vger.kernel.org>; Wed, 28 Feb 2024 22:52:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709160744; cv=none; b=InRh1URRTM7HkhU76u0FPZjDgVxXawjfTFmyYeoY4P/RV/DXWn5R2vQXHQygvcT8t+3hw0ZjmAu2RL2hZWr92R3fXMILoRpOp6tvhCbor/hcClP4VjKgdvpBW8wMA/dM4/CzSZWFxQfOsCQ+LdAeurlzm4QpLnvWXVVWo94OH5w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709160744; c=relaxed/simple; bh=ZQCta753ivPoo8b0/ihVIr1oYvphcIvS17YSXyf2fV0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=OWs4ulJPE8eDEtKs3VX89pTWcBgWbGh+ygmTxoc/JypMXNAyDRBUoUpyuC5qMtFL4jwC6Kf90cDonV4m+f+JDXbDEIB0sUu+EnreiYIEfiCHQaEhvC7qaNkS1UkawlyYpxV6/akRJFOUI3FyKFyE6MjiXNUYZ3i2SIVJOtqLV9I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toblux.com; spf=none smtp.mailfrom=toblux.com; dkim=pass (2048-bit key) header.d=toblux-com.20230601.gappssmtp.com header.i=@toblux-com.20230601.gappssmtp.com header.b=ba/CQ0Pk; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toblux.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=toblux.com Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a4348aaa705so48738766b.0 for <linux-kernel@vger.kernel.org>; Wed, 28 Feb 2024 14:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toblux-com.20230601.gappssmtp.com; s=20230601; t=1709160741; x=1709765541; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=p68q64fPKpPRnVU3Ta/zu5aSS1cC7AT3EHsyijjzmko=; b=ba/CQ0PkDCWH+jZYzyfb0/K+5alngizmRJpTtnaYxzuzFPJsEYW8vLyNJFioq4azcT h6dssooKwnTalEPs3WY/GHkFGhZm2EUcGRP+cN0Bby6uFOKjtUEc/qxmxtzapDJPf7Ic ZDjlAEuY7bcIHhK5RwYq38ziDaCadeEPfbTEt0cze9QVHoDVyElWMETfVzaZ0Ab+jBaS WRkfAX4wT62wcIAlrE9yXhfpK3Z78xFEq+y5Oul5e1brlJeejt1QJgZYRZQ2Lt0BbZpK m/aSFbteusCQttoS0iuFXZSNxma5El18SGMcAsaXtJBKcuLpPsjqco7m/j2//vElN+Yy VWFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709160741; x=1709765541; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=p68q64fPKpPRnVU3Ta/zu5aSS1cC7AT3EHsyijjzmko=; b=lG1vdHKay4Ldl2gSNDyPLh2lxVx6gbL4vsJMErh5l4AVVpP8JIPXnroPWFtNdouCnc Q32xHlO9PETA6mChi1YqdOxULWZrSBwSC07oBvLsijrMiPh87/tAk5w+1Ya8RcQuWtdn kjYADhBR4NITjYOOAOcj+s41ucAIFd4fZzktLwhXyijbWJtoYTqnsia7XL3IEICg7h9f McoeYQIAxW2To5q+ZvqoecDkHqNN7FMLcjUyJXab1XwI91MQlJg5mGViVscPGn33aju1 83XySsm4/Xfkxb5YanpBQzmW+E+SPdDrp/kqXA+4H8/6T99HZtUjj+sdTDty2nkPOFz3 vvHw== X-Forwarded-Encrypted: i=1; AJvYcCUeXx8tMhGXi29rUo44e/HieuE3pRhVvt7WNwnig1j69Co0I1/OR37KV3bfoIgJ3WpSpUJwuVHabOivVJ6J0SpswBOFDU2WTI6Dy6qY X-Gm-Message-State: AOJu0YzOw0CaEXgYTG+7bew81qXoK7BD/0I7vZH6ChIaEiuzJLFS8v3I eKfcefGXeTip8qcBZipOC0MzlEbfbJFn5EdFx1ewmKnEi5MyXznSmgTu+kzp+/JKF8h7HQURehv fqndMuA== X-Received: by 2002:a17:906:b7d4:b0:a3f:7e2:84cc with SMTP id fy20-20020a170906b7d400b00a3f07e284ccmr241976ejb.6.1709160740552; Wed, 28 Feb 2024 14:52:20 -0800 (PST) Received: from fedora.fritz.box (aftr-82-135-80-35.dynamic.mnet-online.de. [82.135.80.35]) by smtp.gmail.com with ESMTPSA id q11-20020a17090622cb00b00a431e4d5deasm2292785eja.155.2024.02.28.14.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 14:52:20 -0800 (PST) From: Thorsten Blum <thorsten.blum@toblux.com> To: Andrew Morton <akpm@linux-foundation.org> Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Thorsten Blum <thorsten.blum@toblux.com> Subject: [PATCH] mm: page_alloc: Use div64_ul() instead of do_div() Date: Wed, 28 Feb 2024 23:49:12 +0100 Message-ID: <20240228224911.1164-2-thorsten.blum@toblux.com> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792207868333797982 X-GMAIL-MSGID: 1792207868333797982 |
Series |
mm: page_alloc: Use div64_ul() instead of do_div()
|
|
Commit Message
Thorsten Blum
Feb. 28, 2024, 10:49 p.m. UTC
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.
Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
---
mm/page_alloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 150d4f23b010..dfafec7fba1d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5845,7 +5845,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