Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8840573ybl; Fri, 17 Jan 2020 02:00:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzOkC44U1neMKDsMs+xeNYmL/rsrOQfsDFVjFDjJQnaImuzpdyBK2id65efLsKbUQrYXcpq X-Received: by 2002:a9d:24ea:: with SMTP id z97mr5532024ota.345.1579255221434; Fri, 17 Jan 2020 02:00:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579255221; cv=none; d=google.com; s=arc-20160816; b=FycrFAFcDPE6UWAE33o0svqoDXlhP2/GIqrYXYd/K7CA2Hqo+tKucel+WBS95QUHIT NbEtmrMoEPKPvYo3j6ItmePXCMNZ4qaOdOh63rIZ9H7UMQ4Rfnq3TiUBnofGPiDvW6Fj OSwI+ISd6HU4d/kTOF+KHj9zz+hOU+MKX3r/qgN9IaGrKVkQB6VTqvZW+CFjUSLdp06q a8PDuCOJmiMveTCibmzDvcv9OIQ8szIg1l6Cx4MaJmWDvhVvEolR8yduWn/v/Ye3mk16 Wt2jKvkcQl5QDZL/IwPa1fg5TSF7oWMxaCyxKymdzPRJF1QydY6xZlOPuoNykXqhNk7C TvYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NCMDhhcV5Co8iy+iIHE40yl0F53n9N1ZTv4ZVbZXaTE=; b=Ld4xZxVD5aej4KU7hu9I2UB/o+RnUzznWzZBwETve+U0QXGp8VvWr0c9SVJoAyx3fZ 07DhlpMTKUDdIA5gQKPvlY+ybBcoeEjYvVcDFtsf6zYk8mPOybqN8sI8HDHUtqW8NN8s gfUYAJjbTts+BBuMIBNIhlQkEFn0ivRKwWd6xL/3kCek8c5I65+dsqodf8dypQ5o3dPH PypgGXpdcBG4UoxOeCSJG4XdSrqcRTMIWT3SCq9RE6OmBkY9+ilSWjW1Wj3tL6sjy7Im Hf63mr906/SfV2nrzjm7+fhmuwQZ08+CarADtkkNZcKTeCFe2mpYyoZRczMcCSyLdeJL CCVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WkASaBpC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id b20si15286753otf.199.2020.01.17.02.00.09; Fri, 17 Jan 2020 02:00:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WkASaBpC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729076AbgAQJ6f (ORCPT + 99 others); Fri, 17 Jan 2020 04:58:35 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53673 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728872AbgAQJ63 (ORCPT ); Fri, 17 Jan 2020 04:58:29 -0500 Received: by mail-wm1-f66.google.com with SMTP id m24so6781962wmc.3 for ; Fri, 17 Jan 2020 01:58:28 -0800 (PST) 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=NCMDhhcV5Co8iy+iIHE40yl0F53n9N1ZTv4ZVbZXaTE=; b=WkASaBpCCtMQpQiYrnAyLL7EXfhipWDs/RyGnHO7GWnpGpuXGACNAfgCvbR2nG95uI HJc/lRc3OCKS4/2B05ipoDed7tI10ERAWJL/5281XUsl7mLSNwjPB57/dg9ON0RrWlrU M79AIn1fit0gfdfS9XGA1euAANxBYCGsKhTYWR9NaxF5HaxcENxte9GoSSJ8zwJHQg1E t9xS5VugIGG+Zlwbm2FBolvx1gdG4djnNGzZ1zZzRqd4W9uyx/kb039P3eQIFNsPmaZC Dc2as+WnVyRX8D0ZG8HF5zz+ejJTQLhjVSTJxnVXWfz/gfVAckud51/uF8RO2rd+jcGl iMYg== 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=NCMDhhcV5Co8iy+iIHE40yl0F53n9N1ZTv4ZVbZXaTE=; b=KGgxmGK1FwN/oNq4Ya4UjidQ+OMIJB8kmfKWwCbJ2dn/YkCWWp5eN9JY+I65QSgml+ DE53+cqeC+sDmL1VJzCaFwZMEe44PEAISmtnfqv9D9dL1TQsUamce+GGsKjINy4WaAra VrRzTDVVHueaF1B7+UE4RBmAXBWaItQql5iNJJmW1Jx/xBn+GypFuKe8yJ1JblFWxjsH vMHV4rQsvw4CzvbjLwI3amKXSKEh6NrV0hAwJNHncmIlMFhyf9Jt2H6HA57tke1muXyF 1Ac70dDGrV5JD+mtuMa8SeAS9rJWI4FomELkVD/ozfIFOY7mRf+6eK+sqj/ms96qrgCV uYcg== X-Gm-Message-State: APjAAAWSjOAIEMCPgKuIAYUm8sBmR5embvAaU+GnMEE7ux3RZ2bhSVpP 5G0lE9BSj+z0hCwZRaZOAjjkxw== X-Received: by 2002:a1c:1d1:: with SMTP id 200mr3724723wmb.181.1579255107985; Fri, 17 Jan 2020 01:58:27 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id r62sm9967007wma.32.2020.01.17.01.58.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Jan 2020 01:58:27 -0800 (PST) From: Georgi Djakov To: gregkh@linuxfoundation.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Georgi Djakov , Brian Masney , Bjorn Andersson , Evan Green Subject: [PATCH 07/12] interconnect: qcom: Use the standard aggregate function Date: Fri, 17 Jan 2020 11:58:11 +0200 Message-Id: <20200117095816.23575-8-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117095816.23575-1-georgi.djakov@linaro.org> References: <20200117095816.23575-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now we have a common function for standard aggregation, so let's use it, instead of duplicating the code. Reviewed-by: Brian Masney Reviewed-by: Bjorn Andersson Reviewed-by: Evan Green Signed-off-by: Georgi Djakov --- drivers/interconnect/qcom/msm8974.c | 15 +++------------ drivers/interconnect/qcom/qcs404.c | 15 +++------------ 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/drivers/interconnect/qcom/msm8974.c b/drivers/interconnect/qcom/msm8974.c index e669a1f726d2..3a313e11e73d 100644 --- a/drivers/interconnect/qcom/msm8974.c +++ b/drivers/interconnect/qcom/msm8974.c @@ -550,15 +550,6 @@ static struct msm8974_icc_desc msm8974_snoc = { .num_nodes = ARRAY_SIZE(msm8974_snoc_nodes), }; -static int msm8974_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw, - u32 peak_bw, u32 *agg_avg, u32 *agg_peak) -{ - *agg_avg += avg_bw; - *agg_peak = max(*agg_peak, peak_bw); - - return 0; -} - static void msm8974_icc_rpm_smd_send(struct device *dev, int rsc_type, char *name, int id, u64 val) { @@ -603,8 +594,8 @@ static int msm8974_icc_set(struct icc_node *src, struct icc_node *dst) qp = to_msm8974_icc_provider(provider); list_for_each_entry(n, &provider->nodes, node_list) - msm8974_icc_aggregate(n, 0, n->avg_bw, n->peak_bw, - &agg_avg, &agg_peak); + provider->aggregate(n, 0, n->avg_bw, n->peak_bw, + &agg_avg, &agg_peak); sum_bw = icc_units_to_bps(agg_avg); max_peak_bw = icc_units_to_bps(agg_peak); @@ -694,7 +685,7 @@ static int msm8974_icc_probe(struct platform_device *pdev) INIT_LIST_HEAD(&provider->nodes); provider->dev = dev; provider->set = msm8974_icc_set; - provider->aggregate = msm8974_icc_aggregate; + provider->aggregate = icc_std_aggregate; provider->xlate = of_icc_xlate_onecell; provider->data = data; diff --git a/drivers/interconnect/qcom/qcs404.c b/drivers/interconnect/qcom/qcs404.c index c8eb1276cce8..d4769a5ea182 100644 --- a/drivers/interconnect/qcom/qcs404.c +++ b/drivers/interconnect/qcom/qcs404.c @@ -327,15 +327,6 @@ static struct qcom_icc_desc qcs404_snoc = { .num_nodes = ARRAY_SIZE(qcs404_snoc_nodes), }; -static int qcom_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw, - u32 peak_bw, u32 *agg_avg, u32 *agg_peak) -{ - *agg_avg += avg_bw; - *agg_peak = max(*agg_peak, peak_bw); - - return 0; -} - static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) { struct qcom_icc_provider *qp; @@ -354,8 +345,8 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst) qp = to_qcom_provider(provider); list_for_each_entry(n, &provider->nodes, node_list) - qcom_icc_aggregate(n, 0, n->avg_bw, n->peak_bw, - &agg_avg, &agg_peak); + provider->aggregate(n, 0, n->avg_bw, n->peak_bw, + &agg_avg, &agg_peak); sum_bw = icc_units_to_bps(agg_avg); max_peak_bw = icc_units_to_bps(agg_peak); @@ -456,7 +447,7 @@ static int qnoc_probe(struct platform_device *pdev) INIT_LIST_HEAD(&provider->nodes); provider->dev = dev; provider->set = qcom_icc_set; - provider->aggregate = qcom_icc_aggregate; + provider->aggregate = icc_std_aggregate; provider->xlate = of_icc_xlate_onecell; provider->data = data;