Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2665157lqp; Mon, 25 Mar 2024 06:08:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQDXIbyoqRFtMN8Z0j2HSpKG3rkReDk3iTaDum1qrNoRtTVGGACs0NSQH6/+gYOcX7vDQRAKNTgrTh555chvC+cB3ch67jZZeJS53r1g== X-Google-Smtp-Source: AGHT+IEJCkH2gwPiUwVLJHY45ORgeSs0KMJ8LY+urGBY7lsD8czXUHe6E8JWdzJYcmdv3/NbDD0G X-Received: by 2002:a05:622a:1354:b0:431:5f78:28f0 with SMTP id w20-20020a05622a135400b004315f7828f0mr1520738qtk.61.1711372099824; Mon, 25 Mar 2024 06:08:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711372099; cv=pass; d=google.com; s=arc-20160816; b=aLHEDGIMRnBcjp++EQl1oPtALOECCnGW79Lx6Ykv/diYAFgSR5bqyzyQHMWfh8yXS4 aRZeMcZfKLgKijj5HvV0RYqYZm9j85qZ+5th4Ek4LrFru+Sw5oDeVlzF9Whpbh1m2bCo 3+EQZjHhZrUy/2Y7QATOMpSINO3TQJsCMckBF1EkRNe72lidSxdXAcSGKnlNy6fJoS5N YRhoDbNwDbwNNwM7g8vhNM3rbW+9vtqlYBBrKzuQZkQMx7YnW639/Rh570o4upyDQmzf 7WRmLAAh7YuR8xvWwSzIyHHSYqz/PCyFBMaIJEa9b44vBqy+3egzJmRwncuIArn02+E4 NjEg== 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=+V9dNY/ZCniS9ASUoOf1m+w3g6fXPmaCN4j+7hAqmn4=; fh=wgq3SFFcpYoLsYNr1Fy+HYH2+WGNJgTNu+AnKLa6P2U=; b=y1Zcj2J0ZR6Hfa2yOJPr/4i3/HqAXIrFnIYQ2fEsO4qym2M/EneOvebGhoAfIl/Y7M v4JEcB2aOjxZVaYp7rrwpzwojsoThBRUXss92stjLGrIZwfZwG4xvxeiAWg6hcail9ra X+IUCSljbqGb6SMx5pkjU4Hqpn7xsbQ+7xIBfTDMGXfObYRPjgsrvLZH+ifA05IDGF0q lqjB9QmTr/lSzi4UcnMqXyTh7qxJg4VvCHmV6CDio9mv0RoNRop9qNbsfEeE/2O3yoIA 6DjJoHVCi7G2nnHzy2Qes580Sl5wfvGQjYQhp24B8L2AMG8oDNAU3ukVdZewqzrbUBtj ZJRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=alPU62rn; 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-116584-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116584-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j17-20020ac85f91000000b0043156bab559si2070334qta.1.2024.03.25.06.08.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 06:08:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116584-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=alPU62rn; 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-116584-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116584-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B17681C381E2 for ; Mon, 25 Mar 2024 13:07:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7159E146590; Mon, 25 Mar 2024 08:53:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="alPU62rn" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (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 E659515FCED; Mon, 25 Mar 2024 06:41:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711348919; cv=none; b=PUeJ1IEJ5KsVyAjBojIuXGYzOxxp1gx4ovqSaSdEjrAO6If5GRCSWg3+2NkpRfSC64npQfFTyaAMvnFj9xcDHF3EobjfVKRCg5ccSw5nBClpTOJpUnC+6hXv/Xs/7lxeheJDHPNXAC8R2NJmx78HI6uAzRAu7p6z/jU2xyLVsuI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711348919; c=relaxed/simple; bh=ul0hfPOmfS7i90s07MvVRoTCajL4zQDIAp9Wq9nGTHo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WsrXdA9TkyWaeCsctnev+XxOXq7C/lpx1U23JTmDnIyVyW8snol5GiLo+fzxJZBOIjLXyySnmSCTOm2ynICcbg66g8Jyyzko2PsEgEyEYT+gACk4XQj+0q5oEnxEvYlOGv5gquwdI4TXhqN2q+0IFss3ubRP1DzmoWYRUcm2WOU= 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=alPU62rn; arc=none smtp.client-ip=192.198.163.9 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=1711348918; x=1742884918; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ul0hfPOmfS7i90s07MvVRoTCajL4zQDIAp9Wq9nGTHo=; b=alPU62rn9qVu1yt3kG5Uiop0cXCzhPb0lBkiE7x2bAMlTGr0BQKfiVVr qVpmo2CUQilDIzajd4EN+ZEFld7xbl15W3/xYL9zzCfPJAjxVb6l4BYfz yTDuPH3g6l7pDHti7RSkJ9zzL50m8ad8CxaCnMOTVTjThRQgi4yI4HCMQ cRidxz6QGGXSp2wqua/q26pLJN5wzc7sAA8ytybpnF8huLv38aDYhwn8n Zp8cDuS6Fv4jOxvq9sFjTBwv7EfFeG9tnQqEq9DghedEGCm4I1nyeZ9eX MlOg/nYtNbCfMihg4ZhY7WKWjkDiv9S40IXfErYyUJZaXMr8Y6G9I6SgX A==; X-IronPort-AV: E=McAfee;i="6600,9927,11023"; a="17065335" X-IronPort-AV: E=Sophos;i="6.07,152,1708416000"; d="scan'208";a="17065335" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2024 23:41:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,152,1708416000"; d="scan'208";a="38629647" 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:41:51 -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 12/19] timekeeping: Reuse timekeeping_cycles_to_ns() Date: Mon, 25 Mar 2024 08:40:16 +0200 Message-Id: <20240325064023.2997-13-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 Simplify __timekeeping_get_ns() by reusing timekeeping_cycles_to_ns(). Suggested-by: Thomas Gleixner Signed-off-by: Adrian Hunter --- kernel/time/timekeeping.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index c698219b152d..f81d675291e0 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -391,10 +391,7 @@ static inline u64 timekeeping_cycles_to_ns(const struct tk_read_base *tkr, u64 c static __always_inline u64 __timekeeping_get_ns(const struct tk_read_base *tkr) { - u64 delta, cycles = tk_clock_read(tkr); - - delta = clocksource_delta(cycles, tkr->cycle_last, tkr->mask); - return timekeeping_delta_to_ns(tkr, delta); + return timekeeping_cycles_to_ns(tkr, tk_clock_read(tkr)); } static inline u64 timekeeping_get_ns(const struct tk_read_base *tkr) -- 2.34.1