From: Chen Zhongjin <chenzhongjin@huawei.com>
To: <linux-kernel@vger.kernel.org>, <linux-block@vger.kernel.org>
Cc: <axboe@kernel.dk>, <chenzhongjin@huawei.com>
Subject: [PATCH -next] block: Remove unused variable 'added'
Date: Fri, 30 Sep 2022 18:34:28 +0800 [thread overview]
Message-ID: <20220930103428.21823-1-chenzhongjin@huawei.com> (raw)
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.
Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
---
block/blk-map.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/block/blk-map.c b/block/blk-map.c
index 7196a6b64c80..1d5e609589c0 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -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;
}
--
2.17.1
reply other threads:[~2022-09-30 11:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220930103428.21823-1-chenzhongjin@huawei.com \
--to=chenzhongjin@huawei.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®