mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ben Skeggs <bskeggs@redhat.com>,
	Arushi Singhal <arushisinghal19971997@gmail.com>,
	David Airlie <airlied@linux.ie>,
	nouveau <nouveau@lists.freedesktop.org>,
	linux-kernel@vger.kernel.org,
	dri-devel <dri-devel@lists.freedesktop.org>,
	daniel.vetter@intel.com
Subject: Re: [PATCH v2 2/2] gpu: drm: nouveau: Use list_{next/prev}_entry instead of list_entry
Date: Mon, 26 Mar 2018 16:11:50 +0200	[thread overview]
Message-ID: <20180326141150.GU14155@phenom.ffwll.local> (raw)
In-Reply-To: <152206821005.4115.12768359647232399397@mail.alporthouse.com>

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

      reply	other threads:[~2018-03-26 14:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180326141150.GU14155@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@linux.ie \
    --cc=arushisinghal19971997@gmail.com \
    --cc=bskeggs@redhat.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome