Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1534846pxb; Thu, 4 Mar 2021 14:03:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdkifgj9/K+uzzqrQaIMbq1tX5wUSLt1/8yNVZe7Sat6wpc28TKvXa5TQJziy0JZ4Wf9KT X-Received: by 2002:a17:906:9152:: with SMTP id y18mr6541848ejw.19.1614895387255; Thu, 04 Mar 2021 14:03:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614895387; cv=none; d=google.com; s=arc-20160816; b=yZkYysW5aa4KJrAan51MsNOEV9xSs4zd3epaZ5DEKlE3dYE8MelysY0wmrmKfPvfOe 8Q7OeYEDqLb50wev955AuS2+/8vptAtx7KtvYAxxDwx+DFs85X48MoT00UfI6SZ3ZGKZ 8WETnwBe2LBY3kWUjH2VMMTWBc+I6yRQeKYDmXa+L7OijqrHjW2px4qlo0y95oywerN+ iaz69az06EJIBZFDKI6jZPzTg+4uOSBXRmSfs+nyzkpbBAK6WpYM3tUNO7iGh+Wu4sqg ouhOisyBP3dwklRq3wXwD+DCQuidhTvNfkCv5dkqtWaVQuJC9dyYiKTcJd0fGc+qb7AS CGcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=g6M4d0EkdPBWYTqZaWlaHu2+AW/sQtB5jgDPxzQC7nc=; b=utpd5kQl7Q5glYqsJjyCF+muoaGy9+XX/0tyqkIJyW28cxZZwg+BqV+cnK/EMnjJi8 nhonbpqYIUcwFpI8OSOVwoD/8kNoEFMkIvxX3qHObLciMlcfTOz7ApgYk105PmxKO71s +ORCdGTSE5kccoRDxBVqvyd4mSERx0g7bvm+R26wxZK6zhzfduGSZ/FF29+Xzey6Ixv3 uQOwr+Wv7iLhfnBjRw5EVQ33sY/FIjYuNBypLD25W3KmjXNZtxDbN72o3Mu5fNqvvfK+ Nll0uVXDiDeUTf8J1StQ4YaEQOU0/l3D9oKLlaWvFSiIf/Mk+DfZYWpJ24xL4EfKwN9D rvBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si243774eji.719.2021.03.04.14.02.44; Thu, 04 Mar 2021 14:03:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1448486AbhCCPZl (ORCPT + 99 others); Wed, 3 Mar 2021 10:25:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351575AbhCCKrP (ORCPT ); Wed, 3 Mar 2021 05:47:15 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BFB7C061756 for ; Wed, 3 Mar 2021 02:35:49 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHOr6-0001xE-4f for linux-kernel@vger.kernel.org; Wed, 03 Mar 2021 11:35:48 +0100 Received: from dspam.blackshift.org (localhost [127.0.0.1]) by bjornoya.blackshift.org (Postfix) with SMTP id D2E2B5ECB4A for ; Wed, 3 Mar 2021 10:35:46 +0000 (UTC) Received: from hardanger.blackshift.org (unknown [172.20.34.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by bjornoya.blackshift.org (Postfix) with ESMTPS id 2C58D5ECB44; Wed, 3 Mar 2021 10:35:46 +0000 (UTC) Received: from blackshift.org (localhost [::1]) by hardanger.blackshift.org (OpenSMTPD) with ESMTP id 9a3d7d0b; Wed, 3 Mar 2021 10:35:45 +0000 (UTC) From: Marc Kleine-Budde To: linux-kernel@vger.kernel.org Cc: kernel@pengutronix.de, John Stultz , Thomas Gleixner , Stephen Boyd , Marc Kleine-Budde Subject: [PATCH] time: timecounter_cyc2time(): mark 1st argument (struct timecounter) as const Date: Wed, 3 Mar 2021 11:35:44 +0100 Message-Id: <20210303103544.994855-1-mkl@pengutronix.de> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As the timecounter is not modified in this function, mark it as const. Signed-off-by: Marc Kleine-Budde --- include/linux/timecounter.h | 2 +- kernel/time/timecounter.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/timecounter.h b/include/linux/timecounter.h index 754b74a2167f..c6540ceea143 100644 --- a/include/linux/timecounter.h +++ b/include/linux/timecounter.h @@ -124,7 +124,7 @@ extern u64 timecounter_read(struct timecounter *tc); * This allows conversion of cycle counter values which were generated * in the past. */ -extern u64 timecounter_cyc2time(struct timecounter *tc, +extern u64 timecounter_cyc2time(const struct timecounter *tc, u64 cycle_tstamp); #endif diff --git a/kernel/time/timecounter.c b/kernel/time/timecounter.c index 85b98e727306..e6285288d765 100644 --- a/kernel/time/timecounter.c +++ b/kernel/time/timecounter.c @@ -76,7 +76,7 @@ static u64 cc_cyc2ns_backwards(const struct cyclecounter *cc, return ns; } -u64 timecounter_cyc2time(struct timecounter *tc, +u64 timecounter_cyc2time(const struct timecounter *tc, u64 cycle_tstamp) { u64 delta = (cycle_tstamp - tc->cycle_last) & tc->cc->mask; -- 2.30.1