From patchwork Thu Jun 16 02:10:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 100584 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 25144B6F84 for ; Thu, 16 Jun 2011 12:12:27 +1000 (EST) Received: from localhost ([::1]:60378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QX24F-0005Du-8c for incoming@patchwork.ozlabs.org; Wed, 15 Jun 2011 22:12:23 -0400 Received: from eggs.gnu.org ([140.186.70.92]:40459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QX22E-0005Dm-Fm for qemu-devel@nongnu.org; Wed, 15 Jun 2011 22:10:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QX22D-0007U3-LM for qemu-devel@nongnu.org; Wed, 15 Jun 2011 22:10:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QX22D-0007Tt-D3 for qemu-devel@nongnu.org; Wed, 15 Jun 2011 22:10:17 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5G2AGSd013622 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 15 Jun 2011 22:10:16 -0400 Received: from localhost6.localdomain6 ([10.66.9.169]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p5G2AD7W016833; Wed, 15 Jun 2011 22:10:14 -0400 To: qemu-devel@nongnu.org From: Amos Kong Date: Thu, 16 Jun 2011 10:10:13 +0800 Message-ID: <20110616021013.4160.89565.stgit@localhost6.localdomain6> In-Reply-To: <4DF940E3.2020603@codemonkey.ws> References: <4DF940E3.2020603@codemonkey.ws> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kvm@vger.kernel.org, mst@redhat.com Subject: [Qemu-devel] [PATCH v2] virtio: Define queue_size to unsigned 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 It's not valid for queue_size to be negative, then the type ought to be unsigned. Changes from V1: - drop the check and just define it to unsigned. Signed-off-by: Amos Kong --- hw/virtio.c | 2 +- hw/virtio.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio.c b/hw/virtio.c index 6e8814c..4c1e334 100644 --- a/hw/virtio.c +++ b/hw/virtio.c @@ -602,7 +602,7 @@ void virtio_queue_set_vector(VirtIODevice *vdev, int n, uint16_t vector) vdev->vq[n].vector = vector; } -VirtQueue *virtio_add_queue(VirtIODevice *vdev, int queue_size, +VirtQueue *virtio_add_queue(VirtIODevice *vdev, unsigned int queue_size, void (*handle_output)(VirtIODevice *, VirtQueue *)) { int i; diff --git a/hw/virtio.h b/hw/virtio.h index bc72289..ff0c9b5 100644 --- a/hw/virtio.h +++ b/hw/virtio.h @@ -138,7 +138,7 @@ static inline void virtio_set_status(VirtIODevice *vdev, uint8_t val) vdev->status = val; } -VirtQueue *virtio_add_queue(VirtIODevice *vdev, int queue_size, +VirtQueue *virtio_add_queue(VirtIODevice *vdev, unsigned int queue_size, void (*handle_output)(VirtIODevice *, VirtQueue *));