lkml.org 
[lkml]   [2012]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tools lib traceevent: Handle alloc_arg failure

* 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


\
 
 \ /
  Last update: 2012-09-19 14:21    [W:2.092 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site