From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 80F152BE1 for ; Tue, 27 Jun 2017 17:59:43 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 27 Jun 2017 08:59:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,401,1493708400"; d="scan'208";a="104195500" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.28]) by orsmga002.jf.intel.com with SMTP; 27 Jun 2017 08:59:40 -0700 Received: by (sSMTP sendmail emulation); Tue, 27 Jun 2017 16:59:39 +0100 Date: Tue, 27 Jun 2017 16:59:39 +0100 From: Bruce Richardson To: Gaetan Rivet Cc: dev@dpdk.org Message-ID: <20170627155939.GC9796@bricha3-MOBL3.ger.corp.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Research and =?iso-8859-1?Q?De=ACvel?= =?iso-8859-1?Q?opment?= Ireland Ltd. User-Agent: Mutt/1.8.1 (2017-04-11) Subject: Re: [dpdk-dev] [PATCH v5 3/7] vdev: implement parse bus operation 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: Tue, 27 Jun 2017 15:59:45 -0000 On Wed, Jun 21, 2017 at 01:30:32AM +0200, Gaetan Rivet wrote: > Signed-off-by: Gaetan Rivet > --- > lib/librte_eal/common/eal_common_vdev.c | 60 +++++++++++++++++---------------- > 1 file changed, 31 insertions(+), 29 deletions(-) > > diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c > index 22e4640..8dd4c88 100644 > --- a/lib/librte_eal/common/eal_common_vdev.c > +++ b/lib/librte_eal/common/eal_common_vdev.c > @@ -104,6 +104,29 @@ static char *parse_driver_arg(const char *args) > return str; > } > > +/* > + * typeof(addr): (struct rte_vdev_driver **) > + */ > +static int > +vdev_parse(const char *name, void *addr) > +{ > + struct rte_vdev_driver **out = addr; > + struct rte_vdev_driver *driver = NULL; > + > + TAILQ_FOREACH(driver, &vdev_driver_list, next) { > + if (!strncmp(driver->driver.name, name, > + strlen(driver->driver.name))) > + break; > + if (driver->driver.alias && > + !strncmp(driver->driver.alias, name, > + strlen(driver->driver.alias))) > + break; > + } > + if (addr != NULL) > + *out = driver; > + return !driver; > +} > + Prefer == 0 to use of "!" in return value from strncmp. Otherwise: Acked-by: Bruce Richardson