All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: remove assignment for return value
@ 2019-10-19  7:32 Wambui Karuga
       [not found] ` <20191019073242.21652-1-wambui-bg2bBxPYEmlRKH5a5HGb4w@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Wambui Karuga @ 2019-10-19  7:32 UTC (permalink / raw)
  To: dri-devel
  Cc: linux-kernel, alexander.deucher, christian.koenig, David1.Zhou,
	airlied, daniel, amd-gfx, outreachy-kernel

Remove unnecessary assignment for return value and have the
function return the required value directly.
Issue found by coccinelle:
@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Wambui Karuga <wambui@karuga.xyz>
---
 drivers/gpu/drm/radeon/cik.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index 62eab82a64f9..daff9a2af3be 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -221,9 +221,7 @@ int ci_get_temp(struct radeon_device *rdev)
 	else
 		actual_temp = temp & 0x1ff;
 
-	actual_temp = actual_temp * 1000;
-
-	return actual_temp;
+	return actual_temp * 1000;
 }
 
 /* get temperature in millidegrees */
@@ -239,9 +237,7 @@ int kv_get_temp(struct radeon_device *rdev)
 	else
 		actual_temp = 0;
 
-	actual_temp = actual_temp * 1000;
-
-	return actual_temp;
+	return actual_temp * 1000;
 }
 
 /*
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/radeon: remove assignment for return value
@ 2019-10-23 15:09     ` Harry Wentland
  0 siblings, 0 replies; 9+ messages in thread
From: Harry Wentland @ 2019-10-23 15:09 UTC (permalink / raw)
  To: Wambui Karuga,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
  Cc: airlied-cv59FeDIM0c@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	outreachy-kernel-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	Deucher, Alexander, Koenig, Christian

On 2019-10-19 3:32 a.m., Wambui Karuga wrote:
> Remove unnecessary assignment for return value and have the
> function return the required value directly.
> Issue found by coccinelle:
> @@
> local idexpression ret;
> expression e;
> @@
> 
> -ret =
> +return
>      e;
> -return ret;
> 
> Signed-off-by: Wambui Karuga <wambui@karuga.xyz>

Thanks for your patch.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry


> ---
>  drivers/gpu/drm/radeon/cik.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index 62eab82a64f9..daff9a2af3be 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -221,9 +221,7 @@ int ci_get_temp(struct radeon_device *rdev)
>  	else
>  		actual_temp = temp & 0x1ff;
>  
> -	actual_temp = actual_temp * 1000;
> -
> -	return actual_temp;
> +	return actual_temp * 1000;
>  }
>  
>  /* get temperature in millidegrees */
> @@ -239,9 +237,7 @@ int kv_get_temp(struct radeon_device *rdev)
>  	else
>  		actual_temp = 0;
>  
> -	actual_temp = actual_temp * 1000;
> -
> -	return actual_temp;
> +	return actual_temp * 1000;
>  }
>  
>  /*
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/radeon: remove assignment for return value
@ 2019-10-23 15:09     ` Harry Wentland
  0 siblings, 0 replies; 9+ messages in thread
From: Harry Wentland @ 2019-10-23 15:09 UTC (permalink / raw)
  To: Wambui Karuga, dri-devel@lists.freedesktop.org
  Cc: airlied@linux.ie, linux-kernel@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, outreachy-kernel@googlegroups.com,
	Deucher, Alexander, Koenig, Christian

On 2019-10-19 3:32 a.m., Wambui Karuga wrote:
> Remove unnecessary assignment for return value and have the
> function return the required value directly.
> Issue found by coccinelle:
> @@
> local idexpression ret;
> expression e;
> @@
> 
> -ret =
> +return
>      e;
> -return ret;
> 
> Signed-off-by: Wambui Karuga <wambui@karuga.xyz>

Thanks for your patch.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry


> ---
>  drivers/gpu/drm/radeon/cik.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index 62eab82a64f9..daff9a2af3be 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -221,9 +221,7 @@ int ci_get_temp(struct radeon_device *rdev)
>  	else
>  		actual_temp = temp & 0x1ff;
>  
> -	actual_temp = actual_temp * 1000;
> -
> -	return actual_temp;
> +	return actual_temp * 1000;
>  }
>  
>  /* get temperature in millidegrees */
> @@ -239,9 +237,7 @@ int kv_get_temp(struct radeon_device *rdev)
>  	else
>  		actual_temp = 0;
>  
> -	actual_temp = actual_temp * 1000;
> -
> -	return actual_temp;
> +	return actual_temp * 1000;
>  }
>  
>  /*
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/radeon: remove assignment for return value
@ 2019-10-23 15:09     ` Harry Wentland
  0 siblings, 0 replies; 9+ messages in thread
From: Harry Wentland @ 2019-10-23 15:09 UTC (permalink / raw)
  To: Wambui Karuga, dri-devel@lists.freedesktop.org
  Cc: airlied@linux.ie, linux-kernel@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, outreachy-kernel@googlegroups.com,
	Deucher, Alexander, Koenig, Christian

On 2019-10-19 3:32 a.m., Wambui Karuga wrote:
> Remove unnecessary assignment for return value and have the
> function return the required value directly.
> Issue found by coccinelle:
> @@
> local idexpression ret;
> expression e;
> @@
> 
> -ret =
> +return
>      e;
> -return ret;
> 
> Signed-off-by: Wambui Karuga <wambui@karuga.xyz>

Thanks for your patch.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry


> ---
>  drivers/gpu/drm/radeon/cik.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index 62eab82a64f9..daff9a2af3be 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -221,9 +221,7 @@ int ci_get_temp(struct radeon_device *rdev)
>  	else
>  		actual_temp = temp & 0x1ff;
>  
> -	actual_temp = actual_temp * 1000;
> -
> -	return actual_temp;
> +	return actual_temp * 1000;
>  }
>  
>  /* get temperature in millidegrees */
> @@ -239,9 +237,7 @@ int kv_get_temp(struct radeon_device *rdev)
>  	else
>  		actual_temp = 0;
>  
> -	actual_temp = actual_temp * 1000;
> -
> -	return actual_temp;
> +	return actual_temp * 1000;
>  }
>  
>  /*
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/radeon: remove assignment for return value
@ 2019-10-23 15:09     ` Harry Wentland
  0 siblings, 0 replies; 9+ messages in thread
From: Harry Wentland @ 2019-10-23 15:09 UTC (permalink / raw)
  To: Wambui Karuga, dri-devel@lists.freedesktop.org
  Cc: airlied@linux.ie, linux-kernel@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, outreachy-kernel@googlegroups.com,
	Deucher, Alexander, Koenig, Christian

On 2019-10-19 3:32 a.m., Wambui Karuga wrote:
> Remove unnecessary assignment for return value and have the
> function return the required value directly.
> Issue found by coccinelle:
> @@
> local idexpression ret;
> expression e;
> @@
> 
> -ret =
> +return
>      e;
> -return ret;
> 
> Signed-off-by: Wambui Karuga <wambui@karuga.xyz>

Thanks for your patch.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry


> ---
>  drivers/gpu/drm/radeon/cik.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index 62eab82a64f9..daff9a2af3be 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -221,9 +221,7 @@ int ci_get_temp(struct radeon_device *rdev)
>  	else
>  		actual_temp = temp & 0x1ff;
>  
> -	actual_temp = actual_temp * 1000;
> -
> -	return actual_temp;
> +	return actual_temp * 1000;
>  }
>  
>  /* get temperature in millidegrees */
> @@ -239,9 +237,7 @@ int kv_get_temp(struct radeon_device *rdev)
>  	else
>  		actual_temp = 0;
>  
> -	actual_temp = actual_temp * 1000;
> -
> -	return actual_temp;
> +	return actual_temp * 1000;
>  }
>  
>  /*
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/radeon: remove assignment for return value
@ 2019-10-25 19:36         ` Alex Deucher
  0 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2019-10-25 19:36 UTC (permalink / raw)
  To: Harry Wentland
  Cc: airlied-cv59FeDIM0c@public.gmane.org, Wambui Karuga,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	outreachy-kernel-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Deucher, Alexander, Koenig, Christian

Applied.  Thanks!

Alex

On Wed, Oct 23, 2019 at 11:09 AM Harry Wentland <hwentlan@amd.com> wrote:
>
> On 2019-10-19 3:32 a.m., Wambui Karuga wrote:
> > Remove unnecessary assignment for return value and have the
> > function return the required value directly.
> > Issue found by coccinelle:
> > @@
> > local idexpression ret;
> > expression e;
> > @@
> >
> > -ret =
> > +return
> >      e;
> > -return ret;
> >
> > Signed-off-by: Wambui Karuga <wambui@karuga.xyz>
>
> Thanks for your patch.
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Harry
>
>
> > ---
> >  drivers/gpu/drm/radeon/cik.c | 8 ++------
> >  1 file changed, 2 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> > index 62eab82a64f9..daff9a2af3be 100644
> > --- a/drivers/gpu/drm/radeon/cik.c
> > +++ b/drivers/gpu/drm/radeon/cik.c
> > @@ -221,9 +221,7 @@ int ci_get_temp(struct radeon_device *rdev)
> >       else
> >               actual_temp = temp & 0x1ff;
> >
> > -     actual_temp = actual_temp * 1000;
> > -
> > -     return actual_temp;
> > +     return actual_temp * 1000;
> >  }
> >
> >  /* get temperature in millidegrees */
> > @@ -239,9 +237,7 @@ int kv_get_temp(struct radeon_device *rdev)
> >       else
> >               actual_temp = 0;
> >
> > -     actual_temp = actual_temp * 1000;
> > -
> > -     return actual_temp;
> > +     return actual_temp * 1000;
> >  }
> >
> >  /*
> >
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/radeon: remove assignment for return value
@ 2019-10-25 19:36         ` Alex Deucher
  0 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2019-10-25 19:36 UTC (permalink / raw)
  To: Harry Wentland
  Cc: airlied@linux.ie, Wambui Karuga, linux-kernel@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, outreachy-kernel@googlegroups.com,
	dri-devel@lists.freedesktop.org, Deucher, Alexander,
	Koenig, Christian

Applied.  Thanks!

Alex

On Wed, Oct 23, 2019 at 11:09 AM Harry Wentland <hwentlan@amd.com> wrote:
>
> On 2019-10-19 3:32 a.m., Wambui Karuga wrote:
> > Remove unnecessary assignment for return value and have the
> > function return the required value directly.
> > Issue found by coccinelle:
> > @@
> > local idexpression ret;
> > expression e;
> > @@
> >
> > -ret =
> > +return
> >      e;
> > -return ret;
> >
> > Signed-off-by: Wambui Karuga <wambui@karuga.xyz>
>
> Thanks for your patch.
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Harry
>
>
> > ---
> >  drivers/gpu/drm/radeon/cik.c | 8 ++------
> >  1 file changed, 2 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> > index 62eab82a64f9..daff9a2af3be 100644
> > --- a/drivers/gpu/drm/radeon/cik.c
> > +++ b/drivers/gpu/drm/radeon/cik.c
> > @@ -221,9 +221,7 @@ int ci_get_temp(struct radeon_device *rdev)
> >       else
> >               actual_temp = temp & 0x1ff;
> >
> > -     actual_temp = actual_temp * 1000;
> > -
> > -     return actual_temp;
> > +     return actual_temp * 1000;
> >  }
> >
> >  /* get temperature in millidegrees */
> > @@ -239,9 +237,7 @@ int kv_get_temp(struct radeon_device *rdev)
> >       else
> >               actual_temp = 0;
> >
> > -     actual_temp = actual_temp * 1000;
> > -
> > -     return actual_temp;
> > +     return actual_temp * 1000;
> >  }
> >
> >  /*
> >
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/radeon: remove assignment for return value
@ 2019-10-25 19:36         ` Alex Deucher
  0 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2019-10-25 19:36 UTC (permalink / raw)
  To: Harry Wentland
  Cc: Wambui Karuga, dri-devel@lists.freedesktop.org, airlied@linux.ie,
	linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org,
	outreachy-kernel@googlegroups.com, Deucher, Alexander,
	Koenig, Christian

Applied.  Thanks!

Alex

On Wed, Oct 23, 2019 at 11:09 AM Harry Wentland <hwentlan@amd.com> wrote:
>
> On 2019-10-19 3:32 a.m., Wambui Karuga wrote:
> > Remove unnecessary assignment for return value and have the
> > function return the required value directly.
> > Issue found by coccinelle:
> > @@
> > local idexpression ret;
> > expression e;
> > @@
> >
> > -ret =
> > +return
> >      e;
> > -return ret;
> >
> > Signed-off-by: Wambui Karuga <wambui@karuga.xyz>
>
> Thanks for your patch.
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Harry
>
>
> > ---
> >  drivers/gpu/drm/radeon/cik.c | 8 ++------
> >  1 file changed, 2 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> > index 62eab82a64f9..daff9a2af3be 100644
> > --- a/drivers/gpu/drm/radeon/cik.c
> > +++ b/drivers/gpu/drm/radeon/cik.c
> > @@ -221,9 +221,7 @@ int ci_get_temp(struct radeon_device *rdev)
> >       else
> >               actual_temp = temp & 0x1ff;
> >
> > -     actual_temp = actual_temp * 1000;
> > -
> > -     return actual_temp;
> > +     return actual_temp * 1000;
> >  }
> >
> >  /* get temperature in millidegrees */
> > @@ -239,9 +237,7 @@ int kv_get_temp(struct radeon_device *rdev)
> >       else
> >               actual_temp = 0;
> >
> > -     actual_temp = actual_temp * 1000;
> > -
> > -     return actual_temp;
> > +     return actual_temp * 1000;
> >  }
> >
> >  /*
> >
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/radeon: remove assignment for return value
@ 2019-10-25 19:36         ` Alex Deucher
  0 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2019-10-25 19:36 UTC (permalink / raw)
  To: Harry Wentland
  Cc: airlied@linux.ie, Wambui Karuga, linux-kernel@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, outreachy-kernel@googlegroups.com,
	dri-devel@lists.freedesktop.org, Deucher, Alexander,
	Koenig, Christian

Applied.  Thanks!

Alex

On Wed, Oct 23, 2019 at 11:09 AM Harry Wentland <hwentlan@amd.com> wrote:
>
> On 2019-10-19 3:32 a.m., Wambui Karuga wrote:
> > Remove unnecessary assignment for return value and have the
> > function return the required value directly.
> > Issue found by coccinelle:
> > @@
> > local idexpression ret;
> > expression e;
> > @@
> >
> > -ret =
> > +return
> >      e;
> > -return ret;
> >
> > Signed-off-by: Wambui Karuga <wambui@karuga.xyz>
>
> Thanks for your patch.
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Harry
>
>
> > ---
> >  drivers/gpu/drm/radeon/cik.c | 8 ++------
> >  1 file changed, 2 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> > index 62eab82a64f9..daff9a2af3be 100644
> > --- a/drivers/gpu/drm/radeon/cik.c
> > +++ b/drivers/gpu/drm/radeon/cik.c
> > @@ -221,9 +221,7 @@ int ci_get_temp(struct radeon_device *rdev)
> >       else
> >               actual_temp = temp & 0x1ff;
> >
> > -     actual_temp = actual_temp * 1000;
> > -
> > -     return actual_temp;
> > +     return actual_temp * 1000;
> >  }
> >
> >  /* get temperature in millidegrees */
> > @@ -239,9 +237,7 @@ int kv_get_temp(struct radeon_device *rdev)
> >       else
> >               actual_temp = 0;
> >
> > -     actual_temp = actual_temp * 1000;
> > -
> > -     return actual_temp;
> > +     return actual_temp * 1000;
> >  }
> >
> >  /*
> >
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-10-25 19:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-19  7:32 [PATCH] drm/radeon: remove assignment for return value Wambui Karuga
     [not found] ` <20191019073242.21652-1-wambui-bg2bBxPYEmlRKH5a5HGb4w@public.gmane.org>
2019-10-23 15:09   ` Harry Wentland
2019-10-23 15:09     ` Harry Wentland
2019-10-23 15:09     ` Harry Wentland
2019-10-23 15:09     ` Harry Wentland
     [not found]     ` <2bed3fab-e84d-226d-b552-1ac088fc5d9c-5C7GfCeVMHo@public.gmane.org>
2019-10-25 19:36       ` Alex Deucher
2019-10-25 19:36         ` Alex Deucher
2019-10-25 19:36         ` Alex Deucher
2019-10-25 19:36         ` Alex Deucher

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.