From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id A39C9A00E6 for ; Fri, 22 Mar 2019 02:34:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 797831B537; Fri, 22 Mar 2019 02:34:11 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id ACB785424; Fri, 22 Mar 2019 02:34:09 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2019 18:34:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,255,1549958400"; d="scan'208";a="284807783" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by orsmga004.jf.intel.com with ESMTP; 21 Mar 2019 18:34:07 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.210]) by KMSMSX151.gar.corp.intel.com ([169.254.10.186]) with mapi id 14.03.0415.000; Fri, 22 Mar 2019 09:34:06 +0800 From: "Zhao1, Wei" To: Stephen Hemminger CC: "dev@dpdk.org" , "stable@dpdk.org" , "Zhang, Qi Z" , "adrien.mazarguil@6wind.com" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: fix support of hex string parser for flow API Thread-Index: AQHU2w8bEOV32BsCHkKcl2WsWcFrNaYRAd2AgAXmBXA= Date: Fri, 22 Mar 2019 01:34:05 +0000 Message-ID: References: <1552639435-68184-1-git-send-email-wei.zhao1@intel.com> <20190318082707.1dfb60d7@shemminger-XPS-13-9360> In-Reply-To: <20190318082707.1dfb60d7@shemminger-XPS-13-9360> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] app/testpmd: fix support of hex string parser for flow API X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, Stephen Hemminger > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Monday, March 18, 2019 11:27 PM > To: Zhao1, Wei > Cc: dev@dpdk.org; stable@dpdk.org; Zhang, Qi Z ; > adrien.mazarguil@6wind.com > Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix support of hex string > parser for flow API >=20 > On Fri, 15 Mar 2019 16:43:55 +0800 > Wei Zhao wrote: >=20 > > + /* Check input parameters */ > > + if ((src =3D=3D NULL) || > > + (dst =3D=3D NULL) || > > + (size =3D=3D NULL) || > > + (*size =3D=3D 0)) > > + return -1; > > + if ((*size & 1) !=3D 0) > > + return -1; > > + > > + for (c =3D src, i =3D 0; i < *size; c++, i++) { > > + if ((((*c) >=3D '0') && ((*c) <=3D '9')) || > > + (((*c) >=3D 'A') && ((*c) <=3D 'F')) || > > + (((*c) >=3D 'a') && ((*c) <=3D 'f'))) > > + continue; > > + >=20 > Excessive number of parens here. You don't need them around (*c) >=20 > Why did you not use isxdigit() instead? Ok, I will have a try of isxdigit() and update in v2.