[dpdk-dev] [PATCH v4 10/20] eal/dev: implement device iteration

Gaëtan Rivet gaetan.rivet at 6wind.com
Mon Apr 9 10:16:25 CEST 2018


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


More information about the dev mailing list