From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50087.outbound.protection.outlook.com [40.107.5.87]) by dpdk.org (Postfix) with ESMTP id 5CD581B719 for ; Mon, 9 Apr 2018 09:28:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/glhy/0q8heohRYSWOMYhz6l409poXNQMFshfx8rV0E=; b=wNQHkCECeaUvxUTs8NKfF62ETX7kIFHrhn+a9e/WIceoMDd0pNXS1sqH4c6ysA8srMFoQa8P/PxsM/7qCHCJfW5OkXCYWobO5O8EWaHiR8MhHx5FdJ3E6krSLdyp4prbPV4kUhNCxQLtfGEplgADXqPTx32S3Mtxtn8wECKp02s= Received: from AM4PR0501MB2657.eurprd05.prod.outlook.com (10.172.215.19) by AM4PR0501MB1921.eurprd05.prod.outlook.com (10.167.91.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.653.12; Mon, 9 Apr 2018 07:28:00 +0000 Received: from AM4PR0501MB2657.eurprd05.prod.outlook.com ([fe80::6885:c169:afcb:37e6]) by AM4PR0501MB2657.eurprd05.prod.outlook.com ([fe80::6885:c169:afcb:37e6%7]) with mapi id 15.20.0653.015; Mon, 9 Apr 2018 07:28:00 +0000 From: Matan Azrad To: Gaetan Rivet , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4 10/20] eal/dev: implement device iteration Thread-Index: AQHTx6SbxR5Yfl+6ekOqUK33zgKv3aP4Fc1w Date: Mon, 9 Apr 2018 07:28:00 +0000 Message-ID: References: <5d94711adb1333f2d4ef1f4a081ccd481f3810aa.1522358421.git.gaetan.rivet@6wind.com> In-Reply-To: <5d94711adb1333f2d4ef1f4a081ccd481f3810aa.1522358421.git.gaetan.rivet@6wind.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR0501MB1921; 7:zy6wOQ97yN3A+8gV8BLEeQd6Ov+xrCk8Mg/x6jGVY60Qh3h+7cNl26jrhchxWAM2RRrNow6GJCyYBMKxuYPI+XKQBmvCOl8Dj1ZSau8pQQ5rEplLnluMpYih3FlYTA7rLzGHMQMyS3cOFPLz6oe7ZMgBcIhEs9SrPOI/ArGCSP/nmaOvAT+N8vLscWO/mhNHDLRhy/rkhML8IDhHjr6Wo3UtwdLDuvtXa/i/tj3F536D3pQh96syfLTjj4hMNB/H x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: e9df6a8b-7957-48a9-87a9-08d59deb6c52 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM4PR0501MB1921; x-ms-traffictypediagnostic: AM4PR0501MB1921: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231221)(944501327)(52105095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:AM4PR0501MB1921; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB1921; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(376002)(39380400002)(39860400002)(346002)(199004)(189003)(316002)(81166006)(74316002)(66066001)(8676002)(476003)(486006)(81156014)(6436002)(446003)(86362001)(14454004)(2501003)(2906002)(5250100002)(11346002)(33656002)(25786009)(110136005)(6246003)(9686003)(3846002)(6116002)(53936002)(6506007)(97736004)(3660700001)(55016002)(229853002)(26005)(7736002)(8936002)(3280700002)(105586002)(2900100001)(5660300001)(7696005)(76176011)(106356001)(99286004)(68736007)(478600001)(102836004)(305945005)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB1921; H:AM4PR0501MB2657.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: D42g/tzgQS7k2UgKtsxmwlkDYKZgkcBx9+gzbI57iZObxfc1Z1S8RcmTvGq1mMNYHZIg9kVlr0Uz6gnoTchduucfPWRHibyM/qJLV3dT7OlZ7MfrBQrHmB7fYmEvO9ssmll+klXW6aDa4SVy9rrL3vh/BY7u9dgNrgIM5IkLe03ybzkjUOsA1ITHa9FH6NJnDdfXgMOkQV7n7p2N+DKrsgOjN15xZ0Rb8oFwaZEgCkLGTe4LrCw8LEK0FDPZBBmaSsVzZGnsqZhw2WEi4qgeiBGjSHPUoeirLs65xLapTa1XNjMBJez8Fd9YyO1eNlx7OksQ5hy3I8w1r++jPP4rhyr9bfTvpMU9SSkOSePeNwOWhsRTj5Fm0Aix46sMlk359eMAU0g6tkHRbyfTGg5vn8isez6Y0bz2xvS5LmXUmbY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9df6a8b-7957-48a9-87a9-08d59deb6c52 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 07:28:00.2235 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB1921 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 07:28:01 -0000 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 =3D str; s[0] !=3D '\0'; s++) { > + const char *c; > + > + for (c =3D sym; c[0] !=3D '\0'; c++) { > + if (c[0] =3D=3D s[0]) > + return s; > + } > + } > + return NULL; > +} > + I think you can use strcspn() instead...