From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 5FDA03772 for ; Fri, 30 Jun 2017 11:17:17 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E984C20CF3; Fri, 30 Jun 2017 05:17:16 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Fri, 30 Jun 2017 05:17:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=m4KmisYuuAYx8Ey e7m/eA3ZjcAgnSoj/NNlfZFdTV9Y=; b=bQEjwV1+eGEAKDJRZXm12Oa6mJYkroK PTtaZdoVYuli4vEIuyE2nZXrHPG+WhNBPj+7qeYEY6DRm1BdllNpGNNzF7+N7Qol kqmgiZzecswJRGj8ITXv5nycVJ2Fpz4rII3RH7PnTkEXQIcSUrs9Ca2ah6WY4lrO athsMxtY2gKY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=m4KmisYuuAYx8Eye7m/eA3ZjcAgnSoj/NNlfZFdTV9Y=; b=NUqkX4Rg K4gmPoWch8gLybq0z0kMQd+WU/z4da3qZ5MfGF4meLLWWpyHps9HBJgVTr5F+hcc 5XvfrEW76srw94UFozi1tN7w24CbYy6wSMS4v4BTmucXGDx04DWp2IkdxEOTPcSp iPlQjUuKVqKvz5dcgdly0suxTQ4QfHVICX8xXeHY4S2gOhsdErLOLNFL+UvZwbgl cVx5LuMJAaAKlSXNkhZBeXnDueeFrrIS2+bV7HsT8wt/CiDC85/JrwcEEoJPZS6+ OxLSVrG+ibZsmYE8uShBFjPUr96oxX8QSmFFRPUzCQFgVpicaEfMuGGzKQ0SCurT V2osSWBgXadL3Q== X-ME-Sender: X-Sasl-enc: sx7mlBPGtIAF8hrQm62QLutAvN/AcjPbkW8rA9J+dfvj 1498814236 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 992A47E5C8; Fri, 30 Jun 2017 05:17:16 -0400 (EDT) From: Thomas Monjalon To: Jan Blunck Cc: dev@dpdk.org, gaetan.rivet@6wind.com, shreyansh.jain@nxp.com Date: Fri, 30 Jun 2017 11:17:15 +0200 Message-ID: <22398975.b6YjXl182b@xps> In-Reply-To: <20170629182206.1072-8-jblunck@infradead.org> References: <20170629182206.1072-1-jblunck@infradead.org> <20170629182206.1072-8-jblunck@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v7 07/15] bus: add bus iterator to find a device 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: Fri, 30 Jun 2017 09:17:17 -0000 29/06/2017 20:21, Jan Blunck: > +struct rte_device * > +rte_bus_find_device(const struct rte_device *start, rte_dev_cmp_t cmp, > + const void *data) > +{ > + struct rte_bus *bus; > + struct rte_device *dev = NULL; > + > + TAILQ_FOREACH(bus, &rte_bus_list, next) { > + dev = bus->find_device(start, cmp, data); > + if (dev) Same nit as previous patch, better to make explicit dev != NULL. > + break; > + } > + return dev; > +}