From patchwork Mon Sep 24 23:04:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 186605 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 340032C0082 for ; Tue, 25 Sep 2012 09:42:40 +1000 (EST) Received: from localhost ([::1]:37243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGHhQ-00088t-Ut for incoming@patchwork.ozlabs.org; Mon, 24 Sep 2012 19:04:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGHgc-0006MB-Dq for qemu-devel@nongnu.org; Mon, 24 Sep 2012 19:03:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGHgb-0005a3-8j for qemu-devel@nongnu.org; Mon, 24 Sep 2012 19:03:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGHgb-0005Zf-0T for qemu-devel@nongnu.org; Mon, 24 Sep 2012 19:03:33 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8ON2xX0005323 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 24 Sep 2012 19:03:00 -0400 Received: from redhat.com (vpn1-7-132.ams2.redhat.com [10.36.7.132]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id q8ON2vg1025544; Mon, 24 Sep 2012 19:02:58 -0400 Date: Tue, 25 Sep 2012 01:04:33 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org, Jason Wang , Anthony Liguori , stefanha@linux.vnet.ibm.com, aurelien@aurel32.net Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 02/14] iov: add const annotation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org iov_from_buf does not change iov, make it const. Signed-off-by: Michael S. Tsirkin --- iov.c | 2 +- iov.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iov.c b/iov.c index 60705c7..c6a66f0 100644 --- a/iov.c +++ b/iov.c @@ -26,7 +26,7 @@ # include #endif -size_t iov_from_buf(struct iovec *iov, unsigned int iov_cnt, +size_t iov_from_buf(const struct iovec *iov, unsigned int iov_cnt, size_t offset, const void *buf, size_t bytes) { size_t done; diff --git a/iov.h b/iov.h index 381f37a..a73569f 100644 --- a/iov.h +++ b/iov.h @@ -36,7 +36,7 @@ size_t iov_size(const struct iovec *iov, const unsigned int iov_cnt); * such "large" value is -1 (sinice size_t is unsigned), * so specifying `-1' as `bytes' means 'up to the end of iovec'. */ -size_t iov_from_buf(struct iovec *iov, unsigned int iov_cnt, +size_t iov_from_buf(const struct iovec *iov, unsigned int iov_cnt, size_t offset, const void *buf, size_t bytes); size_t iov_to_buf(const struct iovec *iov, const unsigned int iov_cnt, size_t offset, void *buf, size_t bytes);