From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 84DFA5689 for ; Fri, 30 Jun 2017 23:25:11 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jun 2017 14:25:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,288,1496127600"; d="scan'208";a="280813746" Received: from unknown ([10.252.11.213]) by fmsmga004.fm.intel.com with SMTP; 30 Jun 2017 14:25:06 -0700 Received: by (sSMTP sendmail emulation); Fri, 30 Jun 2017 22:25:06 +0100 Date: Fri, 30 Jun 2017 22:25:06 +0100 From: Bruce Richardson To: Jan Blunck Cc: Thomas Monjalon , dev , =?iso-8859-1?Q?Ga=EBtan?= Rivet , Shreyansh Jain Message-ID: <20170630212505.GB19236@bricha3-MOBL3.ger.corp.intel.com> References: <20170629182206.1072-1-jblunck@infradead.org> <20170629182206.1072-7-jblunck@infradead.org> <2216663.aYTdufOMPG@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Research and =?iso-8859-1?Q?De=ACvel?= =?iso-8859-1?Q?opment?= Ireland Ltd. User-Agent: Mutt/1.8.1 (2017-04-11) 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 21:25:12 -0000 On Fri, Jun 30, 2017 at 06:46:31PM +0200, Jan Blunck wrote: > 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? Please do.