diff mbox series

tools/lib/traceevent: Fixed few compiler warnings

Message ID 20180822120029.3584-1-tz.stoyanov@gmail.com (mailing list archive)
State Handled Elsewhere
Headers show
Series tools/lib/traceevent: Fixed few compiler warnings | expand

Commit Message

Tzvetomir Stoyanov (VMware) Aug. 22, 2018, noon UTC
Fixed compiler warnings reported by the "-Wmaybe-uninitialized" gcc flag.
All of them are false alarms, this change is just to make compiler happy.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 tools/lib/traceevent/event-parse.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index aabd7516bafd..ab15b985c047 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -3512,7 +3512,7 @@  struct tep_event_format *
 tep_find_event_by_name(struct tep_handle *pevent,
 		       const char *sys, const char *name)
 {
-	struct tep_event_format *event;
+	struct tep_event_format *event = NULL;
 	int i;
 
 	if (pevent->last_event &&
@@ -4235,7 +4235,7 @@  static struct tep_print_arg *make_bprint_args(char *fmt, void *data, int size, s
 	unsigned long long ip, val;
 	char *ptr;
 	void *bptr;
-	int vsize;
+	int vsize = 0;
 
 	field = pevent->bprint_buf_field;
 	ip_field = pevent->bprint_ip_field;
@@ -4895,7 +4895,7 @@  static void pretty_print(struct trace_seq *s, void *data, int size, struct tep_e
 	char format[32];
 	int show_func;
 	int len_as_arg;
-	int len_arg;
+	int len_arg = -1;
 	int len;
 	int ls;
 
@@ -5160,8 +5160,8 @@  void tep_data_lat_fmt(struct tep_handle *pevent,
 	static int migrate_disable_exists;
 	unsigned int lat_flags;
 	unsigned int pc;
-	int lock_depth;
-	int migrate_disable;
+	int lock_depth = -1;
+	int migrate_disable = -1;
 	int hardirq;
 	int softirq;
 	void *data = record->data;