Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3599812pxj; Mon, 21 Jun 2021 02:21:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBgj0tt5n8IlNxCAik/AdAOAODs7VikLwnLeZ32XpDGET7JzYl7seU8kDwK6X4kzekCV1y X-Received: by 2002:a05:6402:50ce:: with SMTP id h14mr20242695edb.219.1624267304894; Mon, 21 Jun 2021 02:21:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624267304; cv=none; d=google.com; s=arc-20160816; b=HXp6y8rbt5po9BwibX1jvxt3BIO0Fm8/Eu/Hr16OBgznG1rSJ6MLkmuK45W4gk+wlv 9uVR3CnbdI2EUslbx6Dog5fI+uFeBz7ZXNWx1HOPaTq1rEmuoW38+i5y7atrH9QJf9aU 5XInkdoPS4UafxElRVgc9mX27+Rho97Qutd24ycNIWMj7iWBikrSqUqo4IIR4IgFq/vQ 5NBs/mur06yndzFrkFY4xezXsa1xKadhCD5wicuiPtRfsnlTEXoGMT9azb/Ddn8jdzSX Kfux+ZHEYmDBjc99Qg9gScc13CsDMMtCFR/8TW4u9V6uFhst+85uiU0nQ+5O4Nc93QWr pM+g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bMx8BP4MqYPHp6/XglTQi8htgyQDCyPm2g5UMRM0MZY=; b=a9MCtQ4Rw8yWqU3iLWofOnzw53cCuA6dk21nkWfAoiMHGxVEWVEKMqLDpy7LvD9Fbo USZaqBED774ZztsL2zdX21w9aclHdBtoKmi3HRZXWI5RhH8fLIlWt5G0vknVqvGWbCzU 9Rz0VPWdikxyaE2C1QOMXVhrUzVZxUzuMV/PMu0w1pHB0I2EoGO6T+vpNE1xRPM+L6Vh NETkvrSZYo/IhwT0NZXXSk8JiBqg+xI5L4gGWGOx2jYPj1y1BOJ/SvCXIINHVlFfWmzL +ZjRpzNAKrA9uhwwDimEKvWLO+cCCROCxiExRDAtZAVlXyVaMfuYToWTvm494epjsvDG qA5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iCa0Ce9t; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bz26si9610630ejc.672.2021.06.21.02.21.23; Mon, 21 Jun 2021 02:21:44 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=iCa0Ce9t; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230397AbhFUJWe (ORCPT + 99 others); Mon, 21 Jun 2021 05:22:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230392AbhFUJWc (ORCPT ); Mon, 21 Jun 2021 05:22:32 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A10FC061760 for ; Mon, 21 Jun 2021 02:20:18 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id pf4-20020a17090b1d84b029016f6699c3f2so4865388pjb.0 for ; Mon, 21 Jun 2021 02:20:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bMx8BP4MqYPHp6/XglTQi8htgyQDCyPm2g5UMRM0MZY=; b=iCa0Ce9ts0oLs1Mc9I319xqPvIhFbThuzm0+AGoxvFz9bQyewJwTrt4krfZCsdkkqx JO+qWXwVx0iN4KfJKWFJybLmNSQNxsfTE+nQwBiYEs8I2arWPeh+G5Gib7c3gvT4q/5K 904OQ/JWYo+pzpGkZdotKSxGhLMhlnSsiDyQr+0vcT7wtpHgV7RU6AS+Dig6V+09zkYp z2FAbjA8K73lHkH9LrHCID0QW2Na37AMrEhJP7x1eD9poBMPDD+/AK9/SVXopCgYYZy5 Bz5Vq8iwJLT3MQYDRGod0IDUKhR2LiHYeU/ej8Au/8vu04VKFsNBmMHVinY6Qf46yNX9 gwlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bMx8BP4MqYPHp6/XglTQi8htgyQDCyPm2g5UMRM0MZY=; b=SE0N1TD5lXMCVagy6+Hn6Za1El4lvGHb9qsNtZM2wI5Qea6kNuUkJ7bum8n04WDdmV bHuaJjl9MjgcCF83TPwa9dXaIGjMAb/uZguxbwFv4+EccD5X9Pbj2wdyE2v03fwwjkzV r2pk8i5uTlISWwP5Sr5tANGoAtG07IfExB7mfhREJxqLsTAXc+zerWDWRqyZ7vDHOwpy SlzXfnnZpeM6wt1RS5rMW4e1pan3t7F5vJQi16KsuuOfkg/DZ3rDKIy6IHKaxtH2x31u olsTIj5BI/EAu67SzAhi3PppSWzC58pySXEHNHV1c+OeGucIr2Q1piKenCoHM4IXgAT2 IPfg== X-Gm-Message-State: AOAM533Nwvo3+4BkWKEkGcN8msQYOiomM6tTKB+DZH5YJ5CXZ0zMFQUP vkN5azy3eNkZamx+2UwvCfM4Bg== X-Received: by 2002:a17:90b:1881:: with SMTP id mn1mr2569667pjb.225.1624267217999; Mon, 21 Jun 2021 02:20:17 -0700 (PDT) Received: from localhost ([136.185.134.182]) by smtp.gmail.com with ESMTPSA id u24sm15712153pfm.200.2021.06.21.02.20.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 02:20:17 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Ionela Voinescu , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Qian Cai , linux-kernel@vger.kernel.org Subject: [PATCH V3 2/4] cpufreq: cppc: Pass structure instance by reference Date: Mon, 21 Jun 2021 14:49:35 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Don't pass structure instance by value, pass it by reference instead. Tested-by: Vincent Guittot Signed-off-by: Viresh Kumar --- drivers/cpufreq/cppc_cpufreq.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index 35b8ae66d1fb..490175d65082 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -373,18 +373,18 @@ static inline u64 get_delta(u64 t1, u64 t0) } static int cppc_get_rate_from_fbctrs(struct cppc_cpudata *cpu_data, - struct cppc_perf_fb_ctrs fb_ctrs_t0, - struct cppc_perf_fb_ctrs fb_ctrs_t1) + struct cppc_perf_fb_ctrs *fb_ctrs_t0, + struct cppc_perf_fb_ctrs *fb_ctrs_t1) { u64 delta_reference, delta_delivered; u64 reference_perf, delivered_perf; - reference_perf = fb_ctrs_t0.reference_perf; + reference_perf = fb_ctrs_t0->reference_perf; - delta_reference = get_delta(fb_ctrs_t1.reference, - fb_ctrs_t0.reference); - delta_delivered = get_delta(fb_ctrs_t1.delivered, - fb_ctrs_t0.delivered); + delta_reference = get_delta(fb_ctrs_t1->reference, + fb_ctrs_t0->reference); + delta_delivered = get_delta(fb_ctrs_t1->delivered, + fb_ctrs_t0->delivered); /* Check to avoid divide-by zero */ if (delta_reference || delta_delivered) @@ -415,7 +415,7 @@ static unsigned int cppc_cpufreq_get_rate(unsigned int cpu) if (ret) return ret; - return cppc_get_rate_from_fbctrs(cpu_data, fb_ctrs_t0, fb_ctrs_t1); + return cppc_get_rate_from_fbctrs(cpu_data, &fb_ctrs_t0, &fb_ctrs_t1); } static int cppc_cpufreq_set_boost(struct cpufreq_policy *policy, int state) -- 2.31.1.272.g89b43f80a514