From patchwork Sat Nov 10 22:44:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 10677449 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 18919109C for ; Sat, 10 Nov 2018 22:45:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F33EA2C227 for ; Sat, 10 Nov 2018 22:45:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E079C2C225; Sat, 10 Nov 2018 22:45:55 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8111D2C225 for ; Sat, 10 Nov 2018 22:45:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727364AbeKKIc0 (ORCPT ); Sun, 11 Nov 2018 03:32:26 -0500 Received: from mga07.intel.com ([134.134.136.100]:63594 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbeKKIcZ (ORCPT ); Sun, 11 Nov 2018 03:32:25 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Nov 2018 14:45:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,489,1534834800"; d="scan'208";a="90157746" Received: from lkp-server01.sh.intel.com (HELO lkp-server01) ([10.239.97.150]) by orsmga006.jf.intel.com with ESMTP; 10 Nov 2018 14:45:49 -0800 Received: from kbuild by lkp-server01 with local (Exim 4.89) (envelope-from ) id 1gLc0i-000GQI-Kq; Sun, 11 Nov 2018 06:45:48 +0800 Date: Sun, 11 Nov 2018 06:44:51 +0800 From: kbuild test robot To: Alex Williamson Cc: kbuild-all@01.org, alex.williamson@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, christian.ehrhardt@canonical.com Subject: [PATCH] vfio/pci: fix ptr_ret.cocci warnings Message-ID: <20181110224451.GA23585@lkp-ne04> References: <154180134334.31154.16289123769826098135.stgit@gimli.home> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <154180134334.31154.16289123769826098135.stgit@gimli.home> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: kbuild test robot drivers/vfio/pci/vfio_pci.c:1396:8-14: 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 Fixes: 25e57457f6f2 ("vfio/pci: Parallelize device open and release") CC: Alex Williamson Signed-off-by: kbuild test robot --- url: https://github.com/0day-ci/linux/commits/Alex-Williamson/vfio-pci-Parallelize-device-open-and-release/20181111-025016 base: https://github.com/awilliam/linux-vfio.git next vfio_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c @@ -1393,7 +1393,7 @@ static int vfio_pci_reflck_attach(struct mutex_unlock(&reflck_lock); - return IS_ERR(vdev->reflck) ? PTR_ERR(vdev->reflck) : 0; + return PTR_ERR_OR_ZERO(vdev->reflck); } static void vfio_pci_reflck_release(struct kref *kref)