qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] uhci: Use an intermediate buffer for usb packet


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH] uhci: Use an intermediate buffer for usb packet data
Date: Fri, 26 Apr 2013 14:32:12 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

  Hi,

> +    if (max_len <= sizeof(async->static_buf)) {
> +        async->buf = async->static_buf;
> +    } else {
> +        async->buf = g_malloc(max_len);
> +    }

Do we need this?  I think we should simply make the static buffer big
enough for the maximum allowed packet size (isn't that big on usb 1.1,
isn't it?) or allocate dynamically unconditionally.

> +    qemu_iovec_add(&async->packet.iov, async->buf, max_len);

There is usb_packet_addbuf() ...

Looks good otherwise.

cheers,
  Gerd





reply via email to

[Prev in Thread] Current Thread [Next in Thread]