linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] gpu: drm: i915: remove dead code
@ 2017-05-15 21:56 Gustavo A. R. Silva
  2017-05-15 22:00 ` [PATCH 2/2] gpu: drm: i915: compress logic into one line Gustavo A. R. Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2017-05-15 21:56 UTC (permalink / raw)
  To: Daniel Vetter, Jani Nikula, David Airlie
  Cc: intel-gfx, dri-devel, linux-kernel, Gustavo A. R. Silva

Local variable has_reduced_clock is assigned to a constant value and it is
never updated again. Remove this variable and the dead code it guards.

Addresses-Coverity-ID: 1362230
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/gpu/drm/i915/intel_display.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index ed1f4f2..b13b53b 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9565,8 +9565,6 @@ static int ironlake_crtc_compute_clock(struct intel_crtc *crtc,
 {
 	struct drm_device *dev = crtc->base.dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
-	struct dpll reduced_clock;
-	bool has_reduced_clock = false;
 	struct intel_shared_dpll *pll;
 	const struct intel_limit *limit;
 	int refclk = 120000;
@@ -9609,8 +9607,7 @@ static int ironlake_crtc_compute_clock(struct intel_crtc *crtc,
 		return -EINVAL;
 	}
 
-	ironlake_compute_dpll(crtc, crtc_state,
-			      has_reduced_clock ? &reduced_clock : NULL);
+	ironlake_compute_dpll(crtc, crtc_state, NULL);
 
 	pll = intel_get_shared_dpll(crtc, crtc_state, NULL);
 	if (pll == NULL) {
@@ -9619,10 +9616,6 @@ static int ironlake_crtc_compute_clock(struct intel_crtc *crtc,
 		return -EINVAL;
 	}
 
-	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_LVDS) &&
-	    has_reduced_clock)
-		crtc->lowfreq_avail = true;
-
 	return 0;
 }
 
-- 
2.5.0

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

* [PATCH 2/2] gpu: drm: i915: compress logic into one line
  2017-05-15 21:56 [PATCH 1/2] gpu: drm: i915: remove dead code Gustavo A. R. Silva
@ 2017-05-15 22:00 ` Gustavo A. R. Silva
  2017-05-16  9:30   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2017-05-15 22:00 UTC (permalink / raw)
  To: Daniel Vetter, Jani Nikula, David Airlie
  Cc: intel-gfx, dri-devel, linux-kernel, Gustavo A. R. Silva

Simplify logic to avoid unnecessary variable declaration and assignment.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/gpu/drm/i915/intel_display.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b13b53b..ca6479a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9565,7 +9565,6 @@ static int ironlake_crtc_compute_clock(struct intel_crtc *crtc,
 {
 	struct drm_device *dev = crtc->base.dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
-	struct intel_shared_dpll *pll;
 	const struct intel_limit *limit;
 	int refclk = 120000;
 
@@ -9609,8 +9608,7 @@ static int ironlake_crtc_compute_clock(struct intel_crtc *crtc,
 
 	ironlake_compute_dpll(crtc, crtc_state, NULL);
 
-	pll = intel_get_shared_dpll(crtc, crtc_state, NULL);
-	if (pll == NULL) {
+	if (!intel_get_shared_dpll(crtc, crtc_state, NULL)) {
 		DRM_DEBUG_DRIVER("failed to find PLL for pipe %c\n",
 				 pipe_name(crtc->pipe));
 		return -EINVAL;
-- 
2.5.0

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

* Re: [PATCH 2/2] gpu: drm: i915: compress logic into one line
  2017-05-15 22:00 ` [PATCH 2/2] gpu: drm: i915: compress logic into one line Gustavo A. R. Silva
@ 2017-05-16  9:30   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2017-05-16  9:30 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Daniel Vetter, Jani Nikula, David Airlie, intel-gfx,
	linux-kernel, dri-devel

On Mon, May 15, 2017 at 05:00:28PM -0500, Gustavo A. R. Silva wrote:
> Simplify logic to avoid unnecessary variable declaration and assignment.
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

Both applied, thanks.
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_display.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index b13b53b..ca6479a 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -9565,7 +9565,6 @@ static int ironlake_crtc_compute_clock(struct intel_crtc *crtc,
>  {
>  	struct drm_device *dev = crtc->base.dev;
>  	struct drm_i915_private *dev_priv = to_i915(dev);
> -	struct intel_shared_dpll *pll;
>  	const struct intel_limit *limit;
>  	int refclk = 120000;
>  
> @@ -9609,8 +9608,7 @@ static int ironlake_crtc_compute_clock(struct intel_crtc *crtc,
>  
>  	ironlake_compute_dpll(crtc, crtc_state, NULL);
>  
> -	pll = intel_get_shared_dpll(crtc, crtc_state, NULL);
> -	if (pll == NULL) {
> +	if (!intel_get_shared_dpll(crtc, crtc_state, NULL)) {
>  		DRM_DEBUG_DRIVER("failed to find PLL for pipe %c\n",
>  				 pipe_name(crtc->pipe));
>  		return -EINVAL;
> -- 
> 2.5.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

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

end of thread, other threads:[~2017-05-16  9:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-15 21:56 [PATCH 1/2] gpu: drm: i915: remove dead code Gustavo A. R. Silva
2017-05-15 22:00 ` [PATCH 2/2] gpu: drm: i915: compress logic into one line Gustavo A. R. Silva
2017-05-16  9:30   ` Daniel Vetter

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).