From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 44E202BE1 for ; Wed, 28 Jun 2017 01:46:52 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jun 2017 16:46:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,272,1496127600"; d="scan'208";a="102093660" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga004.jf.intel.com with ESMTP; 27 Jun 2017 16:46:49 -0700 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 27 Jun 2017 16:46:49 -0700 Received: from fmsmsx113.amr.corp.intel.com ([169.254.13.51]) by FMSMSX157.amr.corp.intel.com ([169.254.14.168]) with mapi id 14.03.0319.002; Tue, 27 Jun 2017 16:46:48 -0700 From: "Wiles, Keith" To: Gaetan Rivet CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v5 16/19] devargs: introduce cleaner parsing helper Thread-Index: AQHS75+kQ8/zVv3dtk+bqpNJywP2hQ== Date: Tue, 27 Jun 2017 23:46:48 +0000 Message-ID: <7BAD764D-F3B7-4426-B820-B493CE9385DA@intel.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.94.72] Content-Type: text/plain; charset="utf-8" Content-ID: <420B15D69AC15A4D9A3E65A6723B7333@intel.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v5 16/19] devargs: introduce cleaner parsing helper 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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