From patchwork Tue Mar 8 11:29:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8532391 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 597D79F2B4 for ; Tue, 8 Mar 2016 11:33:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7C1F1201C8 for ; Tue, 8 Mar 2016 11:33:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5FFCB20165 for ; Tue, 8 Mar 2016 11:33:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932350AbcCHLcO (ORCPT ); Tue, 8 Mar 2016 06:32:14 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34463 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933094AbcCHLab (ORCPT ); Tue, 8 Mar 2016 06:30:31 -0500 Received: by mail-pf0-f195.google.com with SMTP id 184so1063818pff.1; Tue, 08 Mar 2016 03:30:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WIPZcqtqSar1Q7SzgvLkrjAEsgddx/l+NE5oj2NPjI0=; b=XsEKw173P0DIne9eIVbRu4yCECMaOgtEum5VtznnyqFAygqyzklaEICOilL9WH8K9i 6XT3DMMuKAmTS01UrcLxKQxzVKMYaKgH6M91vdl23HzGGehpyjjCf94r6tbEOfRAE4nv 3R2Aa/waNSdb1/6UnUN6r6ZAuV39zovwpVXtukvomKOZTmVuz/TxMdPM5alTCCbZrPKD Y2FWjda6jkR9CX7eAaMIyORrjIYTOW4iI6/nDtlTJIZjA4HAPFwJGG2T4oDBNcbBftuI sFT3yvfTL/z5DDFAnM3WwJDGK9RY/ZFgFLSc0CjbV3hUkVHAQ0WBdIlbM+XV+/OSDKB0 b4qg== X-Gm-Message-State: AD7BkJLET9coGOvRlyIhFC283Dacy0ff0zuz0fccDjvsn3TObLiPQrT3IwI6Z7m48V+4HA== X-Received: by 10.98.71.149 with SMTP id p21mr413048pfi.133.1457436629849; Tue, 08 Mar 2016 03:30:29 -0800 (PST) Received: from localhost ([116.251.212.171]) by smtp.gmail.com with ESMTPSA id lq10sm4390789pab.36.2016.03.08.03.30.28 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 08 Mar 2016 03:30:28 -0800 (PST) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Al Viro , Anton Altaparmakov , Ming Lei Subject: [PATCH 3/4] block: mark 1st parameter of bvec_iter_advance as const Date: Tue, 8 Mar 2016 19:29:45 +0800 Message-Id: <1457436586-26833-4-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1457436586-26833-1-git-send-email-ming.lei@canonical.com> References: <1457436586-26833-1-git-send-email-ming.lei@canonical.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP bvec_iter_advance() only writes to the parameter of 'iter', so address of 'bvec' can be marked as const safely. Without the change, we can trigger compiling warning in the following patch for implementing iterate_bvec(): lib/iov_iter.c with bvec iterator. Signed-off-by: Ming Lei --- include/linux/bvec_iter.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/bvec_iter.h b/include/linux/bvec_iter.h index 07c1ffc..2ad5271 100644 --- a/include/linux/bvec_iter.h +++ b/include/linux/bvec_iter.h @@ -49,7 +49,8 @@ .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,