From: Mauro Carvalho Chehab Date: Thu, 23 May 2013 10:22:40 +0000 (-0300) Subject: Get rid of most warnings at libtrace X-Git-Tag: v0.4.0~41 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=08fee02e8d1c240eb38e011f1acc51e90942a431;p=users%2Fmchehab%2Frasdaemon.git Get rid of most warnings at libtrace Signed-off-by: Mauro Carvalho Chehab --- diff --git a/libtrace/event-parse.c b/libtrace/event-parse.c index b357460..e3c9e5c 100644 --- a/libtrace/event-parse.c +++ b/libtrace/event-parse.c @@ -110,13 +110,13 @@ void pevent_buffer_init(const char *buf, unsigned long long size) init_input_buf(buf, size); } -void breakpoint(void) +static void breakpoint(void) { static int x; x++; } -struct print_arg *alloc_arg(void) +static struct print_arg *alloc_arg(void) { return calloc(1, sizeof(struct print_arg)); } @@ -3177,7 +3177,7 @@ struct event_format * pevent_find_event_by_name(struct pevent *pevent, const char *sys, const char *name) { - struct event_format *event; + struct event_format *event = NULL; int i; if (pevent->last_event && @@ -4020,7 +4020,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event char format[32]; int show_func; int len_as_arg; - int len_arg; + int len_arg = 0; int len; int ls; @@ -4265,8 +4265,8 @@ void pevent_data_lat_fmt(struct pevent *pevent, static int migrate_disable_exists; unsigned int lat_flags; unsigned int pc; - int lock_depth; - int migrate_disable; + int lock_depth = 0; + int migrate_disable = 0; int hardirq; int softirq; void *data = record->data; @@ -4903,7 +4903,7 @@ static int find_event_handle(struct pevent *pevent, struct event_format *event) * * /sys/kernel/debug/tracing/events/.../.../format */ -enum pevent_errno __pevent_parse_format(struct event_format **eventp, +static enum pevent_errno __pevent_parse_format(struct event_format **eventp, struct pevent *pevent, const char *buf, unsigned long size, const char *sys) { @@ -5116,7 +5116,7 @@ int pevent_strerror(struct pevent *pevent, enum pevent_errno errnum, return 0; } -int get_field_val(struct trace_seq *s, struct format_field *field, +static int get_field_val(struct trace_seq *s, struct format_field *field, const char *name, struct pevent_record *record, unsigned long long *val, int err) { diff --git a/libtrace/event-utils.h b/libtrace/event-utils.h index d7ea2ca..28041ee 100644 --- a/libtrace/event-utils.h +++ b/libtrace/event-utils.h @@ -36,9 +36,9 @@ void __die(const char *fmt, ...); void __warning(const char *fmt, ...); void __pr_stat(const char *fmt, ...); -void __vdie(const char *fmt, ...); -void __vwarning(const char *fmt, ...); -void __vpr_stat(const char *fmt, ...); +void __vdie(const char *fmt, va_list ap); +void __vwarning(const char *fmt, va_list ap); +void __vpr_stat(const char *fmt, va_list ap); #define min(x, y) ({ \ typeof(x) _min1 = (x); \ diff --git a/libtrace/kbuffer-parse.c b/libtrace/kbuffer-parse.c index 3fe3ba9..50235e3 100644 --- a/libtrace/kbuffer-parse.c +++ b/libtrace/kbuffer-parse.c @@ -296,7 +296,7 @@ static unsigned int old_update_pointers(struct kbuffer *kbuf) unsigned int type; unsigned int len; unsigned int delta; - unsigned int length; + unsigned int length = 0; void *ptr = kbuf->data + kbuf->curr; type_len_ts = read_4(kbuf, ptr); @@ -616,7 +616,7 @@ unsigned long long kbuffer_timestamp(struct kbuffer *kbuf) void *kbuffer_read_at_offset(struct kbuffer *kbuf, int offset, unsigned long long *ts) { - void *data; + void *data = NULL; if (offset < kbuf->start) offset = 0; diff --git a/libtrace/parse-filter.c b/libtrace/parse-filter.c index 2500e75..7e7bf3f 100644 --- a/libtrace/parse-filter.c +++ b/libtrace/parse-filter.c @@ -728,11 +728,11 @@ enum filter_vals { FILTER_VAL_TRUE, }; -void reparent_op_arg(struct filter_arg *parent, struct filter_arg *old_child, +static void reparent_op_arg(struct filter_arg *parent, struct filter_arg *old_child, struct filter_arg *arg) { - struct filter_arg *other_child; - struct filter_arg **ptr; + struct filter_arg *other_child = NULL; + struct filter_arg **ptr = NULL; if (parent->type != FILTER_ARG_OP && arg->type != FILTER_ARG_OP) @@ -771,7 +771,7 @@ void reparent_op_arg(struct filter_arg *parent, struct filter_arg *old_child, free_arg(old_child); } -enum filter_vals test_arg(struct filter_arg *parent, struct filter_arg *arg) +static enum filter_vals test_arg(struct filter_arg *parent, struct filter_arg *arg) { enum filter_vals lval, rval; @@ -2031,7 +2031,7 @@ static char *exp_to_str(struct event_filter *filter, struct filter_arg *arg) { char *lstr; char *rstr; - char *op; + char *op = NULL; char *str = NULL; int len; diff --git a/libtrace/parse-utils.c b/libtrace/parse-utils.c index f023a13..61bf2a7 100644 --- a/libtrace/parse-utils.c +++ b/libtrace/parse-utils.c @@ -4,6 +4,8 @@ #include #include +#include "event-utils.h" + #define __weak __attribute__((weak)) void __vdie(const char *fmt, va_list ap)