Commit 233f0b95 authored by Ingo Molnar's avatar Ingo Molnar

perf_counter tools: Work around warnings in older GCCs

GCC 4.1.2 produces:

 util/parse-options.c: In function ‘get_value’:
 util/parse-options.c:36: warning: ‘arg’ may be used uninitialized in this function

 builtin-top.c: In function ‘display_thread’:
 builtin-top.c:178: warning: ‘printed’ may be used uninitialized in this function

Annotate them away by initializing these variables to 0.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <new-submission>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 18374ab7
...@@ -175,7 +175,7 @@ static void rb_insert_active_sym(struct rb_root *tree, struct sym_entry *se) ...@@ -175,7 +175,7 @@ static void rb_insert_active_sym(struct rb_root *tree, struct sym_entry *se)
static void print_sym_table(void) static void print_sym_table(void)
{ {
int printed, j; int printed = 0, j;
int counter; int counter;
float events_per_sec = events/delay_secs; float events_per_sec = events/delay_secs;
float kevents_per_sec = (events-userspace_events)/delay_secs; float kevents_per_sec = (events-userspace_events)/delay_secs;
......
...@@ -33,7 +33,7 @@ static int get_arg(struct parse_opt_ctx_t *p, const struct option *opt, ...@@ -33,7 +33,7 @@ static int get_arg(struct parse_opt_ctx_t *p, const struct option *opt,
static int get_value(struct parse_opt_ctx_t *p, static int get_value(struct parse_opt_ctx_t *p,
const struct option *opt, int flags) const struct option *opt, int flags)
{ {
const char *s, *arg; const char *s, *arg = NULL;
const int unset = flags & OPT_UNSET; const int unset = flags & OPT_UNSET;
if (unset && p->opt) if (unset && p->opt)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment