From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=iv9skVpzMhEQcQve3jJR/lR1R+BXvPAG2wM6nCF1I0U=; b=Sds7U55ErGL2gvMbXMvsrcbqZM7b3Xq+9o16tOgm+Z+4PNftd0LTnbNX8KyjqTJrx8 wGZzfAHFbwppmcc+eGC2IL8+XReIefGGD/0YzJJXmWXylbtKMRRlSw+eL/pS5lafrUbx Klz0q5IfKj8x1peYqSst4rVbuUIi9uK8btoEAEweZ7/S1fHVwkt9VEBfzb0kpolnaN5l xX5lliGvBwWc8e/d0fEXoWesSVRLbR3HyOMBJ2aZPSVnGwhE83EPzt2vJEC/HLQqdjl3 /ErFxDSAq0SDU4DYYCf2mFG+5NVrL3APXyBFLVlEWX1dYLW+1NmvHcrrT/qyL+boBuXD mNew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=iv9skVpzMhEQcQve3jJR/lR1R+BXvPAG2wM6nCF1I0U=; b=o3AcF/FTQe4MCy3TYlny8jLuH0M0X3VODErOcgR+xj8G9dGccgmU0+OFciQFDcaEAF RDoVAsOGNGa3lXfcmNJAGa4PDat5r7X23XGNUw8mHyR2MSuFUJfa/L9cBES0fWF/LApa DCUrs0LmKvKtajrtUIF49+bkz1U9QrYHo7xPib9m29Nw9OEIh0wPZeXOacHPsm3IuKOY wDGsNY5IoUkCaP6aaGa2IdD3pagKxuGruK51ie6ERW8qIyrENFv0fefYUgzwUcOYkKMz RWZ6OCLgJFSxvBrVDSCTJ3q/25C86rK5Cf9ODbrqDxiIUY9FBb9e79v353Tb5WNkDvLq 925Q== X-Gm-Message-State: AKS2vOyE/7BVSL59W7uOUmPbPemL7LQj9uTiu3RRqneuMHpq+pJHP2JC AXSe+bSc0xQn09dzOH1eaX/lfaqaxQ== X-Received: by 10.223.182.172 with SMTP id j44mr21217745wre.122.1498841192132; Fri, 30 Jun 2017 09:46:32 -0700 (PDT) MIME-Version: 1.0 Sender: jblunck@gmail.com Received: by 10.28.5.136 with HTTP; Fri, 30 Jun 2017 09:46:31 -0700 (PDT) In-Reply-To: <2216663.aYTdufOMPG@xps> References: <20170629182206.1072-1-jblunck@infradead.org> <20170629182206.1072-7-jblunck@infradead.org> <2216663.aYTdufOMPG@xps> From: Jan Blunck Date: Fri, 30 Jun 2017 18:46:31 +0200 X-Google-Sender-Auth: UBjMw153LkXVJaR4EP0_wWtRsz0 Message-ID: To: Thomas Monjalon Cc: dev , =?UTF-8?Q?Ga=C3=ABtan_Rivet?= , Shreyansh Jain Content-Type: text/plain; charset="UTF-8" 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 16:46:32 -0000 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?