From: Ming Lei <tom.leiming@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, linux-kernel@vger.kernel.org
Cc: Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Ming Lei <tom.leiming@gmail.com>
Subject: [PATCH 1/2] block: mark 1st parameter of bvec_iter_advance as const
Date: Sat, 10 Oct 2015 23:20:25 +0800 [thread overview]
Message-ID: <1444490426-16522-2-git-send-email-tom.leiming@gmail.com> (raw)
In-Reply-To: <1444490426-16522-1-git-send-email-tom.leiming@gmail.com>
bvec_iter_advance() only writes the parameter of iterator,
so the base address of bvec can be marked as const safely.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
include/linux/bio.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/linux/bio.h b/include/linux/bio.h
index b9b6e04..3333684 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -193,7 +193,8 @@ static inline void *bio_data(struct bio *bio)
#define bio_for_each_segment_all(bvl, bio, i) \
for (i = 0, bvl = (bio)->bi_io_vec; i < (bio)->bi_vcnt; i++, bvl++)
-static inline void bvec_iter_advance(struct bio_vec *bv, struct bvec_iter *iter,
+static inline void bvec_iter_advance(const struct bio_vec *bv,
+ struct bvec_iter *iter,
unsigned bytes)
{
WARN_ONCE(bytes > iter->bi_size,
--
1.9.1
next prev parent reply other threads:[~2015-10-10 15:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-10 15:20 [PATCH 0/2] iov_iter: use bvec iterator to implement iterate_bvec() Ming Lei
2015-10-10 15:20 ` Ming Lei [this message]
2015-10-10 15:20 ` [PATCH 2/2] " Ming Lei
2015-10-10 15:33 ` kbuild test robot
2015-10-10 15:48 ` Ming Lei
2015-10-10 15:34 ` kbuild test robot
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=1444490426-16522-2-git-send-email-tom.leiming@gmail.com \
--to=tom.leiming@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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®