[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1910192102410.5888@hadrien>
Date: Sat, 19 Oct 2019 21:04:31 +0200 (CEST)
From: Julia Lawall <julia.lawall@...6.fr>
To: Wambui Karuga <wambui@...uga.xyz>
cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
airlied@...ux.ie, daniel@...ll.ch, sean@...rly.run,
mripard@...nel.org, maarten.lankhorst@...ux.intel.com,
outreachy-kernel@...glegroups.com,
Wambui Karuga <wambui.karugax@...il.com>
Subject: Re: [Outreachy kernel] [PATCH] drm: remove unnecessary return
variable
On Sat, 19 Oct 2019, Wambui Karuga wrote:
> From: Wambui Karuga <wambui.karugax@...il.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?
Also, Greg won't apply this, because it's not targeting staging. Is this
for a specific outreachy project?
julia
> Issue found by coccinelle:
> @@
> local idexpression ret;
> expression e;
> @@
>
> -ret =
> +return
> e;
> -return ret;
>
> Signed-off-by: Wambui Karuga <wambui.karugax@...il.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@...glegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20191019071840.16877-1-wambui%40karuga.xyz.
>
Powered by blists - more mailing lists