Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Oscar Mateo <oscar.mateo@intel.com>
Cc: intel-gfx@lists.freedesktop.org, kbuild-all@01.org
Subject: [PATCH] drm/i915: fix ptr_ret.cocci warnings
Date: Sun, 30 Apr 2017 06:01:07 +0800	[thread overview]
Message-ID: <20170429220107.GA6529@lkp-g5.lkp.intel.com> (raw)
In-Reply-To: <1493400369-33879-1-git-send-email-oscar.mateo@intel.com>

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

--- 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)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      parent reply	other threads:[~2017-04-29 22:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-29 22:01 [PATCH] drm/i915: New vfunc prepare_request kbuild test robot
2017-04-28 17:26 ` Oscar Mateo
2017-04-29  0:46   ` ✓ Fi.CI.BAT: success for " Patchwork
2017-04-29  8:31   ` [PATCH] " Chris Wilson
2017-05-01  7:28     ` Oscar Mateo
2017-05-02  8:59       ` Chris Wilson
2017-05-02 15:17         ` Oscar Mateo
2017-04-29 22:01   ` kbuild test robot [this message]

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=20170429220107.GA6529@lkp-g5.lkp.intel.com \
    --to=lkp@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=kbuild-all@01.org \
    --cc=oscar.mateo@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