aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-06-03 15:48:40 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-03 15:50:44 -0400
commit233f0b95ca3a0d1dcbd70bc7e519069a8e10d23e (patch)
treea227a79b15d489f6037d281feb0f84bdba391c4a
parent18374ab76e3ec1cf1b0ca5a8d08e35cfc5d01669 (diff)
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: Ingo Molnar <mingo@elte.hu>
-rw-r--r--Documentation/perf_counter/builtin-top.c2
-rw-r--r--Documentation/perf_counter/util/parse-options.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/Documentation/perf_counter/builtin-top.c b/Documentation/perf_counter/builtin-top.c
index 16a618446d3f..7c907e25d82b 100644
--- a/Documentation/perf_counter/builtin-top.c
+++ b/Documentation/perf_counter/builtin-top.c
@@ -175,7 +175,7 @@ static void rb_insert_active_sym(struct rb_root *tree, struct sym_entry *se)
175 175
176static void print_sym_table(void) 176static void print_sym_table(void)
177{ 177{
178 int printed, j; 178 int printed = 0, j;
179 int counter; 179 int counter;
180 float events_per_sec = events/delay_secs; 180 float events_per_sec = events/delay_secs;
181 float kevents_per_sec = (events-userspace_events)/delay_secs; 181 float kevents_per_sec = (events-userspace_events)/delay_secs;
diff --git a/Documentation/perf_counter/util/parse-options.c b/Documentation/perf_counter/util/parse-options.c
index b80abd9a99bc..551b6bc34e79 100644
--- a/Documentation/perf_counter/util/parse-options.c
+++ b/Documentation/perf_counter/util/parse-options.c
@@ -33,7 +33,7 @@ static int get_arg(struct parse_opt_ctx_t *p, const struct option *opt,
33static int get_value(struct parse_opt_ctx_t *p, 33static int get_value(struct parse_opt_ctx_t *p,
34 const struct option *opt, int flags) 34 const struct option *opt, int flags)
35{ 35{
36 const char *s, *arg; 36 const char *s, *arg = NULL;
37 const int unset = flags & OPT_UNSET; 37 const int unset = flags & OPT_UNSET;
38 38
39 if (unset && p->opt) 39 if (unset && p->opt)