From patchwork Thu Apr 13 10:15:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 9679145 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 18AFB60381 for ; Thu, 13 Apr 2017 10:16:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0526628654 for ; Thu, 13 Apr 2017 10:16:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED72F28659; Thu, 13 Apr 2017 10:16:08 +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 24FB028654 for ; Thu, 13 Apr 2017 10:16:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BF0096E16B; Thu, 13 Apr 2017 10:16:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 12C296E16B for ; Thu, 13 Apr 2017 10:16:04 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP; 13 Apr 2017 03:16:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.37,194,1488873600"; d="scan'208"; a="1134967194" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga001.fm.intel.com with ESMTP; 13 Apr 2017 03:16:02 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1cybpB-000QVz-Ch; Thu, 13 Apr 2017 18:18:01 +0800 Date: Thu, 13 Apr 2017 18:15:47 +0800 From: kbuild test robot To: Dave Airlie Subject: [PATCH] sync_file: fix ptr_ret.cocci warnings Message-ID: <20170413101547.GA27778@lkp-wsm-ep2> References: <201704131844.YtryZJhU%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201704131844.YtryZJhU%fengguang.wu@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: kbuild-all@01.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP drivers/dma-buf/sync_file.c:36: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 Signed-off-by: Fengguang Wu --- sync_file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/drivers/dma-buf/sync_file.c +++ b/drivers/dma-buf/sync_file.c @@ -33,9 +33,7 @@ static int fence_file_init(struct fence_ { fence_file->file = anon_inode_getfile("fence_file", fops, fence_file, 0); - if (IS_ERR(fence_file->file)) - return PTR_ERR(fence_file->file); - return 0; + return PTR_ERR_OR_ZERO(fence_file->file); } static struct sync_file *sync_file_alloc(void)