From mboxrd@z Thu Jan 1 00:00:00 1970 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 EBAD91B783 for ; Mon, 9 Apr 2018 10:16:39 +0200 (CEST) Received: by mail-wr0-f179.google.com with SMTP id s12so8372828wrc.8 for ; Mon, 09 Apr 2018 01:16:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=K0nsstA3shkDykPqE8o1h5VvJNoAlzB0w4K7QrR3tuw=; b=Kq+tIx76Y+9X0mbej8BI6gTWTultghq9MTeA/PU3nxjiKVhX9yDFHYmm79JvDhm4Yz sK56rPMFQ9ClD4TyqdCFa/KtOdR2W/WnMnIp8xZJ/PQoDARGqp8e+xTRhJClYAxf73RL IwtQ5d0q/unkD0/Im8EaWMlARQ8iMNy8+eKB3ERhH43Co2B6cMxmD9GJwVce7+NAtMfC S/EjWv3Yr+okgnBPY9Uyh6ntD9WQVijbPHtSy/X0ngqXPapHN0/3iZcxtM71X3pTX8AB AWfWikioXkOFxr3/8lHUKcLLuPJ/l3EuKHag+YrZcen+Wtp3U8jMNivEEOuPqJ63oftN W58g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=K0nsstA3shkDykPqE8o1h5VvJNoAlzB0w4K7QrR3tuw=; b=nzw3AVhX4iVMwauS/f2pyvGhEf6HA7G7ipe09ltEHbVl2EkCTt7DZizkbu0tVVstN3 ItvgG67Q4QVMDDOQTu0PgbumJL2+sJVfKLi7aZ1qoWnFyKJE6y5sAWAQwW38HIw+QM8X 9RkYJFGzk5KJl337gXsyTbBvTJHLTd2DpAvRasIOsYhz127cKnmFzYff7ecy4ba0F7w2 Td338Jo8/qk3IzmLVQd3uplRU8/OgpaByjRRRl5wqSk7SJKEcTrlPsGQ6enmwWbdVITx WVJScMT1L3Qtis+rd2sFyS9q6Gz1ElVsT/v6UBDLDiugfLFwlsvBPwWr2tGFyvW5zBa/ /qlQ== X-Gm-Message-State: AElRT7FZ1nh2D/Ii2YEGb3CDdiucAqUXE5knn/so/1qeDZoIpkHY9Mdm O0BILct6pLq3Kv0avyNUApcFmg== X-Google-Smtp-Source: AIpwx493Rk6F7vnX6Hr81ptYyDZ6blqXlKCi7xgrUWNHC3AGvaI0Stn8bOJeTtkKAsIn+Bal9OK5GA== X-Received: by 10.223.130.102 with SMTP id 93mr22792719wrb.97.1523261799675; Mon, 09 Apr 2018 01:16:39 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 140sm85500wmy.38.2018.04.09.01.16.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Apr 2018 01:16:38 -0700 (PDT) Date: Mon, 9 Apr 2018 10:16:25 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Matan Azrad Cc: "dev@dpdk.org" Message-ID: <20180409081625.amvkpxp2ctthsxg5@bidouze.vm.6wind.com> References: <5d94711adb1333f2d4ef1f4a081ccd481f3810aa.1522358421.git.gaetan.rivet@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v4 10/20] eal/dev: implement device iteration 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: Mon, 09 Apr 2018 08:16:40 -0000 On Mon, Apr 09, 2018 at 07:28:00AM +0000, Matan Azrad wrote: > HI Gaetan > > From: Gaetan Rivet, Friday, March 30, 2018 12:24 AM > > +/* '\0' forbidden in sym */ > > +static const char * > > +strfirstof(const char *str, > > + const char *sym) > > +{ > > + const char *s; > > + > > + for (s = str; s[0] != '\0'; s++) { > > + const char *c; > > + > > + for (c = sym; c[0] != '\0'; c++) { > > + if (c[0] == s[0]) > > + return s; > > + } > > + } > > + return NULL; > > +} > > + > > I think you can use strcspn() instead... > Indeed, didn't know about it, I will change it. -- Gaëtan Rivet 6WIND