Skip to content

Commit

Permalink
io_u: Using initialized local variable
Browse files Browse the repository at this point in the history
ddir was feed with io_u->ddir at init time but didn't got used before
reassign it to the same value or another one.

That was making this init useless.

This patch simplify this portion of code by using the initialized
variable.
  • Loading branch information
Erwan Velu committed Apr 2, 2014
1 parent a806bf2 commit 9ee1c64
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions io_u.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,10 @@ static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u,
unsigned int minbs, maxbs;
unsigned long r, rand_max;

assert(ddir_rw(io_u->ddir));
assert(ddir_rw(ddir));

if (td->o.bs_is_seq_rand)
ddir = is_random ? DDIR_WRITE: DDIR_READ;
else
ddir = io_u->ddir;

minbs = td->o.min_bs[ddir];
maxbs = td->o.max_bs[ddir];
Expand Down

0 comments on commit 9ee1c64

Please sign in to comment.