Skip to content

Commit

Permalink
bvec: avoid variable shadowing warning
Browse files Browse the repository at this point in the history
Due to the (indirect) nesting of min(..., min(...)), sparse will
show a variable shadowing warning whenever bvec.h is included.

Avoid that by assigning the inner min() to a temporary variable first.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Johannes Berg authored and Jens Axboe committed Aug 11, 2016
1 parent 005411e commit 1ea049b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/linux/bvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ static inline void bvec_iter_advance(const struct bio_vec *bv,
"Attempted to advance past end of bvec iter\n");

while (bytes) {
unsigned len = min(bytes, bvec_iter_len(bv, *iter));
unsigned iter_len = bvec_iter_len(bv, *iter);
unsigned len = min(bytes, iter_len);

bytes -= len;
iter->bi_size -= len;
Expand Down

0 comments on commit 1ea049b

Please sign in to comment.