]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
Get rid of most warnings at libtrace
authorMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 23 May 2013 10:22:40 +0000 (07:22 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 23 May 2013 10:22:40 +0000 (07:22 -0300)
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
libtrace/event-parse.c
libtrace/event-utils.h
libtrace/kbuffer-parse.c
libtrace/parse-filter.c
libtrace/parse-utils.c

index b357460ef1819ab43c2f054712ff1154cbd0c166..e3c9e5c7aa9cd72fb09068c9df83af61c6a4d3df 100644 (file)
@@ -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)
 {
index d7ea2cab9f15805c7372cc04879a8600aef87b38..28041ee4f006fe62d6c64515f630804c4d878793 100644 (file)
@@ -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);                  \
index 3fe3ba9eba430bb59bb47ec24cc314d1ac26f2c2..50235e3de8746956f52748915e57ba05838d8617 100644 (file)
@@ -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;
index 2500e75583fcc26e6380731d407dc6d985ba6929..7e7bf3f39d8147d725e8b5b64e34d8192b4051b4 100644 (file)
@@ -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;
 
index f023a133abb625bcecb171ae499cf43126edecaf..61bf2a7ff0769592c32b371755e36cebff888b75 100644 (file)
@@ -4,6 +4,8 @@
 #include <stdarg.h>
 #include <errno.h>
 
+#include "event-utils.h"
+
 #define __weak __attribute__((weak))
 
 void __vdie(const char *fmt, va_list ap)