From: Jens Axboe Date: Wed, 1 Feb 2012 12:17:57 +0000 (+0100) Subject: Fix compiler warnings X-Git-Tag: blktrace-1.0.5~2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=f6d38abde41a7b18808dcdab393f05d6300d16c3;p=blktrace.git Fix compiler warnings One was a real bug, assigned i_time twice instead of c_time (which was left unitialized). Signed-off-by: Jens Axboe --- diff --git a/btt/proc.c b/btt/proc.c index aac49cb..eb44c3d 100644 --- a/btt/proc.c +++ b/btt/proc.c @@ -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) { diff --git a/btt/seek.c b/btt/seek.c index dba0071..52f6a21 100644 --- a/btt/seek.c +++ b/btt/seek.c @@ -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); diff --git a/btt/trace_queue.c b/btt/trace_queue.c index 82c5760..8edcd90 100644 --- a/btt/trace_queue.c +++ b/btt/trace_queue.c @@ -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++;