[PATCH 1/2] block: mark 1st parameter of bvec_iter_advance as const

From: Ming Lei
Date: Sat Oct 10 2015 - 11:21:00 EST


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@xxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/