From patchwork Mon May 30 13:34:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9141459 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5024A60754 for ; Mon, 30 May 2016 13:36:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44DF22819C for ; Mon, 30 May 2016 13:36:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 396D028222; Mon, 30 May 2016 13:36:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1B8027C23 for ; Mon, 30 May 2016 13:36:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161250AbcE3Ngc (ORCPT ); Mon, 30 May 2016 09:36:32 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34151 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161218AbcE3Nga (ORCPT ); Mon, 30 May 2016 09:36:30 -0400 Received: by mail-pf0-f195.google.com with SMTP id c84so14841721pfc.1; Mon, 30 May 2016 06:36:30 -0700 (PDT) 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=S14n/O0+q+ndk4GNPao1LYO7n6IMxckdKo7DcMBoMNo=; b=PWGUjF5xwEJlR45bhBdHp5M/4PtK4HCaKLu7nW6vSl1Mwoeip6KnKCxXrBT3tSk8hE p/F7bXV6HfAC9Rq5NtZQET27SI4E0DAC020MB8HWR7Eu1YqVLOUloCqkkjGSon6A5Rll TeSQUB2p2IVE3/cEvBFLZ2K3S7y4oCocQ64u+ukpPBC+tyk/izzCw3c/cZFh4U2KADg1 1DiTWLjZ9LMBiqnp/8H+Pd2b1s5hbfihOFuUd4fpwi+aDpLksLlgZ5CFqr6T6XgKhICD rxXcIf/BJ4kMdtQ8RrB/zU3D2u6ojoF9qf9XqprtUcYlZW6zl8k78/3Y5a7XhzafY8+s hGpg== X-Gm-Message-State: ALyK8tLbSD0LjtqYJx0EFeZTjkY+rp1DagXi2UWocSYJFmOM9YY0QrjmVuafYImkLJCY3g== X-Received: by 10.98.157.4 with SMTP id i4mr46741111pfd.31.1464615389584; Mon, 30 May 2016 06:36:29 -0700 (PDT) Received: from localhost ([45.34.23.101]) by smtp.gmail.com with ESMTPSA id z26sm4737101pff.0.2016.05.30.06.36.28 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 30 May 2016 06:36:28 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Ming Lei Subject: [PATCH v6 3/8] block: mark 1st parameter of bvec_iter_advance as const Date: Mon, 30 May 2016 21:34:31 +0800 Message-Id: <1464615294-9946-4-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464615294-9946-1-git-send-email-ming.lei@canonical.com> References: <1464615294-9946-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-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Ming Lei --- include/linux/bvec.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/bvec.h b/include/linux/bvec.h index 096efd2..701b64a 100644 --- a/include/linux/bvec.h +++ b/include/linux/bvec.h @@ -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,