Re: [PATCH 1/4] perf bench: Add new subsystem and new suite, bench/mem-memcpy.c

Hitoshi Mitake
2009-11-15T03:50:26Z

From: Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 1/4] perf bench: Add new subsystem and new suite, bench/mem-memcpy.c
Date: Fri, 13 Nov 2009 10:46:50 +0100

Thanks for your detailed review, Ingo.
I'll fix the points you mentioned, and,

> > + case 'B':
> > + case 'b':
> > + str[i] = '\0';
> > + break;
> > + case 'K':
> > + case 'k':
> > + if (str[i + 1] != 'B' && str[i + 1] != 'b')
> > + goto err;
> > + unit = K;
> > + str[i] = '\0';
> > + break;
> > + case 'M':
> > + case 'm':
> > + if (str[i + 1] != 'B' && str[i + 1] != 'b')
> > + goto err;
> > + unit = K * K;
> > + str[i] = '\0';
> > + break;
> > + case 'G':
> > + case 'g':
> > + if (str[i + 1] != 'B' && str[i + 1] != 'b')
> > + goto err;
> > + unit = K * K * K;
> > + str[i] = '\0';
> > + break;
> > + case '\0': /* only specified figures */
> > + unit = 1;
> > + break;
> > + default:
> > + if (!isdigit(str[i]))
> > + goto err;
> > + break;
> > + }
> > + }
> > +
> > + length = atoi(str) * unit;
> > + goto end;
> > +
> > +err:
> > + fprintf(stderr, "Invalid length:%s\n", str);
> > +end:
> > + free(str);
> > + return length;
> > +}
>
> This should go until a utils/*.c helper file i suspect.
>

before posting patch series mem-memcpy.c related to,
I'll send the patch to add the function that you should go util/.
Because I think this is the independent topic from mem-memcpy.c

Thanks
Hitoshi