diff mbox

[1/1,linux-next] drm/i915: use ERR_CAST instead of ERR_PTR/PTR_ERR

Message ID 1429954470-28430-1-git-send-email-fabf@skynet.be (mailing list archive)
State New, archived
Headers show

Commit Message

Fabian Frederick April 25, 2015, 9:34 a.m. UTC
Inspired by scripts/coccinelle/api/err_cast.cocci

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/gpu/drm/i915/intel_drv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jani Nikula April 27, 2015, 7:43 a.m. UTC | #1
On Sat, 25 Apr 2015, Fabian Frederick <fabf@skynet.be> wrote:
> Inspired by scripts/coccinelle/api/err_cast.cocci
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


> ---
>  drivers/gpu/drm/i915/intel_drv.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 897f17d..d52f267 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1310,7 +1310,7 @@ intel_atomic_get_crtc_state(struct drm_atomic_state *state,
>  	struct drm_crtc_state *crtc_state;
>  	crtc_state = drm_atomic_get_crtc_state(state, &crtc->base);
>  	if (IS_ERR(crtc_state))
> -		return ERR_PTR(PTR_ERR(crtc_state));
> +		return ERR_CAST(crtc_state);
>  
>  	return to_intel_crtc_state(crtc_state);
>  }
> -- 
> 1.9.1
>
Daniel Vetter May 4, 2015, 2:30 p.m. UTC | #2
On Mon, Apr 27, 2015 at 10:43:19AM +0300, Jani Nikula wrote:
> On Sat, 25 Apr 2015, Fabian Frederick <fabf@skynet.be> wrote:
> > Inspired by scripts/coccinelle/api/err_cast.cocci
> >
> > Signed-off-by: Fabian Frederick <fabf@skynet.be>
> 
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>

Queued for -next, thanks for the patch.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 897f17d..d52f267 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1310,7 +1310,7 @@  intel_atomic_get_crtc_state(struct drm_atomic_state *state,
 	struct drm_crtc_state *crtc_state;
 	crtc_state = drm_atomic_get_crtc_state(state, &crtc->base);
 	if (IS_ERR(crtc_state))
-		return ERR_PTR(PTR_ERR(crtc_state));
+		return ERR_CAST(crtc_state);
 
 	return to_intel_crtc_state(crtc_state);
 }