[Intel-gfx] [PATCH] drm/i915: Eliminate dead code in intel_sanitize_enable_ppgtt()

Chris Wilson chris at chris-wilson.co.uk
Wed Jun 1 17:04:40 UTC 2016


On Wed, Jun 01, 2016 at 05:01:13PM +0100, Damien Lespiau wrote:
> We exit early if has_aliasing_ppgtt is 0, so towards the end of the
> function has_aliasing_ppgtt can only be 1.
> 
> Also:
> 
> 	if (foo)
> 		return 1;
> 	else
> 		return 0;
> 
> when foo is already a bool is really just:
> 
> 	return foo;
> 
> Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 4668477..6aae4b8 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -161,7 +161,7 @@ int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv,
>  	if (INTEL_GEN(dev_priv) >= 8 && i915.enable_execlists)
>  		return has_full_48bit_ppgtt ? 3 : 2;
>  	else
> -		return has_aliasing_ppgtt ? 1 : 0;
> +		return has_aliasing_ppgtt;

/* full-ppgtt doesn't yet work reliably in legacy ringbuffer mode */
if (!i915.enable_execlists)
	return 1;

return has_full_48bit_ppgtt ? 3 : 2;

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list