summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2016-08-11 11:15:56 +0300
committerJens Axboe <axboe@fb.com>2016-08-11 18:41:35 +0300
commit1ea049b2de5d803374fdbf43add23c8d1c518e7b (patch)
tree9888036b25bbd628e9fcb5c76f0207c27d1e623a /include/linux
parent005411ea7ee776a56b1e0120a31c65efdee5cab1 (diff)
downloadlinux-1ea049b2de5d803374fdbf43add23c8d1c518e7b.tar.xz
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>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bvec.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/bvec.h b/include/linux/bvec.h
index 701b64a3b7c5..89b65b82d98f 100644
--- a/include/linux/bvec.h
+++ b/include/linux/bvec.h
@@ -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;