[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150123084416.GA2709@krava.brq.redhat.com>
Date: Fri, 23 Jan 2015 09:44:17 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Wang Nan <wangnan0@...wei.com>
Cc: jeremie.galarneau@...icios.com, rostedt@...dmis.org,
bigeasy@...utronix.de, lizefan@...wei.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC 2/2] perf: convert: fix duplicate field names and
avoid reserved keywords.
On Fri, Jan 23, 2015 at 10:53:07AM +0800, Wang Nan wrote:
SNIP
> >> SNIP
> >>
> >>>
> >>> +/* If dup < 0, add a prefix. Else, add _dupl_X suffix. */
> >>> +static char *change_name(char *name, char *orig_name, int dup)
> >>> +{
> >>> + char *new_name = NULL;
> >>> + size_t len;
> >>> +
> >>> + if (!name)
> >>> + name = orig_name;
> >>> +
> >>> + if (dup >= 10)
> >>> + goto out;
> >>> +
> >>> + if (dup < 0)
> >>> + len = strlen(name) + sizeof("_");
> >>> + else
> >>> + len = strlen(orig_name) + sizeof("_dupl_X");
> >>
> >> if we allow for _dupl_10, should we use 'sizeof("_dupl_x")' ^^^ in here?
> >>
>
> We don't allow _dupl_10. If dup is 10 or larger (see above two if clause), this function will
> return NULL.
ouch right.. ok ;-)
thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists