Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1016729rbb; Sun, 25 Feb 2024 15:29:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV0suitZjoaxYWk8seafeivvfh+e1SpQQzJn8pwsS9NnwqRNjKdI7KCIYNo4JVCXo7xZvPoMNr1qC2nX3zMwBChB68B6nv3OLrexFNIEQ== X-Google-Smtp-Source: AGHT+IGZfv53wG2KpStoWak2meGUhotA9M39CUDP6dl7mXpIPJSbivEyIOUwdEha6d08WIRDUZ9Z X-Received: by 2002:a17:906:a00b:b0:a43:381a:5225 with SMTP id p11-20020a170906a00b00b00a43381a5225mr1622443ejy.17.1708903746896; Sun, 25 Feb 2024 15:29:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708903746; cv=pass; d=google.com; s=arc-20160816; b=t3GqlFEIEcd7QEegNmbE56WgLaEmEDRprXF5TFk7tHSQFKh6js1IEG6guUGrLKVhQC NfBw3PMFWhUOzhU5og1pb/E4u3UqkxCwgolcHTZgCRLx3guv5qdhl6Y8OgpemV/ORVju JdBPQpstP5t6QJgCywjOxX1PxoGKL9bhRARd7t/qsn0N/EX9f0p69hmEbx/S6abywvWK Jq7aeRjQrNgv1njavBQEJ8NuusA16hbRrtT2OOFTEuXOwjaeCuWB2DacuzNVt2LFi/+N zDuV0I9fvRwguSbHP/Z6nQR+bSGPZGr4tS6gwtNTtFDXcJEi6k3rliNjIaQUYNsevhWG M2mA== 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=mOoug/fJ1o4Ds1BQ7HtXxre7Wl3jDmckcXaES65Kt2E=; fh=rTndupTQ5teKKZ6sK/N42aaaLkNjWf4u/zC4GJfHVoQ=; b=amnH6rdI4JA99LPFuuZFma+B7b1SNHTcdkKFqkwuZ8Y3N0P4SwPNVvKOh4l69pEgOX 2UiPe10QfwQ4fCu3Kmz4ewz1lAetO1i7qgtr109WxKZPKNeXJXcpCZBjYTw7xI+Urz+q a9uzBtM0xApUAn88qR0nwBKPcqDn78HHqt4cuQF1PYB8uhCLfjHLKrls9Si/ZFPvKjt7 OOydDAfJfNyic8NFur+y0ubktiTrq4p0SsRJm8vbrZplYoB/+xAqKtFYlUVm3AoNmURI QTvei3tJ56bfTnBpomBC0GWhyuxfYH0Y1qqB/+xWWGaxh0Xw8kVKZSiv/oKUDjujTGE0 8dpA==; 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=IvgDWFzv; arc=pass (i=1 dkim=pass dkdomain=toblux-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-80346-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80346-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h15-20020a170906584f00b00a3ece16f972si1530439ejs.403.2024.02.25.15.29.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 15:29:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80346-linux.lists.archive=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=IvgDWFzv; arc=pass (i=1 dkim=pass dkdomain=toblux-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-80346-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80346-linux.lists.archive=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 824321F213CA for ; Sun, 25 Feb 2024 23:29:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5C961BC4D; Sun, 25 Feb 2024 23:29:00 +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="IvgDWFzv" Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 5BCE328EC for ; Sun, 25 Feb 2024 23:28:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708903740; cv=none; b=GPosqtJ68NPgixRL/wJnZA45nfAwKs+ZgQakOMsqzq+zWrNh1ALHjVven9VhtoSYP1obxxkAHgQMg6m3+q2HEw4eRhQ08Bu1eFhTQzW1R1gtx2T8y7QElVMbUVa7Zy1krA3KpETNAJVBYvCY7hswpQpcTDYg5J4I1UuTq5BsE0M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708903740; c=relaxed/simple; bh=JYqDb+EWiG9lGhTTrSezJxj3tBLURMYEVMB73IGVPWw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=LYm/86nmc0RRhlfranHC3uHT/TLELy0z6Zpd3206LTebDbOxCzIDNwJV8M6kdY3x71tuwLLK6BU6lu8Kc1Pc0ifL/czlh67v0IjuB02ZWWgHlOkwWJHu4gznVX+OwArRrRih9v6MjRPKSBsf5qDpIABAbT+Fj0i0Jh7PKlxWjso= 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=IvgDWFzv; arc=none smtp.client-ip=209.85.128.52 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-wm1-f52.google.com with SMTP id 5b1f17b1804b1-412949fd224so11397425e9.1 for ; Sun, 25 Feb 2024 15:28:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toblux-com.20230601.gappssmtp.com; s=20230601; t=1708903737; x=1709508537; 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=mOoug/fJ1o4Ds1BQ7HtXxre7Wl3jDmckcXaES65Kt2E=; b=IvgDWFzvxdL1TlQuu4r1TslkduAxt6M1Kcfst2WfHSpVvKCojfRvYP11E3jwcvsMlS vgjkkXDzGBNGt57nSGpajZV/NSDkPAStR3DcNdtaSrq/M8ptR1ESOkc8+lcfDuLCfFTr T37nqa3a+G9pqpp6qsMwfj8LZClI3HzcIbfJxXMyzqY6dvYMUEMo+36j+7yH6g7g5v2/ pNkR9skTR14eYsT4ptBl8eJoP9YmEufq+UnP62k7y4Of9eGNGMt/zY1P6PJbFw1ES2DW ABOjfWGXGg6GbX+44padguTef+hdplGO2h36SCyyBpxpV4Y3oMc9tBc867jhNhGqXWoI MZMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708903737; x=1709508537; 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=mOoug/fJ1o4Ds1BQ7HtXxre7Wl3jDmckcXaES65Kt2E=; b=sqn8YzXmf8ahtVbEzqSqPghuALfsinrdZLxyrpw2Az9PnJ80QcVWJ2eCZWu7ZJF2cC uye7kXrslHhqnkchBfu8xJBbO1Ex0iK4/xELtHydIW82OdgxQqWiARu9JDsmx1M01GkY zE0Zj9mDlqtrv7n4g9fYf+Xpyo0Utpqx/YW+gtVSpW9ZNMpd7nlHU+Wb535J9qQIHt7Z 7XNhEzmIDHUfZCS1y58OCCjjd/U2FXa+yqcYRQ5U1JB3bfJ5ishPjxCPLNdNUn+YwTFx Xw1J7gpCHwyYDuSp6eCj2ytv4GJk7h6QyDo3hC6F9GXj/y0FJV20crGE2sEPqA0u5S7S 7oxw== X-Gm-Message-State: AOJu0Yya1yHnpjzbNoFcXFjmzXRzYWv0tRCwYe6L7H1omgZKO6nZTo41 8ZB2hCm3ukxKgrQCgeHB3YuwigQ9qhvpnLRxCSmU/qYqyOWEN5gQBaoSqTVa9kLF1n40JuZsL8E l7BUntg== X-Received: by 2002:a5d:634f:0:b0:33d:39db:a0f8 with SMTP id b15-20020a5d634f000000b0033d39dba0f8mr5078147wrw.7.1708903736554; Sun, 25 Feb 2024 15:28:56 -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 z6-20020a5d4d06000000b0033d873f08d4sm6279675wrt.98.2024.02.25.15.28.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 15:28:56 -0800 (PST) From: Thorsten Blum To: linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Anna-Maria Behnsen , Frederic Weisbecker , Peter Zijlstra , John Stultz , Thorsten Blum Subject: [PATCH] time: Use div64_long() instead of do_div() Date: Mon, 26 Feb 2024 00:25:42 +0100 Message-ID: <20240225232541.17659-2-thorsten.blum@toblux.com> X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Fixes Coccinelle/coccicheck warning reported by do_div.cocci. Compared to do_div(), div64_long() does not implicitly cast the divisor and does not unnecessarily calculate the remainder. Signed-off-by: Thorsten Blum --- kernel/time/jiffies.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c index bc4db9e5ab70..9d23178e2b6a 100644 --- a/kernel/time/jiffies.c +++ b/kernel/time/jiffies.c @@ -91,7 +91,7 @@ int register_refined_jiffies(long cycles_per_second) /* shift_hz stores hz<<8 for extra accuracy */ shift_hz = (u64)cycles_per_second << 8; shift_hz += cycles_per_tick/2; - do_div(shift_hz, cycles_per_tick); + shift_hz = div64_long(shift_hz, cycles_per_tick); /* Calculate nsec_per_tick using shift_hz */ nsec_per_tick = (u64)NSEC_PER_SEC << 8; nsec_per_tick += (u32)shift_hz/2; -- 2.43.2