public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Amos Kong <akong@redhat.com>
To: mst@redhat.com
Cc: kvm@vger.kernel.org
Subject: [PATCH 3/3] virtio: Define max_nr_ports to unsigned
Date: Wed, 15 Jun 2011 22:25:41 +0800	[thread overview]
Message-ID: <20110615142541.26726.42629.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20110615142524.26726.13785.stgit@localhost6.localdomain6>

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 <akong@redhat.com>
---
 hw/virtio-serial-bus.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

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;


  parent reply	other threads:[~2011-06-15 14:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-15 14:25 [PATCH 1/3] virtio: Correct error message of unavailable index Amos Kong
2011-06-15 14:25 ` [PATCH 2/3] virtio: Strictly check queue_size when adding virtqueue Amos Kong
2011-06-15 20:36   ` Michael S. Tsirkin
2011-06-15 22:53     ` Amos Kong
2011-06-15 23:31       ` [Qemu-devel] " Anthony Liguori
2011-06-16  2:10         ` [PATCH v2] virtio: Define queue_size to unsigned Amos Kong
2011-06-15 14:25 ` Amos Kong [this message]
2011-06-15 20:39   ` [PATCH 3/3] virtio: Define max_nr_ports " Michael S. Tsirkin
2011-06-15 20:30 ` [PATCH 1/3] virtio: Correct error message of unavailable index Michael S. Tsirkin
2011-06-16  1:59   ` Amos Kong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110615142541.26726.42629.stgit@localhost6.localdomain6 \
    --to=akong@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox