All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: Wambui Karuga <wambui@karuga.xyz>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	airlied@linux.ie, daniel@ffwll.ch, sean@poorly.run,
	mripard@kernel.org, maarten.lankhorst@linux.intel.com,
	outreachy-kernel@googlegroups.com,
	Wambui Karuga <wambui.karugax@gmail.com>
Subject: Re: [Outreachy kernel] [PATCH] drm: remove unnecessary return variable
Date: Tue, 22 Oct 2019 11:19:25 +0200	[thread overview]
Message-ID: <20191022091925.GD11828@phenom.ffwll.local> (raw)
In-Reply-To: <alpine.DEB.2.21.1910192102410.5888@hadrien>

On Sat, Oct 19, 2019 at 09:04:31PM +0200, Julia Lawall wrote:
> 
> 
> On Sat, 19 Oct 2019, Wambui Karuga wrote:
> 
> > From: Wambui Karuga <wambui.karugax@gmail.com>
> >
> > Remove unnecessary variable `ret` in drm_dp_atomic_find_vcpi_slots()
> > only used to hold the function return value and have the function
> > return the value directly.
> 
> This patch applies for me, but with a huge offset.  What tree are you
> using?

For drm patches best practices is to base patches either on linux-next or
the drm-tip tree we have here:

https://cgit.freedesktop.org/drm-tip

drm moves quickly, so need to be on top of the latest version.

> Also, Greg won't apply this, because it's not targeting staging.  Is this
> for a specific outreachy project?

Yup it's for dri-devel, just applied it.

Thanks for the patch, nice cleanup!

Cheers, Daniel

> 
> julia
> 
> 
> > Issue found by coccinelle:
> > @@
> > local idexpression ret;
> > expression e;
> > @@
> >
> > -ret =
> > +return
> >      e;
> > -return ret;
> >
> > Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
> > ---
> >  drivers/gpu/drm/drm_dp_mst_topology.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
> > index 9cccc5e63309..b854a422a523 100644
> > --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> > @@ -3540,7 +3540,7 @@ int drm_dp_atomic_find_vcpi_slots(struct drm_atomic_state *state,
> >  {
> >  	struct drm_dp_mst_topology_state *topology_state;
> >  	struct drm_dp_vcpi_allocation *pos, *vcpi = NULL;
> > -	int prev_slots, req_slots, ret;
> > +	int prev_slots, req_slots;
> >
> >  	topology_state = drm_atomic_get_mst_topology_state(state, mgr);
> >  	if (IS_ERR(topology_state))
> > @@ -3587,8 +3587,7 @@ int drm_dp_atomic_find_vcpi_slots(struct drm_atomic_state *state,
> >  	}
> >  	vcpi->vcpi = req_slots;
> >
> > -	ret = req_slots;
> > -	return ret;
> > +	return req_slots;
> >  }
> >  EXPORT_SYMBOL(drm_dp_atomic_find_vcpi_slots);
> >
> > --
> > 2.23.0
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20191019071840.16877-1-wambui%40karuga.xyz.
> >

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


WARNING: multiple messages have this Message-ID (diff)
From: Daniel Vetter <daniel@ffwll.ch>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: airlied@linux.ie, Wambui Karuga <wambui@karuga.xyz>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	outreachy-kernel@googlegroups.com, sean@poorly.run,
	Wambui Karuga <wambui.karugax@gmail.com>
Subject: Re: [Outreachy kernel] [PATCH] drm: remove unnecessary return variable
Date: Tue, 22 Oct 2019 11:19:25 +0200	[thread overview]
Message-ID: <20191022091925.GD11828@phenom.ffwll.local> (raw)
In-Reply-To: <alpine.DEB.2.21.1910192102410.5888@hadrien>

On Sat, Oct 19, 2019 at 09:04:31PM +0200, Julia Lawall wrote:
> 
> 
> On Sat, 19 Oct 2019, Wambui Karuga wrote:
> 
> > From: Wambui Karuga <wambui.karugax@gmail.com>
> >
> > Remove unnecessary variable `ret` in drm_dp_atomic_find_vcpi_slots()
> > only used to hold the function return value and have the function
> > return the value directly.
> 
> This patch applies for me, but with a huge offset.  What tree are you
> using?

For drm patches best practices is to base patches either on linux-next or
the drm-tip tree we have here:

https://cgit.freedesktop.org/drm-tip

drm moves quickly, so need to be on top of the latest version.

> Also, Greg won't apply this, because it's not targeting staging.  Is this
> for a specific outreachy project?

Yup it's for dri-devel, just applied it.

Thanks for the patch, nice cleanup!

Cheers, Daniel

> 
> julia
> 
> 
> > Issue found by coccinelle:
> > @@
> > local idexpression ret;
> > expression e;
> > @@
> >
> > -ret =
> > +return
> >      e;
> > -return ret;
> >
> > Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
> > ---
> >  drivers/gpu/drm/drm_dp_mst_topology.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
> > index 9cccc5e63309..b854a422a523 100644
> > --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> > @@ -3540,7 +3540,7 @@ int drm_dp_atomic_find_vcpi_slots(struct drm_atomic_state *state,
> >  {
> >  	struct drm_dp_mst_topology_state *topology_state;
> >  	struct drm_dp_vcpi_allocation *pos, *vcpi = NULL;
> > -	int prev_slots, req_slots, ret;
> > +	int prev_slots, req_slots;
> >
> >  	topology_state = drm_atomic_get_mst_topology_state(state, mgr);
> >  	if (IS_ERR(topology_state))
> > @@ -3587,8 +3587,7 @@ int drm_dp_atomic_find_vcpi_slots(struct drm_atomic_state *state,
> >  	}
> >  	vcpi->vcpi = req_slots;
> >
> > -	ret = req_slots;
> > -	return ret;
> > +	return req_slots;
> >  }
> >  EXPORT_SYMBOL(drm_dp_atomic_find_vcpi_slots);
> >
> > --
> > 2.23.0
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20191019071840.16877-1-wambui%40karuga.xyz.
> >

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2019-10-22  9:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-19  7:18 [PATCH] drm: remove unnecessary return variable Wambui Karuga
2019-10-19 19:04 ` [Outreachy kernel] " Julia Lawall
2019-10-20  8:42   ` Wambui Karuga
2019-10-22  9:19   ` Daniel Vetter [this message]
2019-10-22  9:19     ` Daniel Vetter

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=20191022091925.GD11828@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=sean@poorly.run \
    --cc=wambui.karugax@gmail.com \
    --cc=wambui@karuga.xyz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.