From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v8 6/6] devargs: parse bus info Date: Sat, 08 Jul 2017 22:31:39 +0200 Message-ID: <2387863.K5ZdIjvSud@xps> References: <20170706174502.0eaa5d0c@xeon-e3> <20170707083135.GP11154@bidouze.vm.6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: =?ISO-8859-1?Q?Ga=EBtan?= Rivet , Stephen Hemminger Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 361852B9E for ; Sat, 8 Jul 2017 22:31:41 +0200 (CEST) In-Reply-To: <20170707083135.GP11154@bidouze.vm.6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 07/07/2017 10:31, Ga=EBtan Rivet: > 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: > >=20 > > > +static int > > > +bus_name_cmp(const struct rte_bus *bus, const void *_name) > > > +{ > > > + const char *name =3D _name; > > > + > > > + return strncmp(bus->name, name, > > > + strlen(bus->name)); > >=20 > > I don't think you need the _name variable hack. C will cast the argumen= t to strncmp >=20 > 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. Simplified when applying.