Re: [PATCH 3/3] virtio: Define max_nr_ports to unsigned

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 15, 2011 at 10:25:41PM +0800, Amos Kong wrote:
> 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@xxxxxxxxxx>

I guess 2^31 ports isn't really feasible, but it's good
to be consistent.

Acked-by: Michael S. Tsirkin <mst@xxxxxxxxxx>


> ---
>  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;
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux