diff mbox

drm/i915: fix ptr_ret.cocci warnings

Message ID 20170429220107.GA6529@lkp-g5.lkp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

kernel test robot April 29, 2017, 10:01 p.m. UTC
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@intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

Patch

--- 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)