From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJJMv-0007cZ-0j for qemu-devel@nongnu.org; Tue, 10 Sep 2013 04:32:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJJMe-00024P-Td for qemu-devel@nongnu.org; Tue, 10 Sep 2013 04:32:16 -0400 Received: from mail-ea0-x230.google.com ([2a00:1450:4013:c01::230]:38512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJJMe-000247-ML for qemu-devel@nongnu.org; Tue, 10 Sep 2013 04:32:00 -0400 Received: by mail-ea0-f176.google.com with SMTP id q16so3645900ead.7 for ; Tue, 10 Sep 2013 01:31:59 -0700 (PDT) Date: Tue, 10 Sep 2013 10:31:56 +0200 From: Stefan Hajnoczi Message-ID: <20130910083156.GD10477@stefanha-thinkpad.redhat.com> References: <1378731102-4005-1-git-send-email-v.maffione@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1378731102-4005-1-git-send-email-v.maffione@gmail.com> Subject: Re: [Qemu-devel] [PATCH] e1000: NetClientInfo.receive_iov implemented List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vincenzo Maffione Cc: anthony@codemonkey.ws, mst@redhat.com, jasowang@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, pbonzini@redhat.com On Mon, Sep 09, 2013 at 02:51:42PM +0200, Vincenzo Maffione wrote: Just two small style comments: > @@ -834,11 +837,14 @@ e1000_receive(NetClientState *nc, const uint8_t *buf, size_t size) > unsigned int n, rdt; > uint32_t rdh_start; > uint16_t vlan_special = 0; > - uint8_t vlan_status = 0, vlan_offset = 0; > + uint8_t vlan_status = 0; > uint8_t min_buf[MIN_BUF_SIZE]; > size_t desc_offset; > size_t desc_size; > size_t total_size; > + size_t size = iov_size(iov, iovcnt), iov_ofs = 0; Please keep these initializers on separate lines (not a hard rule, but I find it clearer especially when calling functions): size_t size = iov_size(iov, iovcnt); size_t iov_ofs = 0; > + struct iovec iv; This iovec is for min_buf[]. I suggest moving it below the min_buf[] declaration and renaming it to make its purpose clearer: struct iovec min_iovec; Stefan