LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v2 0/2] drm: Replace list_entry
@ 2018-03-25 18:01 Arushi Singhal
2018-03-25 18:01 ` [PATCH v2 1/2] gpu: drm/lease:: Use list_{next/prev}_entry instead of list_entry Arushi Singhal
2018-03-25 18:01 ` [PATCH v2 2/2] gpu: drm: nouveau: " Arushi Singhal
0 siblings, 2 replies; 7+ messages in thread
From: Arushi Singhal @ 2018-03-25 18:01 UTC (permalink / raw)
To: linux-kernel
Cc: dri-devel, airlied, seanpaul, gustavo, daniel.vetter, nouveau,
bskeggs, Arushi Singhal
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(-)
--
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/2] gpu: drm/lease:: Use list_{next/prev}_entry instead of list_entry
2018-03-25 18:01 [PATCH v2 0/2] drm: Replace list_entry Arushi Singhal
@ 2018-03-25 18:01 ` Arushi Singhal
2018-03-26 8:37 ` [Nouveau] " Daniel Vetter
2018-03-25 18:01 ` [PATCH v2 2/2] gpu: drm: nouveau: " Arushi Singhal
1 sibling, 1 reply; 7+ messages in thread
From: Arushi Singhal @ 2018-03-25 18:01 UTC (permalink / raw)
To: linux-kernel
Cc: dri-devel, airlied, seanpaul, gustavo, daniel.vetter, nouveau,
bskeggs, Arushi Singhal
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.
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
drivers/gpu/drm/drm_lease.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 1402c0e..4dcfb5f 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -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);
}
}
}
--
2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 2/2] gpu: drm: nouveau: Use list_{next/prev}_entry instead of list_entry
2018-03-25 18:01 [PATCH v2 0/2] drm: Replace list_entry Arushi Singhal
2018-03-25 18:01 ` [PATCH v2 1/2] gpu: drm/lease:: Use list_{next/prev}_entry instead of list_entry Arushi Singhal
@ 2018-03-25 18:01 ` Arushi Singhal
2018-03-26 12:34 ` Ben Skeggs
1 sibling, 1 reply; 7+ messages in thread
From: Arushi Singhal @ 2018-03-25 18:01 UTC (permalink / raw)
To: linux-kernel
Cc: dri-devel, airlied, seanpaul, gustavo, daniel.vetter, nouveau,
bskeggs, Arushi Singhal
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.
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
index e4c8d31..81c3567 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
@@ -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;
}
--
2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Nouveau] [PATCH v2 1/2] gpu: drm/lease:: Use list_{next/prev}_entry instead of list_entry
2018-03-25 18:01 ` [PATCH v2 1/2] gpu: drm/lease:: Use list_{next/prev}_entry instead of list_entry Arushi Singhal
@ 2018-03-26 8:37 ` Daniel Vetter
0 siblings, 0 replies; 7+ messages in thread
From: Daniel Vetter @ 2018-03-26 8:37 UTC (permalink / raw)
To: Arushi Singhal
Cc: linux-kernel, airlied, gustavo, dri-devel, seanpaul, bskeggs,
nouveau, daniel.vetter
On Sun, Mar 25, 2018 at 11:31:32PM +0530, Arushi Singhal wrote:
> 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.
>
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Applied to drm-misc-next, thanks for your patch. I'll leave the other one
to nouveau folks.
-Daniel
> ---
> drivers/gpu/drm/drm_lease.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
> index 1402c0e..4dcfb5f 100644
> --- a/drivers/gpu/drm/drm_lease.c
> +++ b/drivers/gpu/drm/drm_lease.c
> @@ -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);
> }
> }
> }
> --
> 2.7.4
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/2] gpu: drm: nouveau: Use list_{next/prev}_entry instead of list_entry
2018-03-25 18:01 ` [PATCH v2 2/2] gpu: drm: nouveau: " Arushi Singhal
@ 2018-03-26 12:34 ` Ben Skeggs
2018-03-26 12:43 ` Chris Wilson
0 siblings, 1 reply; 7+ messages in thread
From: Ben Skeggs @ 2018-03-26 12:34 UTC (permalink / raw)
To: Arushi Singhal
Cc: linux-kernel, dri-devel, David Airlie, seanpaul, gustavo,
daniel.vetter, nouveau
On Mon, Mar 26, 2018 at 4:01 AM, Arushi Singhal
<arushisinghal19971997@gmail.com> wrote:
> 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.
>
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Acked-by: Ben Skeggs <bskeggs@redhat.com>
> ---
> drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
> index e4c8d31..81c3567 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
> @@ -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;
> }
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/2] gpu: drm: nouveau: Use list_{next/prev}_entry instead of list_entry
2018-03-26 12:34 ` Ben Skeggs
@ 2018-03-26 12:43 ` Chris Wilson
2018-03-26 14:11 ` Daniel Vetter
0 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2018-03-26 12:43 UTC (permalink / raw)
To: Ben Skeggs, Arushi Singhal
Cc: David Airlie, linux-kernel, dri-devel, nouveau, daniel.vetter
Quoting Ben Skeggs (2018-03-26 13:34:54)
> On Mon, Mar 26, 2018 at 4:01 AM, Arushi Singhal
> <arushisinghal19971997@gmail.com> wrote:
> > 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.
> >
> > Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> Acked-by: Ben Skeggs <bskeggs@redhat.com>
>
> > ---
> > drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
> > index e4c8d31..81c3567 100644
> > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
> > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
> > @@ -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)) {
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)
> > if (nvkm_cstate_valid(clk, cstate, max_volt, clk->temp))
> > break;
> > }
> > --
> > 2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/2] gpu: drm: nouveau: Use list_{next/prev}_entry instead of list_entry
2018-03-26 12:43 ` Chris Wilson
@ 2018-03-26 14:11 ` Daniel Vetter
0 siblings, 0 replies; 7+ messages in thread
From: Daniel Vetter @ 2018-03-26 14:11 UTC (permalink / raw)
To: Chris Wilson
Cc: Ben Skeggs, Arushi Singhal, David Airlie, nouveau, linux-kernel,
dri-devel, daniel.vetter
On Mon, Mar 26, 2018 at 01:43:30PM +0100, Chris Wilson wrote:
> Quoting Ben Skeggs (2018-03-26 13:34:54)
> > On Mon, Mar 26, 2018 at 4:01 AM, Arushi Singhal
> > <arushisinghal19971997@gmail.com> wrote:
> > > 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.
> > >
> > > Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> > Acked-by: Ben Skeggs <bskeggs@redhat.com>
Applied, thanks for ack&patch.
> >
> > > ---
> > > drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
> > > index e4c8d31..81c3567 100644
> > > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
> > > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
> > > @@ -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)) {
>
> 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
>
> > > if (nvkm_cstate_valid(clk, cstate, max_volt, clk->temp))
> > > break;
> > > }
> > > --
> > > 2.7.4
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-03-26 14:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-25 18:01 [PATCH v2 0/2] drm: Replace list_entry Arushi Singhal
2018-03-25 18:01 ` [PATCH v2 1/2] gpu: drm/lease:: Use list_{next/prev}_entry instead of list_entry Arushi Singhal
2018-03-26 8:37 ` [Nouveau] " Daniel Vetter
2018-03-25 18:01 ` [PATCH v2 2/2] gpu: drm: nouveau: " Arushi Singhal
2018-03-26 12:34 ` Ben Skeggs
2018-03-26 12:43 ` Chris Wilson
2018-03-26 14:11 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).