From patchwork Wed Jun 15 14:25:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 882222 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5FEQ4FI020227 for ; Wed, 15 Jun 2011 14:26:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755366Ab1FOOZq (ORCPT ); Wed, 15 Jun 2011 10:25:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65102 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755220Ab1FOOZo (ORCPT ); Wed, 15 Jun 2011 10:25:44 -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 p5FEPi4n029056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 15 Jun 2011 10:25:44 -0400 Received: from localhost6.localdomain6 (vpn1-112-40.nay.redhat.com [10.66.112.40]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p5FEPg3m007839; Wed, 15 Jun 2011 10:25:43 -0400 Subject: [PATCH 3/3] virtio: Define max_nr_ports to unsigned To: mst@redhat.com From: Amos Kong Cc: kvm@vger.kernel.org Date: Wed, 15 Jun 2011 22:25:41 +0800 Message-ID: <20110615142541.26726.42629.stgit@localhost6.localdomain6> In-Reply-To: <20110615142524.26726.13785.stgit@localhost6.localdomain6> References: <20110615142524.26726.13785.stgit@localhost6.localdomain6> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 15 Jun 2011 14:26:04 +0000 (UTC) hw/virtio-serial-bus.c: 725 static int virtser_port_qdev_init(DeviceState *qdev, DeviceInfo *base) 726 { ... 730 int ret, max_nr_ports; ... 762 max_nr_ports = tswap32(port->vser->config.max_nr_ports); 763 if (port->id >= max_nr_ports) { tswap32() returns an uint32_t variable. Signed-off-by: Amos Kong Acked-by: Michael S. Tsirkin --- hw/virtio-serial-bus.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index 9a12104..aae8456 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -727,7 +727,8 @@ static int virtser_port_qdev_init(DeviceState *qdev, DeviceInfo *base) VirtIOSerialPort *port = DO_UPCAST(VirtIOSerialPort, dev, qdev); VirtIOSerialPortInfo *info = DO_UPCAST(VirtIOSerialPortInfo, qdev, base); VirtIOSerialBus *bus = DO_UPCAST(VirtIOSerialBus, qbus, qdev->parent_bus); - int ret, max_nr_ports; + int ret; + uint32_t max_nr_ports; bool plugging_port0; port->vser = bus->vser;