瀏覽代碼

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>
Johannes Berg 9 年之前
父節點
當前提交
1ea049b2de
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      include/linux/bvec.h

+ 2 - 1
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");
 		  "Attempted to advance past end of bvec iter\n");
 
 
 	while (bytes) {
 	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;
 		bytes -= len;
 		iter->bi_size -= len;
 		iter->bi_size -= len;