Having the .num_nodes as a separate struct field can provoke errors as
it is easy to omit it or to put an incorrect value into that field. Turn
.nodes into a NULL-terminated array, removing a need for a separate
.num_nodes field.
27 files changed, 541 insertions(+), 1119 deletions(-)
diff --git a/drivers/interconnect/qcom/bcm-voter.c b/drivers/interconnect/qcom/bcm-voter.c
index a2d437a05a11fa7325f944865c81a3ac7dbb203e..4fa960630d28f338f484794d271a5b52f3e698d3 100644
--- a/drivers/interconnect/qcom/bcm-voter.c
+++ b/drivers/interconnect/qcom/bcm-voter.c
@@ -68,7 +68,7 @@ static void bcm_aggregate_mask(struct qcom_icc_bcm *bcm)
bcm->vote_x[bucket] = 0;
bcm->vote_y[bucket] = 0;
- for (i = 0; i < bcm->num_nodes; i++) {
+ for (i = 0; bcm->nodes[i]; i++) {
node = bcm->nodes[i];
diff --git a/drivers/interconnect/qcom/icc-rpmh.h b/drivers/interconnect/qcom/icc-rpmh.h
index bd8d730249b1c9e5b37afbee485b9500a8028c2e..0018aa74187edcac9a0492c737771d957a133cc0 100644
--- a/drivers/interconnect/qcom/icc-rpmh.h
+++ b/drivers/interconnect/qcom/icc-rpmh.h
@@ -126,7 +126,6 @@ struct qcom_icc_node {
* communicating with RPMh
* @list: used to link to other bcms when compiling lists for commit
* @ws_list: used to keep track of bcms that may transition between wake/sleep
- * @num_nodes: total number of @num_nodes
* @nodes: list of qcom_icc_nodes that this BCM encapsulates
*/
struct qcom_icc_bcm {
@@ -142,7 +141,6 @@ struct qcom_icc_bcm {
struct bcm_db aux_data;
struct list_head list;
struct list_head ws_list;
- size_t num_nodes;