All of lore.kernel.org
 help / color / mirror / Atom feed
From: Georgi Djakov <georgi.djakov@linaro.org>
To: gregkh@linuxfoundation.org
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Georgi Djakov <georgi.djakov@linaro.org>,
	Brian Masney <masneyb@onstation.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Evan Green <evgreen@chromium.org>
Subject: [PATCH 07/12] interconnect: qcom: Use the standard aggregate function
Date: Fri, 17 Jan 2020 11:58:11 +0200	[thread overview]
Message-ID: <20200117095816.23575-8-georgi.djakov@linaro.org> (raw)
In-Reply-To: <20200117095816.23575-1-georgi.djakov@linaro.org>

Now we have a common function for standard aggregation, so let's use it,
instead of duplicating the code.

Reviewed-by: Brian Masney <masneyb@onstation.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Evan Green <evgreen@chromium.org>
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
---
 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;
 

  parent reply	other threads:[~2020-01-17  9:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17  9:58 [GIT PULL 00/12] interconnect changes for 5.6 Georgi Djakov
2020-01-17  9:58 ` [PATCH 01/12] interconnect: Add a common helper for removing all nodes Georgi Djakov
2020-01-17  9:58 ` [PATCH 02/12] interconnect: qcom: Use the new common helper for node removal Georgi Djakov
2020-01-17  9:58 ` [PATCH 03/12] interconnect: Move internal structs into a separate file Georgi Djakov
2020-01-17  9:58 ` [PATCH 04/12] interconnect: Add a name to struct icc_path Georgi Djakov
2020-01-17  9:58 ` [PATCH 05/12] interconnect: Add basic tracepoints Georgi Djakov
2020-01-17  9:58 ` [PATCH 06/12] interconnect: Add a common standard aggregate function Georgi Djakov
2020-01-17  9:58 ` Georgi Djakov [this message]
2020-01-17  9:58 ` [PATCH 08/12] interconnect: Add interconnect_graph file to debugfs Georgi Djakov
2020-01-17  9:58 ` [PATCH 09/12] interconnect: Print the tag in the debugfs summary Georgi Djakov
2020-01-17  9:58 ` [PATCH 10/12] interconnect: Check for valid path in icc_set_bw() Georgi Djakov
2020-01-17  9:58 ` [PATCH 11/12] dt-bindings: interconnect: Add Qualcomm MSM8916 DT bindings Georgi Djakov
2020-01-17  9:58 ` [PATCH 12/12] interconnect: qcom: Add MSM8916 interconnect provider driver Georgi Djakov
2020-01-22  9:05 ` [GIT PULL 00/12] interconnect changes for 5.6 Greg KH
2020-01-22  9:15   ` Georgi Djakov
2020-01-22  9:07 ` Georgi Djakov
2020-01-22  9:15   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200117095816.23575-8-georgi.djakov@linaro.org \
    --to=georgi.djakov@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=evgreen@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=masneyb@onstation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.