[dpdk-dev] [PATCH] app/testpmd: fix support of hex string parser for flow API

Zhao1, Wei wei.zhao1 at intel.com
Fri Mar 22 02:34:05 CET 2019


Hi,  Stephen Hemminger

> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> Sent: Monday, March 18, 2019 11:27 PM
> To: Zhao1, Wei <wei.zhao1 at intel.com>
> Cc: dev at dpdk.org; stable at dpdk.org; Zhang, Qi Z <qi.z.zhang at intel.com>;
> adrien.mazarguil at 6wind.com
> Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix support of hex string
> parser for flow API
> 
> On Fri, 15 Mar 2019 16:43:55 +0800
> Wei Zhao <wei.zhao1 at intel.com> wrote:
> 
> > +	/* Check input parameters */
> > +	if ((src == NULL) ||
> > +		(dst == NULL) ||
> > +		(size == NULL) ||
> > +		(*size == 0))
> > +		return -1;
> > +	if ((*size & 1) != 0)
> > +		return -1;
> > +
> > +	for (c = src, i = 0; i < *size; c++, i++) {
> > +		if ((((*c) >= '0') && ((*c) <= '9')) ||
> > +			(((*c) >= 'A') && ((*c) <= 'F')) ||
> > +			(((*c) >= 'a') && ((*c) <= 'f')))
> > +			continue;
> > +
> 
> Excessive number of parens here. You don't need them around (*c)
> 
> Why did you not use isxdigit() instead?

Ok, I will have a try of isxdigit() and update in v2.


More information about the dev mailing list