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 1FDB43772 for ; Fri, 30 Jun 2017 11:16:10 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B31ED20C14; Fri, 30 Jun 2017 05:16:09 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 30 Jun 2017 05:16:09 -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=kYptClZXt1e1Uh8 ln/YMiOkxwgOfHCEoVhfqtm4Fd7Y=; b=Ov5vFJL//xfGLYuRZlR+eFj0o1J0SIa 1h4lor4qNVMP7cieiEV00PLiWvbL4iTF3y1UAEbmLcPO7m2PQONHeY9TtgGn5a0i Y2scibOYZNkc/XRoEa5xdlbaECwVMAozDX/n5Xh/o08/coMSIdFGxWqEWdLKH3ql KqUthzK7omk0= 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=kYptClZXt1e1Uh8ln/YMiOkxwgOfHCEoVhfqtm4Fd7Y=; b=Nn0tD/nq dII959UBQe9epAoE99Ii7IkttmTERnkJGEwhxwmA6aG7dmHgb5pyGKztb0aFWo/w n76gCu5KPX0jkaYOLtyjgyMaAD5MA2Q+zSXFzjY4h3KX0FE90yN+kcbwxI5a3baR HfaP7sH6AYnFw3N+ukFRMcbiVP2gkk5hIjx0qbRRVV+QX1qCX+ynhiX2XCHxnght fFcoOyALn2a0Hr81J9qA9F1L0jZXw/nomiL9A4II07Zo3c7hlRsacvK7KmYRmtMQ h4VFLpyWfPRciyR8CHc5OaEwXM/uT2uHD8jnin42fIKnWyFCzFsEyjblrA3zms2Z AA6bjItK5a9m5g== X-ME-Sender: X-Sasl-enc: 4nforbugRoxH6ZoltpgC8hU9Wv46iR/7+VsKm05HNxqI 1498814169 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 376FF246E8; Fri, 30 Jun 2017 05:16:09 -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:16:08 +0200 Message-ID: <2216663.aYTdufOMPG@xps> In-Reply-To: <20170629182206.1072-7-jblunck@infradead.org> References: <20170629182206.1072-1-jblunck@infradead.org> <20170629182206.1072-7-jblunck@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v7 06/15] bus: add helper to find which bus holds 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:16:10 -0000 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;