From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756430AbbCBRa5 (ORCPT ); Mon, 2 Mar 2015 12:30:57 -0500 Received: from foss.arm.com ([217.140.101.70]:48098 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753444AbbCBRa4 (ORCPT ); Mon, 2 Mar 2015 12:30:56 -0500 Date: Mon, 2 Mar 2015 17:30:53 +0000 From: Javi Merino To: Steven Rostedt Cc: "acme@redhat.com" , "jolsa@redhat.com" , "linux-kernel@vger.kernel.org" , Namhyung Kim Subject: Re: [PATCH v6 1/2] tools lib traceevent: factor out allocating and processing args Message-ID: <20150302173052.GA15351@e104805> References: <1425048495-10271-1-git-send-email-javi.merino@arm.com> <1425048495-10271-2-git-send-email-javi.merino@arm.com> <20150227103841.0e9f55d8@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150227103841.0e9f55d8@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 27, 2015 at 03:38:41PM +0000, Steven Rostedt wrote: > On Fri, 27 Feb 2015 14:48:14 +0000 > Javi Merino wrote: > > > > +static int alloc_and_process_arg(struct event_format *event, char *next_token, > > + struct print_arg **print_arg) > > +{ > > + struct print_arg *field; > > + enum event_type type; > > + char *token; > > + int ret = 0; > > + > > + field = alloc_arg(); > > + if (!field) { > > + do_warning_event(event, "%s: not enough memory!", __func__); > > + errno = ENOMEM; > > + return -1; > > + } > > + > > + type = process_arg(event, field, &token); > > + > > + if (test_type_token(type, token, EVENT_DELIM, next_token)) { > > I wonder if we should call this "alloc_and_process_delim()", as this > isn't a generic arg, but only used for deliminators. Ok, I'll send a v7 renaming this function. Cheers, Javi