Skip to content

Commit b92c35e

Browse files
author
Georgi Djakov
committed
interconnect: qcom: Use the standard aggregate function
Now we have a common function for standard aggregation, so let's use it, instead of duplicating the code. Reviewed-by: Brian Masney <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Reviewed-by: Evan Green <[email protected]> Signed-off-by: Georgi Djakov <[email protected]>
1 parent 3172e4d commit b92c35e

File tree

2 files changed

+6
-24
lines changed

2 files changed

+6
-24
lines changed

drivers/interconnect/qcom/msm8974.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -550,15 +550,6 @@ static struct msm8974_icc_desc msm8974_snoc = {
550550
.num_nodes = ARRAY_SIZE(msm8974_snoc_nodes),
551551
};
552552

553-
static int msm8974_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,
554-
u32 peak_bw, u32 *agg_avg, u32 *agg_peak)
555-
{
556-
*agg_avg += avg_bw;
557-
*agg_peak = max(*agg_peak, peak_bw);
558-
559-
return 0;
560-
}
561-
562553
static void msm8974_icc_rpm_smd_send(struct device *dev, int rsc_type,
563554
char *name, int id, u64 val)
564555
{
@@ -603,8 +594,8 @@ static int msm8974_icc_set(struct icc_node *src, struct icc_node *dst)
603594
qp = to_msm8974_icc_provider(provider);
604595

605596
list_for_each_entry(n, &provider->nodes, node_list)
606-
msm8974_icc_aggregate(n, 0, n->avg_bw, n->peak_bw,
607-
&agg_avg, &agg_peak);
597+
provider->aggregate(n, 0, n->avg_bw, n->peak_bw,
598+
&agg_avg, &agg_peak);
608599

609600
sum_bw = icc_units_to_bps(agg_avg);
610601
max_peak_bw = icc_units_to_bps(agg_peak);
@@ -694,7 +685,7 @@ static int msm8974_icc_probe(struct platform_device *pdev)
694685
INIT_LIST_HEAD(&provider->nodes);
695686
provider->dev = dev;
696687
provider->set = msm8974_icc_set;
697-
provider->aggregate = msm8974_icc_aggregate;
688+
provider->aggregate = icc_std_aggregate;
698689
provider->xlate = of_icc_xlate_onecell;
699690
provider->data = data;
700691

drivers/interconnect/qcom/qcs404.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,6 @@ static struct qcom_icc_desc qcs404_snoc = {
327327
.num_nodes = ARRAY_SIZE(qcs404_snoc_nodes),
328328
};
329329

330-
static int qcom_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,
331-
u32 peak_bw, u32 *agg_avg, u32 *agg_peak)
332-
{
333-
*agg_avg += avg_bw;
334-
*agg_peak = max(*agg_peak, peak_bw);
335-
336-
return 0;
337-
}
338-
339330
static int qcom_icc_set(struct icc_node *src, struct icc_node *dst)
340331
{
341332
struct qcom_icc_provider *qp;
@@ -354,8 +345,8 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst)
354345
qp = to_qcom_provider(provider);
355346

356347
list_for_each_entry(n, &provider->nodes, node_list)
357-
qcom_icc_aggregate(n, 0, n->avg_bw, n->peak_bw,
358-
&agg_avg, &agg_peak);
348+
provider->aggregate(n, 0, n->avg_bw, n->peak_bw,
349+
&agg_avg, &agg_peak);
359350

360351
sum_bw = icc_units_to_bps(agg_avg);
361352
max_peak_bw = icc_units_to_bps(agg_peak);
@@ -456,7 +447,7 @@ static int qnoc_probe(struct platform_device *pdev)
456447
INIT_LIST_HEAD(&provider->nodes);
457448
provider->dev = dev;
458449
provider->set = qcom_icc_set;
459-
provider->aggregate = qcom_icc_aggregate;
450+
provider->aggregate = icc_std_aggregate;
460451
provider->xlate = of_icc_xlate_onecell;
461452
provider->data = data;
462453

0 commit comments

Comments
 (0)