Re: [PATCH 3/3] drm/i915: Simplify error handling in intel_modeset_all_pipes()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 14, 2016 at 06:35:11PM +0200, ville.syrjala@xxxxxxxxxxxxxxx wrote:
> From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> 
> No need for the extra break statements and whatnot, just return the
> error directly. And tighten the scope of the local variables while at
> it.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

Reviewed-by: Daniel Vetter <daniel.vetter@xxxxxxxx>

> ---
>  drivers/gpu/drm/i915/intel_display.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index d7a4bc63b05b..b158af6d89b3 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13965,14 +13965,15 @@ static int intel_lock_all_pipes(struct drm_atomic_state *state)
>  static int intel_modeset_all_pipes(struct drm_atomic_state *state)
>  {
>  	struct drm_crtc *crtc;
> -	struct drm_crtc_state *crtc_state;
> -	int ret = 0;
>  
>  	/*
>  	 * Add all pipes to the state, and force
>  	 * a modeset on all the active ones.
>  	 */
>  	for_each_crtc(state->dev, crtc) {
> +		struct drm_crtc_state *crtc_state;
> +		int ret;
> +
>  		crtc_state = drm_atomic_get_crtc_state(state, crtc);
>  		if (IS_ERR(crtc_state))
>  			return PTR_ERR(crtc_state);
> @@ -13984,14 +13985,14 @@ static int intel_modeset_all_pipes(struct drm_atomic_state *state)
>  
>  		ret = drm_atomic_add_affected_connectors(state, crtc);
>  		if (ret)
> -			break;
> +			return ret;
>  
>  		ret = drm_atomic_add_affected_planes(state, crtc);
>  		if (ret)
> -			break;
> +			return ret;
>  	}
>  
> -	return ret;
> +	return 0;
>  }
>  
>  static int intel_modeset_checks(struct drm_atomic_state *state)
> -- 
> 2.7.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux