From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D60BBC43441 for ; Sat, 10 Nov 2018 22:45:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A508D21104 for ; Sat, 10 Nov 2018 22:45:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A508D21104 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727374AbeKKIc0 (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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <154180134334.31154.16289123769826098135.stgit@gimli.home> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)