Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754744AbbB0Pip (ORCPT ); Fri, 27 Feb 2015 10:38:45 -0500 Received: from smtprelay0129.hostedemail.com ([216.40.44.129]:46872 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752386AbbB0Pio (ORCPT ); Fri, 27 Feb 2015 10:38:44 -0500 X-Session-Marker: 6E657665747340676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::,RULES_HIT:41:355:379:541:599:800:960:966:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:1981:2194:2196:2199:2200:2393:2553:2559:2562:3138:3139:3140:3141:3142:3352:3622:3876:3877:4385:5007:6114:6261:6642:7875:8660:9040:10004:10400:10450:10455:10848:10967:11026:11232:11658:11914:12296:12438:12517:12519:12740:13069:13138:13148:13230:13231:13255:13311:13357:14096:14097:19904:19999:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: bike11_4c01d25d4b849 X-Filterd-Recvd-Size: 1902 Date: Fri, 27 Feb 2015 10:38:41 -0500 From: Steven Rostedt To: Javi Merino 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: <20150227103841.0e9f55d8@gandalf.local.home> In-Reply-To: <1425048495-10271-2-git-send-email-javi.merino@arm.com> References: <1425048495-10271-1-git-send-email-javi.merino@arm.com> <1425048495-10271-2-git-send-email-javi.merino@arm.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1141 Lines: 47 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. -- Steve > + errno = EINVAL; > + ret = -1; > + free_arg(field); > + goto out_free_token; > + } > + > + *print_arg = field; > + > +out_free_token: > + free_token(token); > + > + return ret; > +} > + -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/