From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWurX-0007Um-FB for qemu-devel@nongnu.org; Fri, 19 Feb 2016 18:53:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWurS-00071m-Es for qemu-devel@nongnu.org; Fri, 19 Feb 2016 18:53:27 -0500 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]:34312) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWurS-000712-7f for qemu-devel@nongnu.org; Fri, 19 Feb 2016 18:53:22 -0500 Received: by mail-pa0-x230.google.com with SMTP id fy10so58001200pac.1 for ; Fri, 19 Feb 2016 15:53:22 -0800 (PST) Received: from localhost (ec2-52-8-89-49.us-west-1.compute.amazonaws.com. [52.8.89.49]) by smtp.gmail.com with ESMTPSA id xv2sm20391646pab.10.2016.02.19.15.53.19 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 19 Feb 2016 15:53:20 -0800 (PST) Date: Sat, 20 Feb 2016 00:53:17 +0100 From: "Edgar E. Iglesias" Message-ID: <20160219235317.GA11438@toto> References: <1455623612-24398-1-git-send-email-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455623612-24398-1-git-send-email-edgar.iglesias@gmail.com> Subject: Re: [Qemu-devel] [PATCH v1 1/1] etraxfs_dma: Dont forward zero-length payload to clients List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Tue, Feb 16, 2016 at 12:53:32PM +0100, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" Applied > > Signed-off-by: Edgar E. Iglesias > --- > hw/dma/etraxfs_dma.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/hw/dma/etraxfs_dma.c b/hw/dma/etraxfs_dma.c > index 9cbb165..d5650eb 100644 > --- a/hw/dma/etraxfs_dma.c > +++ b/hw/dma/etraxfs_dma.c > @@ -440,13 +440,16 @@ static int channel_out_run(struct fs_dma_ctrl *ctrl, int c) > D(printf("channel %d pushes %x %u bytes eop=%u\n", c, > saved_data_buf, len, out_eop)); > > - if (ctrl->channels[c].client->client.push) > - ctrl->channels[c].client->client.push( > - ctrl->channels[c].client->client.opaque, > - buf, len, out_eop); > - else > + if (ctrl->channels[c].client->client.push) { > + if (len > 0) { > + ctrl->channels[c].client->client.push( > + ctrl->channels[c].client->client.opaque, > + buf, len, out_eop); > + } > + } else { > printf("WARNING: DMA ch%d dataloss," > " no attached client.\n", c); > + } > > saved_data_buf += len; > > -- > 1.9.1 >