From patchwork Mon Jun 21 09:19:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 464493 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp2377339jao; Mon, 21 Jun 2021 02:20:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPGARUNBgc0FAa6gyHWSqOxGYAphjTZXfGazDmeKUKdrtxctk8oykHdoodqGTpeDUy/J7g X-Received: by 2002:a02:cba8:: with SMTP id v8mr2174238jap.111.1624267221470; Mon, 21 Jun 2021 02:20:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624267221; cv=none; d=google.com; s=arc-20160816; b=kOP/jakvJ9a06RiErDRpAa1uMF1lHk6PgavTxbtKY49pNwdKt341YJiopHqYKdpqJ2 YPutNNxbn9EN117JvAMdksx4mj4CSYvE0IBVz4n47/pBdl8IpH2UB6eEXnoW4+QmpbUN r05bzqBg9t64xA47bs3Fa2Z6vElI5rZEXqa94k8gpjczB8XQb+TDa0Jqmms2NW95KWQd cMVczoiAVcWFDHn86chuBxweXwHNzm94tV6K8eHnR50b3qQisfaIdM25EO+lT+/FoWOA Q2RH9Mmr3V5guhHkg6R0AFt0Gf3q2MXluas9r9l/UQ9KwdXfcSGqxhmOujOa0VgXzmBU 4ONA== 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=FGnfazkppoNDPCFQTAOKR3N+sgeO9B5bRk2LEeISP6acNWU0HDkx3hH0WuPoYQp7mY 4Gr3cnNRzsK7sEvQnEtw2q3B6AVhO8zUqsZ/5p/spM5OP4D1LtpHZuY0Hw2YF5v6Xxd6 hwo7tiXiKMoNPIzfwvFIwPreo+vnh808ZkIJvcBtZxieG9PBmddZTXRMCDjcH83yIY0D GYigoaatIY2cZWVt03xlKHsYBI6pbG9YiDo+nnr1R6A6uRSznfKTHOL4kKXPeHEEQmQF knSQl8SkJ8FNmKHmbww1Ti4usqqq3hjo3sYGtqYLxllNxnFY54WqgfNucKXO+LE30I+T rQLg== 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-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 v126si1153344iof.68.2021.06.21.02.20.21; Mon, 21 Jun 2021 02:20:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-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-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 S230384AbhFUJWe (ORCPT + 8 others); Mon, 21 Jun 2021 05:22:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230330AbhFUJWc (ORCPT ); Mon, 21 Jun 2021 05:22:32 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68C1EC06175F for ; Mon, 21 Jun 2021 02:20:18 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id y21so2343410plb.4 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=LhjRxIeWqsA/yD6aUrEx3XD31iACcPf5MDZ6bvD0/5S91iy2qcka7K3mOW1qxemVW0 wul+mS6FXMourhK6V+yWt8i4rXqlbPWQaw4u2Nmpr0EPuP99j6YUY4zahNk3AXUxt+Cw bMBxAv7E4zJm6AHrINEumS1akr5AAJUr5YgjyowjB1T7rsHvqIUIYCKqFaVcjIPjcNYn Z+vWfAWhb1PWSsxdOau34pbBZ6u66KGUHt1aByvyfvOsKom3JpsnGQMLMeznlvUz195z lffghhn0TVO08Mk3wlLR7gPCT5KFyKQuad54V+VoJekR5MY/TRmjru1uoRUOJC4Z6gGE BesQ== X-Gm-Message-State: AOAM533i7PvWIK3CESghDyjww4mgVATR21qkPj1P5CuTSbKCIJzizTYX 3Gsqy1IhhmT2r+rWZU+3StMzzA== 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 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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(-) -- 2.31.1.272.g89b43f80a514 Reviewed-by: Ionela Voinescu 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)