From patchwork Sat Apr 29 22:01:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 9705961 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7863260245 for ; Sat, 29 Apr 2017 22:01:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59C0028210 for ; Sat, 29 Apr 2017 22:01:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A37728355; Sat, 29 Apr 2017 22:01:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DAD9428210 for ; Sat, 29 Apr 2017 22:01:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BB4B16E066; Sat, 29 Apr 2017 22:01:26 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id C9F8C6E066 for ; Sat, 29 Apr 2017 22:01:25 +0000 (UTC) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP; 29 Apr 2017 15:01:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,393,1488873600"; d="scan'208";a="95450526" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga005.fm.intel.com with ESMTP; 29 Apr 2017 15:01:24 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1d4aSU-000LpS-0e; Sun, 30 Apr 2017 06:03:18 +0800 Date: Sun, 30 Apr 2017 06:01:07 +0800 From: kbuild test robot To: Oscar Mateo Message-ID: <20170429220107.GA6529@lkp-g5.lkp.intel.com> References: <201704300554.vJAKPdaL%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1493400369-33879-1-git-send-email-oscar.mateo@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Cc: intel-gfx@lists.freedesktop.org, kbuild-all@01.org Subject: [Intel-gfx] [PATCH] drm/i915: fix ptr_ret.cocci warnings X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Fengguang Wu --- 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)