Commit 7123f883 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Georgi Djakov
Browse files

interconnect: qcom: constify qcom_icc_bcm pointers



Pointers to struct qcom_icc_bcm are not modified, so they can be made
const for safety.  The contents of struct qcom_icc_bcm must stay
non-const.

Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220412102623.227607-3-krzysztof.kozlowski@linaro.org


Signed-off-by: default avatarGeorgi Djakov <djakov@kernel.org>
parent 2ccf33c0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
struct qcom_icc_provider {
	struct icc_provider provider;
	struct device *dev;
	struct qcom_icc_bcm **bcms;
	struct qcom_icc_bcm * const *bcms;
	size_t num_bcms;
	struct bcm_voter *voter;
};
@@ -114,7 +114,7 @@ struct qcom_icc_fabric {
struct qcom_icc_desc {
	struct qcom_icc_node * const *nodes;
	size_t num_nodes;
	struct qcom_icc_bcm **bcms;
	struct qcom_icc_bcm * const *bcms;
	size_t num_bcms;
};

+11 −11
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ DEFINE_QBCM(bcm_sn7, "SN7", false, &qnm_aggre1_noc);
DEFINE_QBCM(bcm_sn9, "SN9", false, &qnm_aggre2_noc);
DEFINE_QBCM(bcm_sn12, "SN12", false, &qnm_gemnoc);

static struct qcom_icc_bcm *aggre1_noc_bcms[] = {
static struct qcom_icc_bcm * const aggre1_noc_bcms[] = {
	&bcm_cn1,
};

@@ -203,7 +203,7 @@ static const struct qcom_icc_desc sc7180_aggre1_noc = {
	.num_bcms = ARRAY_SIZE(aggre1_noc_bcms),
};

static struct qcom_icc_bcm *aggre2_noc_bcms[] = {
static struct qcom_icc_bcm * const aggre2_noc_bcms[] = {
	&bcm_ce0,
};

@@ -226,7 +226,7 @@ static const struct qcom_icc_desc sc7180_aggre2_noc = {
	.num_bcms = ARRAY_SIZE(aggre2_noc_bcms),
};

static struct qcom_icc_bcm *camnoc_virt_bcms[] = {
static struct qcom_icc_bcm * const camnoc_virt_bcms[] = {
	&bcm_mm1,
};

@@ -244,7 +244,7 @@ static const struct qcom_icc_desc sc7180_camnoc_virt = {
	.num_bcms = ARRAY_SIZE(camnoc_virt_bcms),
};

static struct qcom_icc_bcm *compute_noc_bcms[] = {
static struct qcom_icc_bcm * const compute_noc_bcms[] = {
	&bcm_co0,
	&bcm_co2,
	&bcm_co3,
@@ -263,7 +263,7 @@ static const struct qcom_icc_desc sc7180_compute_noc = {
	.num_bcms = ARRAY_SIZE(compute_noc_bcms),
};

static struct qcom_icc_bcm *config_noc_bcms[] = {
static struct qcom_icc_bcm * const config_noc_bcms[] = {
	&bcm_cn0,
	&bcm_cn1,
};
@@ -342,7 +342,7 @@ static const struct qcom_icc_desc sc7180_dc_noc = {
	.num_nodes = ARRAY_SIZE(dc_noc_nodes),
};

static struct qcom_icc_bcm *gem_noc_bcms[] = {
static struct qcom_icc_bcm * const gem_noc_bcms[] = {
	&bcm_sh0,
	&bcm_sh2,
	&bcm_sh3,
@@ -372,7 +372,7 @@ static const struct qcom_icc_desc sc7180_gem_noc = {
	.num_bcms = ARRAY_SIZE(gem_noc_bcms),
};

static struct qcom_icc_bcm *ipa_virt_bcms[] = {
static struct qcom_icc_bcm * const ipa_virt_bcms[] = {
	&bcm_ip0,
};

@@ -388,7 +388,7 @@ static const struct qcom_icc_desc sc7180_ipa_virt = {
	.num_bcms = ARRAY_SIZE(ipa_virt_bcms),
};

static struct qcom_icc_bcm *mc_virt_bcms[] = {
static struct qcom_icc_bcm * const mc_virt_bcms[] = {
	&bcm_acv,
	&bcm_mc0,
};
@@ -405,7 +405,7 @@ static const struct qcom_icc_desc sc7180_mc_virt = {
	.num_bcms = ARRAY_SIZE(mc_virt_bcms),
};

static struct qcom_icc_bcm *mmss_noc_bcms[] = {
static struct qcom_icc_bcm * const mmss_noc_bcms[] = {
	&bcm_mm0,
	&bcm_mm1,
	&bcm_mm2,
@@ -451,7 +451,7 @@ static const struct qcom_icc_desc sc7180_npu_noc = {
	.num_nodes = ARRAY_SIZE(npu_noc_nodes),
};

static struct qcom_icc_bcm *qup_virt_bcms[] = {
static struct qcom_icc_bcm * const qup_virt_bcms[] = {
	&bcm_qup0,
};

@@ -469,7 +469,7 @@ static const struct qcom_icc_desc sc7180_qup_virt = {
	.num_bcms = ARRAY_SIZE(qup_virt_bcms),
};

static struct qcom_icc_bcm *system_noc_bcms[] = {
static struct qcom_icc_bcm * const system_noc_bcms[] = {
	&bcm_sn0,
	&bcm_sn1,
	&bcm_sn2,
+12 −12
Original line number Diff line number Diff line
@@ -1476,7 +1476,7 @@ static struct qcom_icc_bcm bcm_sn14 = {
	.nodes = { &qns_pcie_mem_noc },
};

static struct qcom_icc_bcm *aggre1_noc_bcms[] = {
static struct qcom_icc_bcm * const aggre1_noc_bcms[] = {
	&bcm_sn5,
	&bcm_sn6,
	&bcm_sn14,
@@ -1507,7 +1507,7 @@ static const struct qcom_icc_desc sc7280_aggre1_noc = {
	.num_bcms = ARRAY_SIZE(aggre1_noc_bcms),
};

static struct qcom_icc_bcm *aggre2_noc_bcms[] = {
static struct qcom_icc_bcm * const aggre2_noc_bcms[] = {
	&bcm_ce0,
};

@@ -1529,7 +1529,7 @@ static const struct qcom_icc_desc sc7280_aggre2_noc = {
	.num_bcms = ARRAY_SIZE(aggre2_noc_bcms),
};

static struct qcom_icc_bcm *clk_virt_bcms[] = {
static struct qcom_icc_bcm * const clk_virt_bcms[] = {
	&bcm_qup0,
	&bcm_qup1,
};
@@ -1548,7 +1548,7 @@ static const struct qcom_icc_desc sc7280_clk_virt = {
	.num_bcms = ARRAY_SIZE(clk_virt_bcms),
};

static struct qcom_icc_bcm *cnoc2_bcms[] = {
static struct qcom_icc_bcm * const cnoc2_bcms[] = {
	&bcm_cn1,
	&bcm_cn2,
};
@@ -1610,7 +1610,7 @@ static const struct qcom_icc_desc sc7280_cnoc2 = {
	.num_bcms = ARRAY_SIZE(cnoc2_bcms),
};

static struct qcom_icc_bcm *cnoc3_bcms[] = {
static struct qcom_icc_bcm * const cnoc3_bcms[] = {
	&bcm_cn0,
	&bcm_cn1,
	&bcm_sn3,
@@ -1642,7 +1642,7 @@ static const struct qcom_icc_desc sc7280_cnoc3 = {
	.num_bcms = ARRAY_SIZE(cnoc3_bcms),
};

static struct qcom_icc_bcm *dc_noc_bcms[] = {
static struct qcom_icc_bcm * const dc_noc_bcms[] = {
};

static struct qcom_icc_node * const dc_noc_nodes[] = {
@@ -1658,7 +1658,7 @@ static const struct qcom_icc_desc sc7280_dc_noc = {
	.num_bcms = ARRAY_SIZE(dc_noc_bcms),
};

static struct qcom_icc_bcm *gem_noc_bcms[] = {
static struct qcom_icc_bcm * const gem_noc_bcms[] = {
	&bcm_sh0,
	&bcm_sh2,
	&bcm_sh3,
@@ -1694,7 +1694,7 @@ static const struct qcom_icc_desc sc7280_gem_noc = {
	.num_bcms = ARRAY_SIZE(gem_noc_bcms),
};

static struct qcom_icc_bcm *lpass_ag_noc_bcms[] = {
static struct qcom_icc_bcm * const lpass_ag_noc_bcms[] = {
};

static struct qcom_icc_node * const lpass_ag_noc_nodes[] = {
@@ -1714,7 +1714,7 @@ static const struct qcom_icc_desc sc7280_lpass_ag_noc = {
	.num_bcms = ARRAY_SIZE(lpass_ag_noc_bcms),
};

static struct qcom_icc_bcm *mc_virt_bcms[] = {
static struct qcom_icc_bcm * const mc_virt_bcms[] = {
	&bcm_acv,
	&bcm_mc0,
};
@@ -1731,7 +1731,7 @@ static const struct qcom_icc_desc sc7280_mc_virt = {
	.num_bcms = ARRAY_SIZE(mc_virt_bcms),
};

static struct qcom_icc_bcm *mmss_noc_bcms[] = {
static struct qcom_icc_bcm * const mmss_noc_bcms[] = {
	&bcm_mm0,
	&bcm_mm1,
	&bcm_mm4,
@@ -1758,7 +1758,7 @@ static const struct qcom_icc_desc sc7280_mmss_noc = {
	.num_bcms = ARRAY_SIZE(mmss_noc_bcms),
};

static struct qcom_icc_bcm *nsp_noc_bcms[] = {
static struct qcom_icc_bcm * const nsp_noc_bcms[] = {
	&bcm_co0,
	&bcm_co3,
};
@@ -1777,7 +1777,7 @@ static const struct qcom_icc_desc sc7280_nsp_noc = {
	.num_bcms = ARRAY_SIZE(nsp_noc_bcms),
};

static struct qcom_icc_bcm *system_noc_bcms[] = {
static struct qcom_icc_bcm * const system_noc_bcms[] = {
	&bcm_sn0,
	&bcm_sn2,
	&bcm_sn7,
+10 −10
Original line number Diff line number Diff line
@@ -191,53 +191,53 @@ DEFINE_QBCM(bcm_sn11, "SN11", false, &mas_qnm_aggre2_noc);
DEFINE_QBCM(bcm_sn14, "SN14", false, &slv_qns_pcie_mem_noc);
DEFINE_QBCM(bcm_sn15, "SN15", false, &mas_qnm_gemnoc);

static struct qcom_icc_bcm *aggre1_noc_bcms[] = {
static struct qcom_icc_bcm * const aggre1_noc_bcms[] = {
	&bcm_sn3,
	&bcm_ce0,
	&bcm_qup0,
};

static struct qcom_icc_bcm *aggre2_noc_bcms[] = {
static struct qcom_icc_bcm * const aggre2_noc_bcms[] = {
	&bcm_sn14,
	&bcm_ce0,
	&bcm_qup0,
};

static struct qcom_icc_bcm *camnoc_virt_bcms[] = {
static struct qcom_icc_bcm * const camnoc_virt_bcms[] = {
	&bcm_mm1,
};

static struct qcom_icc_bcm *compute_noc_bcms[] = {
static struct qcom_icc_bcm * const compute_noc_bcms[] = {
	&bcm_co0,
	&bcm_co2,
};

static struct qcom_icc_bcm *config_noc_bcms[] = {
static struct qcom_icc_bcm * const config_noc_bcms[] = {
	&bcm_cn0,
};

static struct qcom_icc_bcm *gem_noc_bcms[] = {
static struct qcom_icc_bcm * const gem_noc_bcms[] = {
	&bcm_sh0,
	&bcm_sh2,
	&bcm_sh3,
};

static struct qcom_icc_bcm *ipa_virt_bcms[] = {
static struct qcom_icc_bcm * const ipa_virt_bcms[] = {
	&bcm_ip0,
};

static struct qcom_icc_bcm *mc_virt_bcms[] = {
static struct qcom_icc_bcm * const mc_virt_bcms[] = {
	&bcm_mc0,
	&bcm_acv,
};

static struct qcom_icc_bcm *mmss_noc_bcms[] = {
static struct qcom_icc_bcm * const mmss_noc_bcms[] = {
	&bcm_mm0,
	&bcm_mm1,
	&bcm_mm2,
};

static struct qcom_icc_bcm *system_noc_bcms[] = {
static struct qcom_icc_bcm * const system_noc_bcms[] = {
	&bcm_sn0,
	&bcm_sn1,
	&bcm_sn2,
+8 −8
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ DEFINE_QBCM(bcm_sn12, "SN12", false, &qnm_gladiator_sodv, &xm_gic);
DEFINE_QBCM(bcm_sn14, "SN14", false, &qnm_pcie_anoc);
DEFINE_QBCM(bcm_sn15, "SN15", false, &qnm_memnoc);

static struct qcom_icc_bcm *aggre1_noc_bcms[] = {
static struct qcom_icc_bcm * const aggre1_noc_bcms[] = {
	&bcm_sn9,
	&bcm_qup0,
};
@@ -201,7 +201,7 @@ static const struct qcom_icc_desc sdm845_aggre1_noc = {
	.num_bcms = ARRAY_SIZE(aggre1_noc_bcms),
};

static struct qcom_icc_bcm *aggre2_noc_bcms[] = {
static struct qcom_icc_bcm * const aggre2_noc_bcms[] = {
	&bcm_ce0,
	&bcm_sn11,
	&bcm_qup0,
@@ -230,7 +230,7 @@ static const struct qcom_icc_desc sdm845_aggre2_noc = {
	.num_bcms = ARRAY_SIZE(aggre2_noc_bcms),
};

static struct qcom_icc_bcm *config_noc_bcms[] = {
static struct qcom_icc_bcm * const config_noc_bcms[] = {
	&bcm_cn0,
};

@@ -291,7 +291,7 @@ static const struct qcom_icc_desc sdm845_config_noc = {
	.num_bcms = ARRAY_SIZE(config_noc_bcms),
};

static struct qcom_icc_bcm *dc_noc_bcms[] = {
static struct qcom_icc_bcm * const dc_noc_bcms[] = {
};

static struct qcom_icc_node * const dc_noc_nodes[] = {
@@ -307,7 +307,7 @@ static const struct qcom_icc_desc sdm845_dc_noc = {
	.num_bcms = ARRAY_SIZE(dc_noc_bcms),
};

static struct qcom_icc_bcm *gladiator_noc_bcms[] = {
static struct qcom_icc_bcm * const gladiator_noc_bcms[] = {
};

static struct qcom_icc_node * const gladiator_noc_nodes[] = {
@@ -325,7 +325,7 @@ static const struct qcom_icc_desc sdm845_gladiator_noc = {
	.num_bcms = ARRAY_SIZE(gladiator_noc_bcms),
};

static struct qcom_icc_bcm *mem_noc_bcms[] = {
static struct qcom_icc_bcm * const mem_noc_bcms[] = {
	&bcm_mc0,
	&bcm_acv,
	&bcm_sh0,
@@ -360,7 +360,7 @@ static const struct qcom_icc_desc sdm845_mem_noc = {
	.num_bcms = ARRAY_SIZE(mem_noc_bcms),
};

static struct qcom_icc_bcm *mmss_noc_bcms[] = {
static struct qcom_icc_bcm * const mmss_noc_bcms[] = {
	&bcm_mm0,
	&bcm_mm1,
	&bcm_mm2,
@@ -394,7 +394,7 @@ static const struct qcom_icc_desc sdm845_mmss_noc = {
	.num_bcms = ARRAY_SIZE(mmss_noc_bcms),
};

static struct qcom_icc_bcm *system_noc_bcms[] = {
static struct qcom_icc_bcm * const system_noc_bcms[] = {
	&bcm_sn0,
	&bcm_sn1,
	&bcm_sn2,
Loading