From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet Subject: Re: [PATCH v8 6/6] devargs: parse bus info Date: Fri, 7 Jul 2017 10:31:35 +0200 Message-ID: <20170707083135.GP11154@bidouze.vm.6wind.com> References: <20170706174502.0eaa5d0c@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org To: Stephen Hemminger Return-path: Received: from mail-wr0-f179.google.com (mail-wr0-f179.google.com [209.85.128.179]) by dpdk.org (Postfix) with ESMTP id 339ED2C2B for ; Fri, 7 Jul 2017 10:31:44 +0200 (CEST) Received: by mail-wr0-f179.google.com with SMTP id c11so36448368wrc.3 for ; Fri, 07 Jul 2017 01:31:44 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20170706174502.0eaa5d0c@xeon-e3> 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 Thu, Jul 06, 2017 at 05:45:02PM -0700, Stephen Hemminger wrote: > On Fri, 7 Jul 2017 02:03:12 +0200 > Gaetan Rivet wrote: > > > +static int > > +bus_name_cmp(const struct rte_bus *bus, const void *_name) > > +{ > > + const char *name = _name; > > + > > + return strncmp(bus->name, name, > > + strlen(bus->name)); > > I don't think you need the _name variable hack. C will cast the argument to strncmp You're right, and it was just habit. Usually I prefer giving a type to a generic parameter, but in this case it may be too trivial. -- Gaëtan Rivet 6WIND