From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v7 06/15] bus: add helper to find which bus holds a device Date: Fri, 30 Jun 2017 11:16:08 +0200 Message-ID: <2216663.aYTdufOMPG@xps> References: <20170629182206.1072-1-jblunck@infradead.org> <20170629182206.1072-7-jblunck@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, gaetan.rivet@6wind.com, shreyansh.jain@nxp.com To: Jan Blunck Return-path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 1FDB43772 for ; Fri, 30 Jun 2017 11:16:10 +0200 (CEST) In-Reply-To: <20170629182206.1072-7-jblunck@infradead.org> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 29/06/2017 20:21, Jan Blunck: > +static int > +bus_find_device(const struct rte_bus *bus, const void *_dev) > +{ > + struct rte_device *dev; > + > + dev = bus->find_device(NULL, cmp_rte_device, _dev); > + return !dev; > +} The preferred code style is to make explicit the NULL comparisons: return dev == NULL;