Skip to content

Commit

Permalink
block: mark 1st parameter of bvec_iter_advance as const
Browse files Browse the repository at this point in the history
bvec_iter_advance() only writes the parameter of iterator,
so the base address of bvec can be marked as const safely.

Without the change, we can see compiling warning in the
following patch for implementing iterate_bvec(): lib/iov_iter.c
with bvec iterator.

Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Tested-by: Hannes Reinecke <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Ming Lei authored and axboe committed Jun 9, 2016
1 parent 0781e79 commit 80f162f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/linux/bvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ struct bvec_iter {
.bv_offset = bvec_iter_offset((bvec), (iter)), \
})

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,
Expand Down

0 comments on commit 80f162f

Please sign in to comment.