Re: [PATCH 09/12] perf diff: Add weighted diff computation way tocompare hist entries

From: Arnaldo Carvalho de Melo
Date: Fri Sep 07 2012 - 11:32:05 EST


Em Fri, Sep 07, 2012 at 10:33:04PM +0900, Namhyung Kim escreveu:
> 2012-09-07 (ê), 11:28 +0200, Jiri Olsa:
> > On Fri, Sep 07, 2012 at 02:58:19PM +0900, Namhyung Kim wrote:
> > > I don't see why this do { } while(0) loop is necessary.
> > > How about this?
> > >
> > > w1 = strtol(opt, &tmp, 10);
> > > if (*tmp != ',')
> > > goto error;
> > >
> > > opt = tmp + 1;
> > > w2 = strtol(opt, &tmp, 10);
> > > if (*tmp != '\0')
> > > goto error;
> > >
> > > if (!w1 || !w2)
> > > goto error;
> >
> > I do this not to use labels & goto ;)
>
> But isn't it usual? Do you have a reason not to do it?

People don't like goto's, but that is overstated, for error handling it
is perfectly fine :-)

> I was a bit confused finding which path actually make it a loop... but
> there's none. :-/

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/