From patchwork Tue Mar 22 06:12:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8638041 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 10D45C0554 for ; Tue, 22 Mar 2016 06:13:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 412DA20390 for ; Tue, 22 Mar 2016 06:13:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 498A32038A for ; Tue, 22 Mar 2016 06:13:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752569AbcCVGM5 (ORCPT ); Tue, 22 Mar 2016 02:12:57 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34796 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751111AbcCVGMw (ORCPT ); Tue, 22 Mar 2016 02:12:52 -0400 Received: by mail-pf0-f193.google.com with SMTP id n5so33916052pfn.1; Mon, 21 Mar 2016 23:12:51 -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=5ZA6Ax9OBrp41iHL/m3r4hZE6YApLNY6MZLi/cjRlW8=; b=QUFxtGuBPWlsQZNR8D9C0EZeazlRdt8C9UBjulWeip7WT52IX8YozSDGNZTwiS2htj HYHnsJ1eoppXGq3kDPK/Py2K3sMB+fHwRAD0IoRCjnweln9MeHyN1Ps7cZvj8Np5W5PS bXtJgz38rqq6fe0XzoZsQhoYYRa3tx52SddksFfxrJ42ZDynWS0J5HaeCXxExYEhJO8A udhTwnF/xmmy+MxMsP4YiehCPnSXebCUTIkToNtM+OR/vI/ZTDpvS8DfyXrdm/OR2XR3 rRrF2UuuJY2baR46+wQFTeSnAcapFDlnd95Sdhe9aC3MLHtVvYfU+G6JucYJUjbJW7dK Yf3w== X-Gm-Message-State: AD7BkJKjL3BhP6TokFnSJuQamoJhWPPL0OcjzpwKcitxpjrFXmBcTCVM1CXCtKVJC7J6Xw== X-Received: by 10.66.139.234 with SMTP id rb10mr50912578pab.104.1458627171292; Mon, 21 Mar 2016 23:12:51 -0700 (PDT) Received: from localhost ([116.251.212.171]) by smtp.gmail.com with ESMTPSA id 20sm44633290pfj.80.2016.03.21.23.12.49 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 21 Mar 2016 23:12:50 -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 3/8] block: mark 1st parameter of bvec_iter_advance as const Date: Tue, 22 Mar 2016 14:12:24 +0800 Message-Id: <1458627149-12988-4-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1458627149-12988-1-git-send-email-ming.lei@canonical.com> References: <1458627149-12988-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, T_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. Signed-off-by: Ming Lei Reviewed-by: Christoph Hellwig --- 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 cc43055..5798c21 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,