diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-11-24 09:05:16 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-24 10:37:02 -0500 |
commit | 364794845cbc49e638b83d7ef739524291e1e961 (patch) | |
tree | e720975b26d307d6566afb9305c9f6e44290a7da /tools/perf/builtin-help.c | |
parent | b32d133aec5dc882cf783a293f393bfb3f4379e1 (diff) |
perf tools: Introduce zalloc() for the common calloc(1, N) case
This way we type less characters and it looks more like the
kzalloc kernel counterpart.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1259071517-3242-3-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-help.c')
-rw-r--r-- | tools/perf/builtin-help.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c index 768f9c826312..9f810b17c25c 100644 --- a/tools/perf/builtin-help.c +++ b/tools/perf/builtin-help.c | |||
@@ -179,7 +179,7 @@ static void add_man_viewer(const char *name) | |||
179 | 179 | ||
180 | while (*p) | 180 | while (*p) |
181 | p = &((*p)->next); | 181 | p = &((*p)->next); |
182 | *p = calloc(1, (sizeof(**p) + len + 1)); | 182 | *p = zalloc(sizeof(**p) + len + 1); |
183 | strncpy((*p)->name, name, len); | 183 | strncpy((*p)->name, name, len); |
184 | } | 184 | } |
185 | 185 | ||
@@ -194,7 +194,7 @@ static void do_add_man_viewer_info(const char *name, | |||
194 | size_t len, | 194 | size_t len, |
195 | const char *value) | 195 | const char *value) |
196 | { | 196 | { |
197 | struct man_viewer_info_list *new = calloc(1, sizeof(*new) + len + 1); | 197 | struct man_viewer_info_list *new = zalloc(sizeof(*new) + len + 1); |
198 | 198 | ||
199 | strncpy(new->name, name, len); | 199 | strncpy(new->name, name, len); |
200 | new->info = strdup(value); | 200 | new->info = strdup(value); |