public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm: Nuke the useless 'ret' variable from drm_mode_convert_umode()
Date: Tue, 13 Mar 2018 17:17:14 +0100	[thread overview]
Message-ID: <20180313161714.GA25297@phenom.ffwll.local> (raw)
In-Reply-To: <20180313150759.27620-1-ville.syrjala@linux.intel.com>

On Tue, Mar 13, 2018 at 05:07:57PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> No need to store the return value in a variable since we don't have to
> do any unwinding.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/drm_modes.c | 15 ++++-----------
>  1 file changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 5a8033fda4e3..4157250140b0 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -1596,12 +1596,8 @@ int drm_mode_convert_umode(struct drm_device *dev,
>  			   struct drm_display_mode *out,
>  			   const struct drm_mode_modeinfo *in)
>  {
> -	int ret = -EINVAL;
> -
> -	if (in->clock > INT_MAX || in->vrefresh > INT_MAX) {
> -		ret = -ERANGE;
> -		goto out;
> -	}
> +	if (in->clock > INT_MAX || in->vrefresh > INT_MAX)
> +		return -ERANGE;
>  
>  	out->clock = in->clock;
>  	out->hdisplay = in->hdisplay;
> @@ -1622,14 +1618,11 @@ int drm_mode_convert_umode(struct drm_device *dev,
>  
>  	out->status = drm_mode_validate_driver(dev, out);
>  	if (out->status != MODE_OK)
> -		goto out;
> +		return -EINVAL;
>  
>  	drm_mode_set_crtcinfo(out, CRTC_INTERLACE_HALVE_V);
>  
> -	ret = 0;
> -
> -out:
> -	return ret;
> +	return 0;
>  }
>  
>  /**
> -- 
> 2.16.1
> 
> _______________________________________________
> 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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-03-13 16:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 15:07 [PATCH 1/3] drm: Nuke the useless 'ret' variable from drm_mode_convert_umode() Ville Syrjala
2018-03-13 15:07 ` [PATCH 2/3] drm: Make drm_mode_vrefresh() a bit more accurate Ville Syrjala
2018-03-14 13:56   ` Daniel Vetter
2018-03-14 14:50     ` Ville Syrjälä
2018-03-16 16:34     ` Ville Syrjälä
2018-03-13 15:07 ` [PATCH 3/3] drm: Store the calculated vrefresh in the user mode Ville Syrjala
2018-03-13 19:04   ` Maarten Lankhorst
2018-03-14 14:55     ` Ville Syrjälä
2018-03-13 16:17 ` Daniel Vetter [this message]
2018-03-13 16:25 ` ✓ Fi.CI.BAT: success for series starting with [1/3] drm: Nuke the useless 'ret' variable from drm_mode_convert_umode() Patchwork
2018-03-13 17:32 ` ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180313161714.GA25297@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox