From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752330AbbJJPUm (ORCPT ); Sat, 10 Oct 2015 11:20:42 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:36427 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752290AbbJJPUj (ORCPT ); Sat, 10 Oct 2015 11:20:39 -0400 From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: Christoph Hellwig , Andrew Morton , Alexander Viro , Ming Lei Subject: [PATCH 1/2] block: mark 1st parameter of bvec_iter_advance as const Date: Sat, 10 Oct 2015 23:20:25 +0800 Message-Id: <1444490426-16522-2-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444490426-16522-1-git-send-email-tom.leiming@gmail.com> References: <1444490426-16522-1-git-send-email-tom.leiming@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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