From patchwork Mon Apr 4 06:56:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8737921 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0EE05C0553 for ; Mon, 4 Apr 2016 06:58:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 36187201BB for ; Mon, 4 Apr 2016 06:58:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52B8D200DB for ; Mon, 4 Apr 2016 06:58:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932149AbcDDG5B (ORCPT ); Mon, 4 Apr 2016 02:57:01 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:33956 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932148AbcDDG47 (ORCPT ); Mon, 4 Apr 2016 02:56:59 -0400 Received: by mail-pa0-f41.google.com with SMTP id fe3so137828834pab.1; Sun, 03 Apr 2016 23:56:58 -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=h3r5MW4uJcxB035rK3TeUKseVcIiJ+mE+TlPa/xMSHwCRuUPwYbG/usNuEMNnPlBmv qRqnUjP5bP+h5LJW1a4Fn2+wAxsHAqnDoXPqNfJfdxUnhm6r2Cszebw+Gjg1WrWQowzk lfCyiPx5OK2499RcGN7uz1JIxQPr1sm/mHI5jx4x8BzcYUyjoiH4+S6dX5x0bYKWRqc/ pLPluCPuRArefPkhuHh4zbX+Ehllf4A5AQv5gx6UqLR89DyDG3pobtR29NVK8gCSaRaT h05vD2yio7SQ4yBHOq99twf6Di4ffk0WZs7Yksbmtcf8qRBRhA29K4ed/YZNGzQmuW+o 6/FA== X-Gm-Message-State: AD7BkJLKJI1twyguCziQUqJW9IyliNfdQQrNrDjsNHfvzA5qBvup6pOWkJDxuc9c2+Nyuw== X-Received: by 10.66.140.14 with SMTP id rc14mr50915504pab.65.1459753018367; Sun, 03 Apr 2016 23:56:58 -0700 (PDT) Received: from localhost (45-125-195-13.ip4.readyserver.sg. [45.125.195.13]) by smtp.gmail.com with ESMTPSA id dh8sm17007732pad.46.2016.04.03.23.56.56 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 03 Apr 2016 23:56:57 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Al Viro , Anton Altaparmakov , xfs@oss.sgi.com, Dave Chinner , drbd-dev@lists.linbit.com, Philipp Reisner , Lars Ellenberg , Boaz Harrosh , Ming Lei Subject: [PATCH v3 3/8] block: mark 1st parameter of bvec_iter_advance as const Date: Mon, 4 Apr 2016 14:56:29 +0800 Message-Id: <1459752994-2205-4-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459752994-2205-1-git-send-email-ming.lei@canonical.com> References: <1459752994-2205-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.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SBL, 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,