[Intel-gfx] [PATCH] drm/i915: fix ptr_ret.cocci warnings

kbuild test robot lkp at intel.com
Sat Apr 29 22:01:07 UTC 2017


drivers/gpu/drm/i915/intel_lrc.c:632:1-3: WARNING: PTR_ERR_OR_ZERO can be used


 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

CC: Oscar Mateo <oscar.mateo at intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu at intel.com>
---

 intel_lrc.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -629,10 +629,7 @@ static bool insert_request(struct i915_p
 static int execlists_prepare_request(struct drm_i915_gem_request *request)
 {
 	u32 *cs = intel_ring_begin(request, 0);
-	if (IS_ERR(cs))
-		return PTR_ERR(cs);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(cs);
 }
 
 static void execlists_submit_request(struct drm_i915_gem_request *request)


More information about the Intel-gfx mailing list