linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Namhyung Kim <namhyung@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 13:42:58 +0200	[thread overview]
Message-ID: <20120919114258.GA16696@gmail.com> (raw)
In-Reply-To: <1348037109-17252-1-git-send-email-namhyung@kernel.org>


* 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;

(The function here seems to be rather large as well, making it a 
possible candidate for shrinkage/splitup.)

Thanks,

	Ingo

  reply	other threads:[~2012-09-19 11:43 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 [this message]
2012-09-19 12:26         ` Namhyung Kim
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=20120919114258.GA16696@gmail.com \
    --to=mingo@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=namhyung.kim@lge.com \
    --cc=namhyung@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).