Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2743121lqp; Mon, 25 Mar 2024 08:05:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVr6gEB2yv73n5UOOgpzDei+rwxiE/I7rzzt2dQQJMsgR27W4iEj+SiLHldrZp3G/p8AYZ0TivqMR2ROH0sKXNwBttd8VukE4b452sQ+Q== X-Google-Smtp-Source: AGHT+IGsjWPFqSlaumu8K8iAVZ2NaN9D4JLxrsNVAPK8KbJknzOYv07+E1kHgwFZwmG9cCWFlcS2 X-Received: by 2002:a17:902:d4d0:b0:1e0:a805:46cf with SMTP id o16-20020a170902d4d000b001e0a80546cfmr6060023plg.12.1711379127568; Mon, 25 Mar 2024 08:05:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711379127; cv=pass; d=google.com; s=arc-20160816; b=Xc9RiXB46gPzap/5WVv5ABhheZzBYfFdTMMXntFWwFUzS6nxELTyVIngEy7s/uIvDR 8p0FjxcrH5jROI4NOSiE5YGWPrGBdvNDZpMfaspkwCt33bt4SzSxItBEsrurWvNG1xHD 5lpyCc+kjUZMYYZXD0Cdo2csJw6MYhqdrdGIMSBJAgMfWCZHPUB5iwzw8y+Aw/qawGhY 6y9mlsRtfx0AyeeEkuUfaVZAkx+l0IOFwLyO20S4whLR0JWjzr+gz6tVY/KowDDj81OY QRS9flrsMs11JR8PZDW8QLgjFqqQ/8T7CSZesG896874He59HuGmFeCAJ2YqE8+5v8Mi mbUA== 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=V7ZrRjMFrchn6HB3wAoGdexu3qaXNvkZNnyu+q968YE=; fh=wgq3SFFcpYoLsYNr1Fy+HYH2+WGNJgTNu+AnKLa6P2U=; b=yHzobBTo1ZM587qR22npsoU9fMEib/UCqUcpEZTlj4Puaa9GCHpMHi06BpQuEh1WAu alz89BZVdlOPVOY1E6IZeNUFjUg3BRYs5Q94FlcfsSgplkbTSOWWQUdU108JONTVyRQe 0hzYUt8QzcLH2dTuATjtGwiVOE5pmXMhw5KaP1AGJaBmFHrpjEUB9JysCadshBWo5lS4 Vai2EnJvigmRVpEcqMNvckt9aHFaw8dE6ts86SBqwwGJeIsa9VhL8p/hdRaR31NwJZO9 x4YwJ6I3DAtXF13vH8B+5Nn3MalMsGttH9MntAvukQzYYHrDjkFVc7ReHRz4u9a3vsAF 0WPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZedpXBTo; 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-116592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116592-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 5-20020a170902ee4500b001defa2d9099si5159399plo.625.2024.03.25.08.05.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 08:05:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZedpXBTo; 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-116592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116592-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id BBF19BA3F0F for ; Mon, 25 Mar 2024 12:19:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D393E14B073; Mon, 25 Mar 2024 08:53:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ZedpXBTo" 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 5CFED15FA84; Mon, 25 Mar 2024 06:41:51 +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=1711348913; cv=none; b=rHfSodhmCvGI5R8dMRuUXN3o6X6ftDMHgvy3N7WnXUvT6rcc4zboBm8qvFcaZyAVrDC6eeEN6EVZf1aeOEvD8IndHNUp3bHqCzJaAaow/JSjNXVzt0OZ+SPR1roiVPioKaTEiVvfT4vrAdnn5IVS/EKwXXH31Tbb6sIZ/7LyEsk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711348913; c=relaxed/simple; bh=EgUgzUoucqqDqOU2t7gKumIS3qm9Toh3D3HqJIoc9lY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HzcSeeZRLydl2iH7T23mYB4QzM4x63aWkpjb5lxL55zquB0eAjiWpSVQP2vzc9R8wFoJIqM/K4Y3VWsZgPNnEPHvMGvAWPcLQ+tWfLuXcWQJM72foJr+pw4E1+Iefq/uuknLj6PQ++Qi2ZLhVn0Vki/wnmVIxQNoyTzK6ICTIpc= 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=ZedpXBTo; 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=1711348912; x=1742884912; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EgUgzUoucqqDqOU2t7gKumIS3qm9Toh3D3HqJIoc9lY=; b=ZedpXBToNbQxuBmTYxz2khw+RLO14UlpptIQnSBqowq6QkIUPcafPRG5 6VmtzfMV4yW0bnXVF/cu+OmPw5IumhCjkKSAl7gbc0OotQJz3pIhFs6KE Wmz12j3g6oNv4x11IK7Hk1uw+6yES9k5h+Nv5uVo+YM8EDvjgHTLvAn/3 czaS+/XZRnH8XqQGri8We/DAVuC5QGaTwg7+/5yfQg5X1Aq8+5+KVrJSW Use67OcpXIo1+a+s4pGE4+UvzOT9E+jmtBbWkvPj+ecxytriEjjjQh2De zB2fZGlPLveIizGQG1X7vRIYPdhtmQkPporrhNvkXQJkNTNB3Oeug4L2k g==; X-IronPort-AV: E=McAfee;i="6600,9927,11023"; a="17065310" X-IronPort-AV: E=Sophos;i="6.07,152,1708416000"; d="scan'208";a="17065310" 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:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,152,1708416000"; d="scan'208";a="38629637" 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:44 -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 11/19] timekeeping: Tidy timekeeping_cycles_to_ns() slightly Date: Mon, 25 Mar 2024 08:40:15 +0200 Message-Id: <20240325064023.2997-12-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 Put together declaration and initialization of the local variable 'delta'. Suggested-by: Thomas Gleixner Signed-off-by: Adrian Hunter --- kernel/time/timekeeping.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 63061332a75c..c698219b152d 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -383,10 +383,9 @@ static inline u64 timekeeping_delta_to_ns(const struct tk_read_base *tkr, u64 de static inline u64 timekeeping_cycles_to_ns(const struct tk_read_base *tkr, u64 cycles) { - u64 delta; + /* Calculate the delta since the last update_wall_time() */ + u64 delta = clocksource_delta(cycles, tkr->cycle_last, tkr->mask); - /* calculate the delta since the last update_wall_time */ - delta = clocksource_delta(cycles, tkr->cycle_last, tkr->mask); return timekeeping_delta_to_ns(tkr, delta); } -- 2.34.1