Fix compiler warnings
authorJens Axboe <axboe@kernel.dk>
Wed, 1 Feb 2012 12:17:57 +0000 (13:17 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 1 Feb 2012 12:17:57 +0000 (13:17 +0100)
One was a real bug, assigned i_time twice instead of c_time (which was
left unitialized).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
btt/proc.c
btt/seek.c
btt/trace_queue.c

index aac49cbd0e2a852a25c8ba51ec00cdef7dddf7ed..eb44c3d50f456d6e0294fcc95c1b991807a5e1bc 100644 (file)
@@ -238,9 +238,8 @@ void pip_foreach_out(void (*f)(struct p_info *, void *), void *arg)
                __foreach(root_name.rb_node, f, arg);
        else {
                struct p_info *pip;
-               char *exe, *p, *next, *exes_save = strdup(exes);
+               char *exe, *next, *exes_save = strdup(exes);
 
-               p = exes_save;
                while (exes_save != NULL) {
                        exe = exes_save;
                        if ((next = strchr(exes_save, ',')) != NULL) {
index dba007180284ff8fb4e80bf73d949bc59a1b9f1b..52f6a21534c391eede303196367780907628ec65 100644 (file)
@@ -100,18 +100,14 @@ static void __destroy(struct rb_node *n)
 
 static void sps_emit(struct seeki *sip)
 {
-       double tstamp, s_p_s;
+       double s_p_s;
        struct sps_bkt *sps = &sip->sps;
        double delta = sps->t_last - sps->t_start;
 
-       if ((sps->nseeks == 1) || (delta < DBL_EPSILON)) {
+       if ((sps->nseeks == 1) || (delta < DBL_EPSILON))
                s_p_s = (double)(sps->nseeks);
-               tstamp = sps->t_start;
-       } else {
-
+       else
                s_p_s = (double)(sps->nseeks) / delta;
-               tstamp = sps->t_start + (delta / 2);
-       }
 
        fprintf(sip->sps_fp, "%15.9lf %.2lf\n", sps->t_start, s_p_s);
 
index 82c5760f536d40f369b0ee19e39827d849b249a1..8edcd90b6283a35acbe148abd61009b0b59e4c9e 100644 (file)
@@ -33,7 +33,7 @@ static void handle_queue(struct io *q_iop)
                update_lq(&last_q, &all_avgs.q2q, q_iop->t.time);
        }
 
-       q_iop->i_time = q_iop->g_time = q_iop->i_time = q_iop->m_time =
+       q_iop->i_time = q_iop->g_time = q_iop->c_time = q_iop->m_time =
                                                q_iop->d_time = (__u64)-1;
        q_iop->dip->n_qs++;