From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v4 1/9] bus: add bus iterator to find a particular bus Date: Wed, 21 Jun 2017 14:12:11 +0200 Message-ID: <2233259.EIshgydRbt@xps> References: <7dcba05e933f8779a2fdc9bba0ecea7a25a0848f.1497999601.git.gaetan.rivet@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Jan Blunck To: Gaetan Rivet Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 5B443374 for ; Wed, 21 Jun 2017 14:12:12 +0200 (CEST) In-Reply-To: <7dcba05e933f8779a2fdc9bba0ecea7a25a0848f.1497999601.git.gaetan.rivet@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 21/06/2017 01:29, Gaetan Rivet: > +/** > + * Bus iterator to find a particular bus. > + * > + * If the callback returns zero this function will stop iterating over > + * any more buses. > + * If the start parameter is non-NULL, the comparison will only be determined > + * past this element. > + * > + * @param cmp > + * Comparison function. > + * > + * @param data > + * Data to pass to cmp callback > + * > + * @param start > + * Starting point for the iteration. > + * > + * @return > + * A pointer to a rte_bus structure or NULL in case no bus matches > + */ > +struct rte_bus *rte_bus_find(rte_bus_cmp_t cmp, > + const void *data, > + const struct rte_bus *start); > What will be the typical usage? find by name? Does it make sense to implement a helper for find_by_name? Or is it used only for rte_bus_find_by_device()?