Skip to content

Commit 1ea049b

Browse files
jmberg-intelaxboe
authored andcommitted
bvec: avoid variable shadowing warning
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>
1 parent 005411e commit 1ea049b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/linux/bvec.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ static inline void bvec_iter_advance(const struct bio_vec *bv,
7474
"Attempted to advance past end of bvec iter\n");
7575

7676
while (bytes) {
77-
unsigned len = min(bytes, bvec_iter_len(bv, *iter));
77+
unsigned iter_len = bvec_iter_len(bv, *iter);
78+
unsigned len = min(bytes, iter_len);
7879

7980
bytes -= len;
8081
iter->bi_size -= len;

0 commit comments

Comments
 (0)