Skip to contentSkip to conversation

block: Remove unused variable 'added'

PATCH New Chen Zhongjin 1 participant 1 message Sep 30, 2022 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: Remove unused variable 'added'

Reported by Clang [-Wunused-but-set-variable]

'commit 480cb846c27b ("block: convert to advancing variants of iov_iter_get_pages{,_alloc}()")' This commit converted iov_iter_advance() to iov_iter_revert(), and
not uses variable 'added' anymore but forgot to delete it.

Since 'added' is useless now, remove it for code cleaning.

---
 block/blk-map.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
block/blk-map.c +1 -2
index 7196a6b64c80..1d5e609589c0 100644
@@ -251,7 +251,7 @@ static int bio_map_user_iov(struct request *rq, struct iov_iter *iter,
 	while (iov_iter_count(iter)) {
 		struct page **pages;
 		ssize_t bytes;
-		size_t offs, added = 0;
+		size_t offs;
 		int npages;
 
 		bytes = iov_iter_get_pages_alloc2(iter, &pages, LONG_MAX, &offs);
@@ -280,7 +280,6 @@ static int bio_map_user_iov(struct request *rq, struct iov_iter *iter,
 					break;
 				}
 
-				added += n;
 				bytes -= n;
 				offs = 0;
 			}
Signature · 1 line
2.17.1