From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVhp4-0008Tm-T6 for qemu-devel@nongnu.org; Fri, 26 Apr 2013 08:32:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVhp1-0008Pn-QJ for qemu-devel@nongnu.org; Fri, 26 Apr 2013 08:32:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVhp1-0008PT-JL for qemu-devel@nongnu.org; Fri, 26 Apr 2013 08:32:15 -0400 Message-ID: <517A73CC.8040205@redhat.com> Date: Fri, 26 Apr 2013 14:32:12 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1366885267-9694-1-git-send-email-hdegoede@redhat.com> In-Reply-To: <1366885267-9694-1-git-send-email-hdegoede@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] uhci: Use an intermediate buffer for usb packet data List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hans de Goede Cc: Jan Kiszka , qemu-devel@nongnu.org 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