From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Blunck Subject: Re: [PATCH v7 06/15] bus: add helper to find which bus holds a device Date: Fri, 30 Jun 2017 18:46:31 +0200 Message-ID: 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="UTF-8" Cc: dev , =?UTF-8?Q?Ga=C3=ABtan_Rivet?= , Shreyansh Jain To: Thomas Monjalon Return-path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id 69CC31C0B for ; Fri, 30 Jun 2017 18:46:32 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id 77so39580461wrb.3 for ; Fri, 30 Jun 2017 09:46:32 -0700 (PDT) In-Reply-To: <2216663.aYTdufOMPG@xps> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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?