From patchwork Thu Apr 14 11:46:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8834721 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 3DF999F3D1 for ; Thu, 14 Apr 2016 11:50:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 681332011D for ; Thu, 14 Apr 2016 11:50:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7F6E620114 for ; Thu, 14 Apr 2016 11:50:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753794AbcDNLt5 (ORCPT ); Thu, 14 Apr 2016 07:49:57 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:33845 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754063AbcDNLsQ (ORCPT ); Thu, 14 Apr 2016 07:48:16 -0400 Received: by mail-oi0-f67.google.com with SMTP id q133so9506878oib.1; Thu, 14 Apr 2016 04:48:16 -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=EPOx2NSyZjjepp6zHhAXPqsNTkxFbP5iAK1zsXZqG6mhHpzaGh8as25TT+6s1V8hbG +9VFqVCMdyifQsoi7gr9Lz/yYsHgYPqIpEOHz3vJAGa57wP2TZiW/sFBjijaXUbN4m+a gRMiaRYslKpdftFKSO9kBEMN1zeK14/cG2E8my79vkIMRQw/snbCZxGFZw5qqwX/tpPm 5zNypPKyNLBdD8AaETZbH1G/sCR3x+MfjDy+lDTKT8hAN62UQgHWxbKa2m0LNI8ZC+4z aQVY7rPLhxQ+3OzezOMBclgZpxrBQe0q5BDL79mz1tlboJPglcnQNZl7JsXnOITnp4MR YJ5Q== X-Gm-Message-State: AOPr4FWVviOGOCQz6g9rIKtDcesSdIPsldy0ESE5c49Q330kh4wNNYFVYAdNP8V7bW132Q== X-Received: by 10.202.4.86 with SMTP id 83mr7097514oie.132.1460634495850; Thu, 14 Apr 2016 04:48:15 -0700 (PDT) Received: from localhost ([12.228.154.70]) by smtp.gmail.com with ESMTPSA id w132sm13343710oif.24.2016.04.14.04.48.14 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 14 Apr 2016 04:48:15 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Al Viro , Ming Lei Subject: [PATCH v4 3/8] block: mark 1st parameter of bvec_iter_advance as const Date: Thu, 14 Apr 2016 19:46:56 +0800 Message-Id: <1460634438-26530-4-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460634438-26530-1-git-send-email-ming.lei@canonical.com> References: <1460634438-26530-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=-7.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 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,