Skip to contentSkip to conversation

block/blk-map: Remove set but unused variable 'added'

PATCH Applied Jiapeng Chong 2 participants 2 messages Sep 5, 2022 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 block/blk-map: Remove set but unused variable 'added'

The variable added is not effectively used in the function, so delete it.

block/blk-map.c:273:16: warning: variable 'added' set but not used.

---
Changes in v2:
-Remove offs initialization.

 block/blk-map.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
block/blk-map.c +1 -2
index 2fbe298d3822..8d1e84b04b4a 100644
@@ -270,7 +270,7 @@ static int bio_map_user_iov(struct request *rq, struct iov_iter *iter,
 	while (iov_iter_count(iter)) {
 		struct page **pages, *stack_pages[UIO_FASTIOV];
 		ssize_t bytes;
-		size_t offs, added = 0;
+		size_t offs;
 		int npages;
 
 		if (nr_vecs <= ARRAY_SIZE(stack_pages)) {
@@ -306,7 +306,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.20.1.7.g153144c
maintainer Applied
#1 lore raw
Quoted 6 lines · Jiapeng Chong

The variable added is not effectively used in the function, so delete it.

block/blk-map.c:273:16: warning: variable 'added' set but not used.

Applied, thanks!

[1/1] block/blk-map: Remove set but unused variable 'added'

      commit: 91e5adda5cf4e3bf21c46eaa2ae7ee2cb6058126

Best regards,

Signature · 1 line
Jens Axboe