Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1467193 > unrolled thread

[PATCH 1/1] drm/amdgpu/gmc7: remove dead code

Started byHeinrich Schuchardt <xypron.glpk@gmx.de>
First post2016-08-21 20:10 +0200
Last post2016-08-22 09:50 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] drm/amdgpu/gmc7: remove dead code Heinrich Schuchardt <xypron.glpk@gmx.de> - 2016-08-21 20:10 +0200
    Re: [PATCH 1/1] drm/amdgpu/gmc7: remove dead code Joe Perches <joe@perches.com> - 2016-08-21 20:30 +0200
      Re: [PATCH 1/1] drm/amdgpu/gmc7: remove dead code Heinrich Schuchardt <xypron.glpk@gmx.de> - 2016-08-21 20:50 +0200
        Re: [PATCH 1/1] drm/amdgpu/gmc7: remove dead code Joe Perches <joe@perches.com> - 2016-08-21 21:00 +0200
    Re: [PATCH 1/1] drm/amdgpu/gmc7: remove dead code Christian König <deathsimple@vodafone.de> - 2016-08-22 09:50 +0200

#1467193 — [PATCH 1/1] drm/amdgpu/gmc7: remove dead code

FromHeinrich Schuchardt <xypron.glpk@gmx.de>
Date2016-08-21 20:10 +0200
Subject[PATCH 1/1] drm/amdgpu/gmc7: remove dead code
Message-ID<s8Fm1-3If-5@gated-at.bofh.it>
In an if block for (running == 0) running cannot be non-zero.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
index 0b0f086..1239463 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
@@ -203,11 +203,6 @@ static int gmc_v7_0_mc_load_microcode(struct amdgpu_device *adev)
 	running = REG_GET_FIELD(RREG32(mmMC_SEQ_SUP_CNTL), MC_SEQ_SUP_CNTL, RUN);
 
 	if (running == 0) {
-		if (running) {
-			blackout = RREG32(mmMC_SHARED_BLACKOUT_CNTL);
-			WREG32(mmMC_SHARED_BLACKOUT_CNTL, blackout | 1);
-		}
-
 		/* reset the engine and set to writable */
 		WREG32(mmMC_SEQ_SUP_CNTL, 0x00000008);
 		WREG32(mmMC_SEQ_SUP_CNTL, 0x00000010);
@@ -239,9 +234,6 @@ static int gmc_v7_0_mc_load_microcode(struct amdgpu_device *adev)
 				break;
 			udelay(1);
 		}
-
-		if (running)
-			WREG32(mmMC_SHARED_BLACKOUT_CNTL, blackout);
 	}
 
 	return 0;
-- 
2.1.4

[toc] | [next] | [standalone]


#1467199

FromJoe Perches <joe@perches.com>
Date2016-08-21 20:30 +0200
Message-ID<s8FFo-3OO-15@gated-at.bofh.it>
In reply to#1467193
On Sun, 2016-08-21 at 20:06 +0200, Heinrich Schuchardt wrote:
> In an if block for (running == 0) running cannot be non-zero.

This code could also be better unindented by one level
(all of the block would fit 80 columns) by changing:

	if (running == 0) {
		[code...]
	}

	return 0;

to:

	if (running)
		return 0;

	[code...]

	return 0;
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
[]
> @@ -203,11 +203,6 @@ static int gmc_v7_0_mc_load_microcode(struct amdgpu_device *adev)
>  	running = REG_GET_FIELD(RREG32(mmMC_SEQ_SUP_CNTL), MC_SEQ_SUP_CNTL, RUN);
>  
>  	if (running == 0) {
> -		if (running) {
> -			blackout = RREG32(mmMC_SHARED_BLACKOUT_CNTL);
> -			WREG32(mmMC_SHARED_BLACKOUT_CNTL, blackout | 1);
> -		}
> -
>  		/* reset the engine and set to writable */
>  		WREG32(mmMC_SEQ_SUP_CNTL, 0x00000008);
>  		WREG32(mmMC_SEQ_SUP_CNTL, 0x00000010);
> @@ -239,9 +234,6 @@ static int gmc_v7_0_mc_load_microcode(struct amdgpu_device *adev)
>  				break;
>  			udelay(1);
>  		}
> -
> -		if (running)
> -			WREG32(mmMC_SHARED_BLACKOUT_CNTL, blackout);
>  	}
>  
>  	return 0;

[toc] | [prev] | [next] | [standalone]


#1467206

FromHeinrich Schuchardt <xypron.glpk@gmx.de>
Date2016-08-21 20:50 +0200
Message-ID<s8FYJ-3WX-17@gated-at.bofh.it>
In reply to#1467199
On 08/21/2016 08:29 PM, Joe Perches wrote:
> On Sun, 2016-08-21 at 20:06 +0200, Heinrich Schuchardt wrote:
>> In an if block for (running == 0) running cannot be non-zero.
> 
> This code could also be better unindented by one level
> (all of the block would fit 80 columns) by changing:
> 
> 	if (running == 0) {
> 		[code...]
> 	}
> 
> 	return 0;
> 
> to:
> 
> 	if (running)
> 		return 0;
> 
> 	[code...]
> 
> 	return 0;

Should I revise my patch?
Or should this be an additional patch?

[toc] | [prev] | [next] | [standalone]


#1467210

FromJoe Perches <joe@perches.com>
Date2016-08-21 21:00 +0200
Message-ID<s8G8q-40v-21@gated-at.bofh.it>
In reply to#1467206
On Sun, 2016-08-21 at 20:45 +0200, Heinrich Schuchardt wrote:
> On 08/21/2016 08:29 PM, Joe Perches wrote:
> > On Sun, 2016-08-21 at 20:06 +0200, Heinrich Schuchardt wrote:
> > > In an if block for (running == 0) running cannot be non-zero.
> > This code could also be better unindented by one level
> > (all of the block would fit 80 columns) by changing:
> > 
> > 	if (running == 0) {
> > 		[code...]
> > 	}
> > 
> > 	return 0;
> > 
> > to:
> > 
> > 	if (running)
> > 		return 0;
> > 
> > 	[code...]
> > 
> > 	return 0;
> Should I revise my patch?
> Or should this be an additional patch?

If you want to do it, an additional patch is probably best.

[toc] | [prev] | [next] | [standalone]


#1467426

FromChristian König <deathsimple@vodafone.de>
Date2016-08-22 09:50 +0200
Message-ID<s8S9z-3nT-7@gated-at.bofh.it>
In reply to#1467193
Am 21.08.2016 um 20:06 schrieb Heinrich Schuchardt:
> In an if block for (running == 0) running cannot be non-zero.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

The following patches are all Reviewed-by: Christian König 
<christian.koenig@amd.com>:

[PATCH 1/1] drm/amdgpu/gmc7: remove dead code
[PATCH 1/1] drm/amdgpu/gmc8: remove dead code
[PATCH 1/1] drm/amd/powerplay: avoid NULL pointer dereference
[PATCH 1/1] drm/amd/powerplay: avoid NULL dereference, cz_hwmgr.c
[PATCH 1/1] drm/radeon/cik: remove dead code
[PATCH 1/1] drm/radeon: remove dead code, si_mc_load_microcode

Thanks for the help,
Christian.

PS: Please send such minor cleanups as one set of patches next time, 
cause that makes reviewing them much easier.

> ---
>   drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 8 --------
>   1 file changed, 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> index 0b0f086..1239463 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> @@ -203,11 +203,6 @@ static int gmc_v7_0_mc_load_microcode(struct amdgpu_device *adev)
>   	running = REG_GET_FIELD(RREG32(mmMC_SEQ_SUP_CNTL), MC_SEQ_SUP_CNTL, RUN);
>   
>   	if (running == 0) {
> -		if (running) {
> -			blackout = RREG32(mmMC_SHARED_BLACKOUT_CNTL);
> -			WREG32(mmMC_SHARED_BLACKOUT_CNTL, blackout | 1);
> -		}
> -
>   		/* reset the engine and set to writable */
>   		WREG32(mmMC_SEQ_SUP_CNTL, 0x00000008);
>   		WREG32(mmMC_SEQ_SUP_CNTL, 0x00000010);
> @@ -239,9 +234,6 @@ static int gmc_v7_0_mc_load_microcode(struct amdgpu_device *adev)
>   				break;
>   			udelay(1);
>   		}
> -
> -		if (running)
> -			WREG32(mmMC_SHARED_BLACKOUT_CNTL, blackout);
>   	}
>   
>   	return 0;

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web