LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] drm/radeon: remove unreachable code
@ 2015-01-19 13:10 Nicholas Mc Guire
  2015-01-19 18:27 ` Deucher, Alexander
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Mc Guire @ 2015-01-19 13:10 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Christian Koenig, David Airlie, dri-devel, linux-kernel,
	Nicholas Mc Guire

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
---

As the if (CISLAND_MINIMUM_ENGINE_CLOCK != CISLAND_MINIMUM_ENGINE_CLOCK) is never
satisfied - the entire else branch is never going to be executed and could be 
removed - provided this is not simply a bug and needs to be fixed...

Patch is against 3.19.0-rc5 -next-20150119

Patch was only compile tested with x86_64_defconfig + CONFIG_DRM=m,
CONFIG_DRM_RADEON=m

 drivers/gpu/drm/radeon/ci_dpm.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
index f373a81..28db529 100644
--- a/drivers/gpu/drm/radeon/ci_dpm.c
+++ b/drivers/gpu/drm/radeon/ci_dpm.c
@@ -3805,13 +3805,8 @@ static void ci_find_dpm_states_clocks_in_dpm_table(struct radeon_device *rdev,
 			break;
 	}
 
-	if (i >= sclk_table->count) {
+	if (i >= sclk_table->count)
 		pi->need_update_smu7_dpm_table |= DPMTABLE_OD_UPDATE_SCLK;
-	} else {
-		/* XXX check display min clock requirements */
-		if (CISLAND_MINIMUM_ENGINE_CLOCK != CISLAND_MINIMUM_ENGINE_CLOCK)
-			pi->need_update_smu7_dpm_table |= DPMTABLE_UPDATE_SCLK;
-	}
 
 	for (i = 0; i < mclk_table->count; i++) {
 		if (mclk == mclk_table->dpm_levels[i].value)
-- 
1.7.10.4


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

* RE: [PATCH] drm/radeon: remove unreachable code
  2015-01-19 13:10 [PATCH] drm/radeon: remove unreachable code Nicholas Mc Guire
@ 2015-01-19 18:27 ` Deucher, Alexander
  2015-01-20  0:25   ` Nicholas Mc Guire
  0 siblings, 1 reply; 3+ messages in thread
From: Deucher, Alexander @ 2015-01-19 18:27 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: Koenig, Christian, David Airlie, dri-devel, linux-kernel

> -----Original Message-----
> From: Nicholas Mc Guire [mailto:der.herr@hofr.at]
> Sent: Monday, January 19, 2015 8:11 AM
> To: Deucher, Alexander
> Cc: Koenig, Christian; David Airlie; dri-devel@lists.freedesktop.org; linux-
> kernel@vger.kernel.org; Nicholas Mc Guire
> Subject: [PATCH] drm/radeon: remove unreachable code
> 
> Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>

NACK.  I want to leave this in place for the future.  When we support dynamically adjusting the disp clock we'll need to update the sclk for ds mode.

Alex

> ---
> 
> As the if (CISLAND_MINIMUM_ENGINE_CLOCK !=
> CISLAND_MINIMUM_ENGINE_CLOCK) is never
> satisfied - the entire else branch is never going to be executed and could be
> removed - provided this is not simply a bug and needs to be fixed...
> 
> Patch is against 3.19.0-rc5 -next-20150119
> 
> Patch was only compile tested with x86_64_defconfig + CONFIG_DRM=m,
> CONFIG_DRM_RADEON=m
> 
>  drivers/gpu/drm/radeon/ci_dpm.c |    7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/radeon/ci_dpm.c
> b/drivers/gpu/drm/radeon/ci_dpm.c
> index f373a81..28db529 100644
> --- a/drivers/gpu/drm/radeon/ci_dpm.c
> +++ b/drivers/gpu/drm/radeon/ci_dpm.c
> @@ -3805,13 +3805,8 @@ static void
> ci_find_dpm_states_clocks_in_dpm_table(struct radeon_device *rdev,
>  			break;
>  	}
> 
> -	if (i >= sclk_table->count) {
> +	if (i >= sclk_table->count)
>  		pi->need_update_smu7_dpm_table |=
> DPMTABLE_OD_UPDATE_SCLK;
> -	} else {
> -		/* XXX check display min clock requirements */
> -		if (CISLAND_MINIMUM_ENGINE_CLOCK !=
> CISLAND_MINIMUM_ENGINE_CLOCK)
> -			pi->need_update_smu7_dpm_table |=
> DPMTABLE_UPDATE_SCLK;
> -	}
> 
>  	for (i = 0; i < mclk_table->count; i++) {
>  		if (mclk == mclk_table->dpm_levels[i].value)
> --
> 1.7.10.4


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

* Re: [PATCH] drm/radeon: remove unreachable code
  2015-01-19 18:27 ` Deucher, Alexander
@ 2015-01-20  0:25   ` Nicholas Mc Guire
  0 siblings, 0 replies; 3+ messages in thread
From: Nicholas Mc Guire @ 2015-01-20  0:25 UTC (permalink / raw)
  To: Deucher, Alexander
  Cc: Koenig, Christian, David Airlie, dri-devel, linux-kernel

On Mon, 19 Jan 2015, Deucher, Alexander wrote:

> > -----Original Message-----
> > From: Nicholas Mc Guire [mailto:der.herr@hofr.at]
> > Sent: Monday, January 19, 2015 8:11 AM
> > To: Deucher, Alexander
> > Cc: Koenig, Christian; David Airlie; dri-devel@lists.freedesktop.org; linux-
> > kernel@vger.kernel.org; Nicholas Mc Guire
> > Subject: [PATCH] drm/radeon: remove unreachable code
> > 
> > Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
> 
> NACK.  I want to leave this in place for the future.  When we support dynamically adjusting the disp clock we'll need to update the sclk for ds mode.
>

get it - then could you add some comment to that end so it becomes clear 
that this is intentional - using your comment above - something like:

 
>From 2be978edbc77d5928ede8fddc2d784ca6f78533e Mon Sep 17 00:00:00 2001
From: Nicholas Mc Guire <der.herr@hofr.at>
Date: Mon, 19 Jan 2015 19:11:57 -0500
Subject: [PATCH] document the unreachable code sequence

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
---
 drivers/gpu/drm/radeon/ci_dpm.c                 |    7 +++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
index f373a81..722dfef 100644
--- a/drivers/gpu/drm/radeon/ci_dpm.c
+++ b/drivers/gpu/drm/radeon/ci_dpm.c
@@ -3808,7 +3808,12 @@ static void ci_find_dpm_states_clocks_in_dpm_table(struct radeon_device *rdev,
 	if (i >= sclk_table->count) {
 		pi->need_update_smu7_dpm_table |= DPMTABLE_OD_UPDATE_SCLK;
 	} else {
-		/* XXX check display min clock requirements */
+		/*
+		 * XXX Check display min clock requirements.
+		 * This is a place holder for the future support of
+		 * dynamically adjusting the disp clock where we'll
+		 * need to update the sclk for ds mode.
+		 */
 		if (CISLAND_MINIMUM_ENGINE_CLOCK != CISLAND_MINIMUM_ENGINE_CLOCK)
 			pi->need_update_smu7_dpm_table |= DPMTABLE_UPDATE_SCLK;
 	}
-- 
1.7.10.4


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

end of thread, other threads:[~2015-01-20  0:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-19 13:10 [PATCH] drm/radeon: remove unreachable code Nicholas Mc Guire
2015-01-19 18:27 ` Deucher, Alexander
2015-01-20  0:25   ` Nicholas Mc Guire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).