[Nouveau] [PATCH 09/32] clk: Rename nvkm_pstate.list to cstates

Karol Herbst karolherbst at gmail.com
Fri Nov 17 00:04:13 UTC 2017


From: Karol Herbst <kherbst at redhat.com>

It was always confusing that the list was called list.

Signed-off-by: Karol Herbst <kherbst at redhat.com>
---
 drm/nouveau/include/nvkm/subdev/clk.h |  2 +-
 drm/nouveau/nvkm/engine/device/ctrl.c |  2 +-
 drm/nouveau/nvkm/subdev/clk/base.c    | 18 +++++++++---------
 drm/nouveau/nvkm/subdev/clk/gk20a.c   |  2 +-
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drm/nouveau/include/nvkm/subdev/clk.h b/drm/nouveau/include/nvkm/subdev/clk.h
index 2f326554..32f733c3 100644
--- a/drm/nouveau/include/nvkm/subdev/clk.h
+++ b/drm/nouveau/include/nvkm/subdev/clk.h
@@ -63,7 +63,7 @@ struct nvkm_cstate {
 
 struct nvkm_pstate {
 	struct list_head head;
-	struct list_head list; /* c-states */
+	struct list_head cstates; /* c-states */
 	struct nvkm_cstate base;
 	u8 id;
 	u8 fanspeed;
diff --git a/drm/nouveau/nvkm/engine/device/ctrl.c b/drm/nouveau/nvkm/engine/device/ctrl.c
index 279e442e..1202e656 100644
--- a/drm/nouveau/nvkm/engine/device/ctrl.c
+++ b/drm/nouveau/nvkm/engine/device/ctrl.c
@@ -110,7 +110,7 @@ nvkm_control_mthd_pstate_attr(struct nvkm_control *ctrl, void *data, u32 size)
 
 		lo = pstate->base.domain[domain->name];
 		hi = lo;
-		list_for_each_entry(cstate, &pstate->list, head) {
+		list_for_each_entry(cstate, &pstate->cstates, head) {
 			lo = min(lo, cstate->domain[domain->name]);
 			hi = max(hi, cstate->domain[domain->name]);
 		}
diff --git a/drm/nouveau/nvkm/subdev/clk/base.c b/drm/nouveau/nvkm/subdev/clk/base.c
index ef6ad783..b268b8fd 100644
--- a/drm/nouveau/nvkm/subdev/clk/base.c
+++ b/drm/nouveau/nvkm/subdev/clk/base.c
@@ -134,7 +134,7 @@ nvkm_cstate_find_best(struct nvkm_clk *clk, struct nvkm_pstate *pstate,
 		max_volt = min(max_volt,
 			       nvkm_volt_map(volt, volt->max2_id, clk->temp));
 
-	for (cstate = start; &cstate->head != &pstate->list;
+	for (cstate = start; &cstate->head != &pstate->cstates;
 	     cstate = list_entry(cstate->head.prev, typeof(*cstate), head)) {
 		if (nvkm_cstate_valid(clk, cstate, max_volt, clk->temp))
 			break;
@@ -148,9 +148,9 @@ nvkm_cstate_get(struct nvkm_clk *clk, struct nvkm_pstate *pstate, int cstate_id)
 {
 	struct nvkm_cstate *cstate;
 	if (cstate_id == NVKM_CLK_CSTATE_AUTO)
-		return list_last_entry(&pstate->list, typeof(*cstate), head);
+		return list_last_entry(&pstate->cstates, typeof(*cstate), head);
 	else {
-		list_for_each_entry(cstate, &pstate->list, head) {
+		list_for_each_entry(cstate, &pstate->cstates, head) {
 			if (cstate->id == cstate_id)
 				return cstate;
 		}
@@ -169,7 +169,7 @@ nvkm_cstate_prog(struct nvkm_clk *clk, struct nvkm_pstate *pstate,
 	struct nvkm_cstate *cstate;
 	int ret;
 
-	if (!list_empty(&pstate->list)) {
+	if (!list_empty(&pstate->cstates)) {
 		cstate = nvkm_cstate_get(clk, pstate, cstate_id);
 		cstate = nvkm_cstate_find_best(clk, pstate, cstate);
 	} else {
@@ -257,7 +257,7 @@ nvkm_cstate_new(struct nvkm_clk *clk, int idx, struct nvkm_pstate *pstate)
 		domain++;
 	}
 
-	list_add(&cstate->head, &pstate->list);
+	list_add(&cstate->head, &pstate->cstates);
 	return 0;
 }
 
@@ -364,7 +364,7 @@ nvkm_pstate_info(struct nvkm_clk *clk, struct nvkm_pstate *pstate)
 			continue;
 
 		nvkm_debug(subdev, "%02x: %10d KHz\n", clock->name, lo);
-		list_for_each_entry(cstate, &pstate->list, head) {
+		list_for_each_entry(cstate, &pstate->cstates, head) {
 			u32 freq = cstate->domain[clock->name];
 			lo = min(lo, freq);
 			hi = max(hi, freq);
@@ -392,7 +392,7 @@ nvkm_pstate_del(struct nvkm_pstate *pstate)
 {
 	struct nvkm_cstate *cstate, *temp;
 
-	list_for_each_entry_safe(cstate, temp, &pstate->list, head) {
+	list_for_each_entry_safe(cstate, temp, &pstate->cstates, head) {
 		nvkm_cstate_del(cstate);
 	}
 
@@ -423,7 +423,7 @@ nvkm_pstate_new(struct nvkm_clk *clk, int idx)
 	if (!pstate)
 		return -ENOMEM;
 
-	INIT_LIST_HEAD(&pstate->list);
+	INIT_LIST_HEAD(&pstate->cstates);
 
 	pstate->id = perfE.pstate_id;
 	pstate->fanspeed = perfE.fanspeed;
@@ -598,7 +598,7 @@ nvkm_clk_init(struct nvkm_subdev *subdev)
 	int ret;
 
 	memset(&clk->bstate, 0x00, sizeof(clk->bstate));
-	INIT_LIST_HEAD(&clk->bstate.list);
+	INIT_LIST_HEAD(&clk->bstate.cstates);
 	clk->bstate.id = 0xff;
 
 	while (clock->name != nv_clk_src_max) {
diff --git a/drm/nouveau/nvkm/subdev/clk/gk20a.c b/drm/nouveau/nvkm/subdev/clk/gk20a.c
index dc98ad62..07e5b00b 100644
--- a/drm/nouveau/nvkm/subdev/clk/gk20a.c
+++ b/drm/nouveau/nvkm/subdev/clk/gk20a.c
@@ -621,7 +621,7 @@ gk20a_clk_ctor(struct nvkm_device *device, int index,
 
 	/* Finish initializing the pstates */
 	for (i = 0; i < func->nr_pstates; i++) {
-		INIT_LIST_HEAD(&func->pstates[i].list);
+		INIT_LIST_HEAD(&func->pstates[i].cstates);
 		func->pstates[i].id = i + 1;
 	}
 
-- 
2.15.0



More information about the Nouveau mailing list