drm: Replace list_entry
Subsystems (3)
v2 cover drm: Replace list_entry
Replace list_entry with list_{next/prev}_entry.
Arushi Singhal (2):
gpu: drm/lease:: Use list_{next/prev}_entry instead of list_entry
gpu: drm: nouveau: Use list_{next/prev}_entry instead of list_entry
drivers/gpu/drm/drm_lease.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 10 lines
changes in v2 *All the maintainers are added. *More accurate coccinelle script is used for this patch than the one used in previous version. 2.7.4 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
PATCH v2 1/2 gpu: drm/lease:: Use list_{next/prev}_entry instead of list_entry
It's better to use list_entry instead of list_{next/prev}_entry as it makes the code more clear to read.
This patch replace list_entry with list_{next/prev}_entry.
--- drivers/gpu/drm/drm_lease.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_lease.c +1 -1
@@ -340,7 +340,7 @@ static void _drm_lease_revoke(struct drm_master *top)break ;/* Over */ - master = list_entry(master->lessee_list.next, struct drm_master, lessee_list); + master =list_next_entry (master, lessee_list); } } }
Signature · 6 lines
2.7.4 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
Daniel Vetter
AppliedRe: [Nouveau] [PATCH v2 1/2] gpu: drm/lease:: Use list_{next/prev}_entry instead of list_entry
Quoted 5 lines · Arushi Singhal
It's better to use
list_entryinstead of list_{next/prev}_entry as it makes the code more clear to read.
This patch replacelist_entrywith list_{next/prev}_entry.Signed-off-by Arushi Singhal <[email protected]>
Applied to drm-misc-next, thanks for your patch. I'll leave the other one to nouveau folks.
-Daniel
Quoted 24 lines
--- drivers/gpu/drm/drm_lease.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_lease.c +1
-1@@ -340,7 +340,7 @@ static void _drm_lease_revoke(struct drm_master *top)break ;/* Over */ - master = list_entry(master->lessee_list.next, struct drm_master, lessee_list); + master =list_next_entry (master, lessee_list); } } }Signature · 6 lines
2.7.4 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
PATCH v2 2/2 gpu: drm: nouveau: Use list_{next/prev}_entry instead of list_entry
In reply to Arushi SinghalIt's better to use list_entry instead of list_{next/prev}_entry as it makes the code more clear to read.
This patch replace list_entry with list_{next/prev}_entry.
--- drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c +1 -1
@@ -134,7 +134,7 @@ nvkm_cstate_find_best(struct nvkm_clk *clk, struct nvkm_pstate *pstate, nvkm_volt_map(volt, volt->max2_id, clk->temp));for (cstate = start; &cstate->head != &pstate->list; - cstate =list_entry (cstate->head.prev,typeof (*cstate), head)) { + cstate =list_prev_entry (cstate, head)) {if (nvkm_cstate_valid (clk, cstate, max_volt, clk->temp))break ; }
Signature · 6 lines
2.7.4 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
Re: [PATCH v2 2/2] gpu: drm: nouveau: Use list_{next/prev}_entry instead of list_entry
Quoted 5 lines · Arushi Singhal
It's better to use
list_entryinstead of list_{next/prev}_entry as it makes the code more clear to read.
This patch replacelist_entrywith list_{next/prev}_entry.Signed-off-by Arushi Singhal <[email protected]>
Quoted 18 lines
--- drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c +1
-2@@ -134,7 +134,7 @@ nvkm_cstate_find_best(struct nvkm_clk *clk, struct nvkm_pstate *pstate, nvkm_volt_map(volt, volt->max2_id, clk->temp));for (cstate = start; &cstate->head != &pstate->list; - cstate =list_entry (cstate->head.prev,typeof (*cstate), head)) { + cstate =list_prev_entry (cstate, head)) {if (nvkm_cstate_valid (clk, cstate, max_volt, clk->temp))break ; } --
Quoted 2 lines
2.7.4
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
Re: [PATCH v2 2/2] gpu: drm: nouveau: Use list_{next/prev}_entry instead of list_entry
Quoting Ben Skeggs (2018-03-26 13:34:54)
Quoted 20 lines
Quoted 5 lines · Arushi Singhal
It's better to use
list_entryinstead of list_{next/prev}_entry as it makes the code more clear to read.
This patch replacelist_entrywith list_{next/prev}_entry.Signed-off-by Arushi Singhal <[email protected]>Acked-by Ben Skeggs <[email protected]>Quoted 11 lines
--- drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c +0
-0@@ -134,7 +134,7 @@ nvkm_cstate_find_best(struct nvkm_clk *clk, struct nvkm_pstate *pstate, nvkm_volt_map(volt, volt->max2_id, clk->temp));
Quoted 3 lines
drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c nvkm_cstate_find_best(struct nvkm_clk *clk, struct nvkm_pstate *pstate, · line 137
Quoted 3 lines
drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c +1
-1for (cstate = start; &cstate->head != &pstate->list; - cstate =list_entry (cstate->head.prev,typeof (*cstate), head)) { + cstate =list_prev_entry (cstate, head)) {
This loop could be written as:
cstate = start; /* cstate looks redundant here, just use start? */ list_for_each_entry_from_reverse(cstate, &pstate->list, head)
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c +0
-1if (nvkm_cstate_valid (clk, cstate, max_volt, clk->temp))break ; } --2.7.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Daniel Vetter
AppliedRe: [PATCH v2 2/2] gpu: drm: nouveau: Use list_{next/prev}_entry instead of list_entry
Quoted 9 lines · Chris Wilson
Quoting Ben Skeggs (2018-03-26 13:34:54)
Quoted 8 lines
Quoted 5 lines · Arushi Singhal
It's better to use
list_entryinstead of list_{next/prev}_entry as it makes the code more clear to read.
This patch replacelist_entrywith list_{next/prev}_entry.Signed-off-by Arushi Singhal <[email protected]>Acked-by Ben Skeggs <[email protected]>
Applied, thanks for ack&patch.
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
--- drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c +0
-0@@ -134,7 +134,7 @@ nvkm_cstate_find_best(struct nvkm_clk *clk, struct nvkm_pstate *pstate, nvkm_volt_map(volt, volt->max2_id, clk->temp));
Quoted 8 lines
Quoted 3 lines
drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c nvkm_cstate_find_best(struct nvkm_clk *clk, struct nvkm_pstate *pstate, · line 137
Quoted 3 lines
drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c +1
-1for (cstate = start; &cstate->head != &pstate->list; - cstate =list_entry (cstate->head.prev,typeof (*cstate), head)) { + cstate =list_prev_entry (cstate, head)) {This loop could be written as:
cstate = start; /* cstate looks redundant here, just use start? */ list_for_each_entry_from_reverse(cstate, &pstate->list, head)
Yeah, sounds like a good follow-up patch.
-Daniel
Quoted 10 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c +0
-1if (nvkm_cstate_valid (clk, cstate, max_volt, clk->temp))break ; } --2.7.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch