From: Namhyung Kim <namhyung@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Paul Mackerras <paulus@samba.org>,
LKML <linux-kernel@vger.kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Jiri Olsa <jolsa@redhat.com>,
Stephane Eranian <eranian@google.com>,
Mike Galbraith <efault@gmx.de>,
Namhyung Kim <namhyung.kim@lge.com>
Subject: Re: [PATCH] tools lib traceevent: Handle alloc_arg failure
Date: Wed, 19 Sep 2012 21:26:49 +0900 [thread overview]
Message-ID: <1348057609.1644.9.camel@leonhard> (raw)
In-Reply-To: <20120919114258.GA16696@gmail.com>
Hi Ingo,
2012-09-19 (수), 13:42 +0200, Ingo Molnar:
> * Namhyung Kim <namhyung@kernel.org> wrote:
>
> > + if (!left) {
> > + do_warning("%s(%d): not enough memory!", __func__, __LINE__);
> > + goto out_free;
>
> > + if (!right) {
> > + do_warning("%s(%d): not enough memory!", __func__, __LINE__);
> > + goto out_free;
> > + }
>
> > + if (!left) {
> > + do_warning("%s(%d): not enough memory!", __func__, __LINE__);
> > + goto out_free;
> > + }
>
> > + if (!left) {
> > + do_warning("%s(%d): not enough memory!", __func__, __LINE__);
> > + goto out_free;
> > + }
>
> > + if (!right) {
> > + do_warning("%s(%d): not enough memory!", __func__, __LINE__);
> > + goto out_free;
> > + }
>
> > + if (!left) {
> > + do_warning("%s(%d): not enough memory!", __func__, __LINE__);
> > + goto out_free;
> > + }
>
> These repetitive patterns are seriously uglifying the code and
> are crying out loud for a out_war_free label:
>
> if (!left)
> goto out_warn_free;
Yeah, I agree. But I wanted to add a bit more helpful (to developers)
info - function name and line number - rather than just "not enough
memory" message. Maybe we could change do_warning to emit such info
automatically.
Thanks,
Namhyung
next prev parent reply other threads:[~2012-09-19 12:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-17 20:50 [RFC 0/4] Some libtraceevent cleanups/simplifications Arnaldo Carvalho de Melo
2012-09-17 20:50 ` [PATCH 1/4] tools lib traceevent: Use asprintf were applicable Arnaldo Carvalho de Melo
2012-09-17 20:50 ` [PATCH 2/4] tools lib traceevent: Use calloc " Arnaldo Carvalho de Melo
2012-09-19 2:54 ` Namhyung Kim
2012-09-19 6:45 ` [PATCH] tools lib traceevent: Handle alloc_arg failure Namhyung Kim
2012-09-19 11:42 ` Ingo Molnar
2012-09-19 12:26 ` Namhyung Kim [this message]
2012-09-19 12:41 ` Steven Rostedt
2012-09-19 13:30 ` Namhyung Kim
2012-09-20 2:09 ` [PATCH v2] " Namhyung Kim
2012-09-27 5:47 ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-09-17 20:50 ` [PATCH 3/4] tools lib traceevent: Fix afterlife gotos Arnaldo Carvalho de Melo
2012-09-17 20:50 ` [PATCH 4/4] tools lib traceevent: Remove some die() calls Arnaldo Carvalho de Melo
2012-09-19 6:48 ` [RFC 0/4] Some libtraceevent cleanups/simplifications Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1348057609.1644.9.camel@leonhard \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=dsahern@gmail.com \
--cc=efault@gmx.de \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=paulus@samba.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.