Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2665452lqp; Mon, 25 Mar 2024 06:08:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVplFnSi4UXen2Wlv200W4vjIKDb0yQ8xl0FINWHl7cCy6gE3oegIpleqUANuqgMV8VUwJmoMNuvZz0fYprJ4u+rJTBI3hfaVw4NsBkTA== X-Google-Smtp-Source: AGHT+IFiztBBi9Af0PMTYz18iiA5U75p31WbLMmjSII31+v/jolWpoUhmGbTrxlh14Inio2o/flf X-Received: by 2002:a50:9e2d:0:b0:565:6c72:40a9 with SMTP id z42-20020a509e2d000000b005656c7240a9mr5079288ede.28.1711372124152; Mon, 25 Mar 2024 06:08:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711372124; cv=pass; d=google.com; s=arc-20160816; b=Uw9SvxLE3YVPvCc8NUMvcdeapZIXkX1ugkxChSUGIRDuP1eQE60MbQLaEIF7GtifGR fnMygUSi0HI8vUbJJtVLCAPE1LJjG8IdOkd66QqbCHtH2xN98P7y9e5KaR0fvWK/rqRm kFP4sVFKWBOltF7MrCbDgXtkEpBTiRihPZ9JJY/vpgnipU/TsAuqNUd5qUJKeaWOm6hT 2eF19baGQzwkieoQNLbKAB/7U3SMcFH9OvdQbMgvAOmmv/xZLtoxdblzBK6roTqZecpu UYciR2NGg15ODm3kYla9Kg+9PabzBEUB9VLakt/UpaJFEmLhusnmZ8vl5vGLbbonm6Ns cx7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:organization:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=ZGlRoN0ffV9Bd/uqKbCKi0emvgB/c1Ms459gNeg4p98=; fh=wgq3SFFcpYoLsYNr1Fy+HYH2+WGNJgTNu+AnKLa6P2U=; b=iR+53ozPXdg3FzH60Hr8pzokme8+pzEyY6c2fR7q1F8Yh9JyWNKb1SJIhaUY63cVf6 dGwAKl15MHru1LLl0aj5OiO2Ta6a33qhqngC70KLwXBccF5/VxAaFlFUE+fmUYveKi0s +ciiozI/QXbOTcHS191Kpo0U5R56oNEfwwW9+Pt4WTMy4z6u1aHIDiOcW5B/9bCCsMPu aV8k05s499Vi8RGMycLJKyboXLiuJi4tO6gYzQMK39MXUduawcCMHBADu4ByahRXkYmH 1AjVgksBk5vG1W/0j+HgugsPWYgUG35ViMWWlFxo75wUJ9axr1167eeqztAf0YT6kgTy 9KkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ckqX5eEn; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-116600-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116600-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b5-20020a056402138500b00568ae935a92si2394190edv.524.2024.03.25.06.08.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 06:08:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116600-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=@intel.com header.s=Intel header.b=ckqX5eEn; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-116600-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116600-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 46D171F39D8B for ; Mon, 25 Mar 2024 13:08:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0E900157A7C; Mon, 25 Mar 2024 08:53:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ckqX5eEn" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 1DD8415FD0F; Mon, 25 Mar 2024 06:42:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711348940; cv=none; b=hWIj8TH68KIcimqqb24eij+fXz7nq3eZ+/cJbg3J86bBXaixDasF/PdmXcgLY+LajlDzbpQqlm2yt8Yl8WBIkumJsrRW7zF7ws1BGFklfrgHttIOFnwKmmnRCbtWfEDfoHfl3x70xZdNK5603NUa12oSHdNTh0VnjBL91SEEBtg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711348940; c=relaxed/simple; bh=XagHsKZy0o0b/SfCKSGfthtDX1F7t80ikEGTTX3TaPM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eEpEZiOEnr6Quqnldh66MGafCyPmlGhtFW8b7foHZSBCt1GPxM96jBUJ7AeJPGwTzDU0wdXl2ghS29nZWiXV6vJDgi0Rck4fqgcI4DITGYLwDX0pj9ioTlN0Z9bjXNPYILi2P4uR4p0sdM61wSqaKrrZPjTa7dCQPWvAnDmgfpM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ckqX5eEn; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711348939; x=1742884939; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XagHsKZy0o0b/SfCKSGfthtDX1F7t80ikEGTTX3TaPM=; b=ckqX5eEniHY+A6sK/F41fC5asgkog6yJ0hGbXmo1RNw3f8lqLii86HlO 6UviiCgfDFKMhGw7rZ9Ni0DMvVT7BzDGhw0TfjXFp14tS3BAcgYUFRaZ1 xPWF0tUMSgZLmkq9DX6PP3jzqoCk+aA5QMLsHfaQE0kaLEEFcVxsefziE vMXgNDZ889wHbsdj5eR+8mH6ER7G3Cy5Fkkrka6E0DnYlaTePjkQMnOVT PyXYJj3jF22TmwrVdLLdG3G7/a5IRp7T29MfVTeGy6TboaGE5Krs3zM7I Si1L1YWBuwQMurEJSde9ghqFhu17noba7FII2sWx5DJlNwEPL+SBJeQXR A==; X-IronPort-AV: E=McAfee;i="6600,9927,11023"; a="6191550" X-IronPort-AV: E=Sophos;i="6.07,152,1708416000"; d="scan'208";a="6191550" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2024 23:42:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,152,1708416000"; d="scan'208";a="38629691" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.251.211.155]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2024 23:42:11 -0700 From: Adrian Hunter To: Thomas Gleixner Cc: Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , "Naveen N. Rao" , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andy Lutomirski , Vincenzo Frascino , John Stultz , Stephen Boyd , Peter Zijlstra , Randy Dunlap , Bjorn Helgaas , Arnd Bergmann , Anna-Maria Behnsen , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH V2 15/19] timekeeping: Fold in timekeeping_delta_to_ns() Date: Mon, 25 Mar 2024 08:40:19 +0200 Message-Id: <20240325064023.2997-16-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240325064023.2997-1-adrian.hunter@intel.com> References: <20240325064023.2997-1-adrian.hunter@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Content-Transfer-Encoding: 8bit timekeeping_delta_to_ns() is now called only from timekeeping_cycles_to_ns(), and it is not useful otherwise. Simplify by folding it into timekeeping_cycles_to_ns(). Suggested-by: Thomas Gleixner Signed-off-by: Adrian Hunter --- kernel/time/timekeeping.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 1bbfe1ff8d24..749387f22f0f 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -364,23 +364,12 @@ static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock) } /* Timekeeper helper functions. */ - -static inline u64 timekeeping_delta_to_ns(const struct tk_read_base *tkr, u64 delta) -{ - u64 nsec; - - nsec = delta * tkr->mult + tkr->xtime_nsec; - nsec >>= tkr->shift; - - return nsec; -} - static inline u64 timekeeping_cycles_to_ns(const struct tk_read_base *tkr, u64 cycles) { /* Calculate the delta since the last update_wall_time() */ u64 delta = clocksource_delta(cycles, tkr->cycle_last, tkr->mask); - return timekeeping_delta_to_ns(tkr, delta); + return ((delta * tkr->mult) + tkr->xtime_nsec) >> tkr->shift; } static __always_inline u64 __timekeeping_get_ns(const struct tk_read_base *tkr) -- 2.34.1