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 BC7982BE1 for ; Fri, 30 Jun 2017 20:29:08 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 2315D20BDE; Fri, 30 Jun 2017 14:29:08 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 30 Jun 2017 14:29:08 -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=KeaYrOFnQ0uprLN VynFRLif/fQsLJLhX2J7qAFn+1Ps=; b=WM6ilqe8k+L1IHQqJRyc4xpv25YZ72I ZjM+gUUyhnnnPilyeDjjPwU6kZ+RJ7HlNJ+NYtu562uSwwiMXOl8ID6LWvJOO+fG BH8OG1rPKJptGqdDEOmFyUZpUeMyZcvy7CWMY94OZkrsOU6EK69LzrF1gQFpERLL zMKVYVC0hxp4= 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=KeaYrOFnQ0uprLNVynFRLif/fQsLJLhX2J7qAFn+1Ps=; b=TvTMiSrb nwqL4ntC42cVr25zyXidmsuW1ck2dqXBXviZJTza1gHjk4zN7r0Po+CrRCGPtty+ SmzwCHp8E/kH8VhKLuprSiwS6GjE/zdHEX2FSEg2lnNhnz+Q1yGZDvDykf8W91ft sKivT5vZVrIFncGKxCMKP/KweYUUKtHgIbO5a6r47Na/3O/KmP+sG9Wnk9NVeQap CICo2ruHTlgQY6gcbmvEa66Z8FoCg3UEOoDcEfM2mDTOIEO6/M8N9dohY4d1UHZs Fz5Ht0l/qPqHUlV92etTqx/XNqOLb8C+RQh17P0L1CH/5fw9dKObaQhCeLbHHtMi DI09dtuHKy+j7A== X-ME-Sender: X-Sasl-enc: 0ZyvPmDfX7ZoXgLC/zVx6YFgERWAjzKRl0PTVtG/ktIb 1498847347 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id B43EC247E8; Fri, 30 Jun 2017 14:29:07 -0400 (EDT) From: Thomas Monjalon To: Jan Blunck Cc: dev@dpdk.org, =?ISO-8859-1?Q?Ga=EBtan?= Rivet , Shreyansh Jain Date: Fri, 30 Jun 2017 20:29:06 +0200 Message-ID: <1635095.dVgJJgmtZI@xps> In-Reply-To: References: <2216663.aYTdufOMPG@xps> 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 18:29:09 -0000 30/06/2017 18:46, Jan Blunck: > On Fri, Jun 30, 2017 at 11:16 AM, Thomas Monjalon wrote: > > 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; > > Oh, interesting ... not a lot of C++ programmers around here I guess. > > Does this mean you also want me to make integer tests explicit again 0? Good question, I don't know. I know only this part of the coding rules: http://dpdk.org/doc/guides/contributing/coding_style.html#null-pointers