From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id 36A65691A for ; Wed, 8 Mar 2017 23:04:03 +0100 (CET) Received: by mail-wm0-f43.google.com with SMTP id n11so125893599wma.1 for ; Wed, 08 Mar 2017 14:04:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=m4DSAOXEgATZEG3+tRvruX/rrd3xfJeaB1e2Xen6GwY=; b=ObgJiCiVlJUzWbjlUvsCJeXeomaUswPg6hqXtFEjpDULHXXu/4Gi8g0L0+NgNM9cpV WW3gQDv2qPOANufJ4EDGJGOsT+MsSQMLN6luiUgLJH3F2pGOrrHibEEmfe+Yp9fOXWHh pMJvqB5YnEHul5lsGrz+mCDv31rI9Y0swY6EvznSVKgkmguyXGdblBGRwbJJy63PixqF dgZfzbpRbmzfxLkGuV5lJgYGAWaxhjnDnCiLWzqhF/svzfAe9KMf5jMZqyuGy5iUXgWW C6cJBvsjxhMcuEDXzk+GyVw31ErWM8qiyFbAC8w8vQz3L6nsRRf5OHKiVn3e0ViYy6j1 5uiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=m4DSAOXEgATZEG3+tRvruX/rrd3xfJeaB1e2Xen6GwY=; b=uSBkMhtNsWrr2wMKIZuG8pmBhHJSxs+rpOdFRm70wlU/NmUIvcwcs+Ik8BgSOKdU9Y DQqkPOTsxSCcJY3xG9wN2t8hMjpEmfJuNddXWpW1dmrAVKzqIW/ainYzJsee+LXmQsU2 e71i+G6jbggZlCIRdJFiF5vSgR+EL6OShgXa4ziRh0A1/7LGPbq2VN5OzOYgqm65lcXd bz881Q6dcjCu2GoiHzfUzv9N43s/BT4nUFNx0miUFjSbY1Q5hYDWRfLnXwoOGgav8uwI nHBRWTE1ROrI1jGZx4flkxvxNeC856C+78b2yf0XapD0lbUc9JliDuzTloWq4Sq+QdFe LlsQ== X-Gm-Message-State: AMke39nLjcNmSRfUbIwf16AVkJJf+q5pgqAc9fO82sLnUiEcatjnU7rpfAGVAKMyLleKd9YL X-Received: by 10.28.132.20 with SMTP id g20mr7770454wmd.68.1489010643017; Wed, 08 Mar 2017 14:04:03 -0800 (PST) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id e72sm6359811wma.5.2017.03.08.14.04.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Mar 2017 14:04:02 -0800 (PST) From: Thomas Monjalon To: Aaron Conole Cc: dev@dpdk.org, Stephen Hemminger , Bruce Richardson Date: Wed, 08 Mar 2017 23:04:01 +0100 Message-ID: <17738287.G52ncJujDH@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <20170228185315.12546-21-aconole@redhat.com> References: <20170227161811.12309-1-aconole@redhat.com> <20170228185315.12546-1-aconole@redhat.com> <20170228185315.12546-21-aconole@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v6 20/26] eal_pci: continue probing even on failures X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Mar 2017 22:04:03 -0000 2017-02-28 13:53, Aaron Conole: > + int ret_1 = 0; You do not need to add a new variable. > int ret = 0; > > if (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED_PCI) == 0) > @@ -430,17 +432,20 @@ rte_eal_pci_probe(void) > > /* probe all or only whitelisted devices */ > if (probe_all) > - ret = pci_probe_all_drivers(dev); > + ret_1 = pci_probe_all_drivers(dev); > else if (devargs != NULL && > devargs->type == RTE_DEVTYPE_WHITELISTED_PCI) > - ret = pci_probe_all_drivers(dev); > - if (ret < 0) > - rte_exit(EXIT_FAILURE, "Requested device " PCI_PRI_FMT > + ret_1 = pci_probe_all_drivers(dev); > + if (ret_1 < 0) { > + RTE_LOG(ERR, EAL, "Requested device " PCI_PRI_FMT > " cannot be used\n", dev->addr.domain, dev->addr.bus, > dev->addr.devid, dev->addr.function); > + rte_errno = errno; > + ret = 1; > + } > } > > - return 0; > + return -ret; It may be more explicit to use only one variable ret and filter the positive values: ret < 0 ? -1 : 0