From patchwork Mon Oct 3 16:56:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: rutuja shah X-Patchwork-Id: 9360755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D5159601C0 for ; Mon, 3 Oct 2016 16:57:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C89CC2874C for ; Mon, 3 Oct 2016 16:57:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCE952878C; Mon, 3 Oct 2016 16:57:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 40D3E2874C for ; Mon, 3 Oct 2016 16:57:07 +0000 (UTC) Received: from localhost ([::1]:38230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1br6Y4-0002Mk-O3 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 03 Oct 2016 12:57:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1br6Xn-0002MO-3s for qemu-devel@nongnu.org; Mon, 03 Oct 2016 12:56:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1br6Xh-0001Yc-3L for qemu-devel@nongnu.org; Mon, 03 Oct 2016 12:56:46 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:36664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1br6Xg-0001XX-TD; Mon, 03 Oct 2016 12:56:41 -0400 Received: by mail-pf0-x244.google.com with SMTP id n24so9050155pfb.3; Mon, 03 Oct 2016 09:56:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Wv6iCIupQGp0xuZXE2joT0vVjQRoNjxFASNevAXtkFE=; b=jSR2Ff8CH5NO8sk0hI8LCWLAMf4fOQyKuVzJK5K+TPTymzIdFCP9xlZW+EJQ4+sxZ6 uuFM2hV6oW4OQSn0JSYPWtjkcZ2FtioUPnmJslg7m9D17lnm78xOLpseUDtbrMxqCMb9 9CaDueGEwvM2KnjbHdY/0NvlS4GvNJPePv0lf3RVi1LRmIJkXQlK1CeGWP1rA/+zjwNv DMSjDk1saheemofPzBHMIjLM/j8tGz+z8FaSbsML2bwWuFmwEI4yJ8QS6M2WPGVBSYA1 smwOyLYcAwd4qAxIqIkU96Ir2mg7sLr2Nk1Wd00hBkeodkbC0bapLTZIhadGqT7sU2yM 5I3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Wv6iCIupQGp0xuZXE2joT0vVjQRoNjxFASNevAXtkFE=; b=fb32X7+WB5GgSm6c7GR0t9SnwTo6mIOwFHB/IHYtjADwCifAIWl/kQ+b8eY6jddlJd ABaW+IstWjU+9/T5lPhRauFe91GKBuQtd6pn83lRHOkDXPUVSJCYaFxvjsbN5a1whoI2 OF9flLr94nl6NdYaHs48bMQZ2vFvrS2tGtw6HxHmzZTe1j5pZPiWzAujV1rsoIlqJun1 eGIebKJRXgaMh7STjABhdtsdy64iWsTOm7i2T0jRPeZ/k1OAAz9i7XIzp61yTMjWAiv5 reOJrBZww+W86a3ZtlmLH//469+mn00478TcSVuVlWFWXgfNaJ03V8hewBkVoBR+gMtO IncQ== X-Gm-Message-State: AA6/9RlRAGzhcXlmwbpT/OufKPxf5WuFzrCeh0J5CQp10iXKJXjVPcf8cnQjbSSJfet3dw== X-Received: by 10.98.213.68 with SMTP id d65mr38678928pfg.112.1475513799515; Mon, 03 Oct 2016 09:56:39 -0700 (PDT) Received: from rutuja-HP-ProBook-4430s.pune.wibhu.com ([59.95.42.29]) by smtp.gmail.com with ESMTPSA id yg10sm48690870pab.8.2016.10.03.09.56.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Oct 2016 09:56:38 -0700 (PDT) From: rutu.shah.26@gmail.com To: qemu-devel@nongnu.org Date: Mon, 3 Oct 2016 22:26:25 +0530 Message-Id: <1475513785-30275-1-git-send-email-rutu.shah.26@gmail.com> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [PATCH] Reducing stack frame size in stream_process_mem2s() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com, stefanh@gmail.com, qemu-arm@nongnu.org, Rutuja Shah , alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Rutuja Shah This patch allocates memory for txbuf array on the heap rather than the stack. As a result, the stack frame size is reduced. Signed-off-by: Rutuja Shah --- hw/dma/xilinx_axidma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index b135a5f..6c63575 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -256,13 +256,14 @@ static void stream_process_mem2s(struct Stream *s, StreamSlave *tx_data_dev, StreamSlave *tx_control_dev) { uint32_t prev_d; - unsigned char txbuf[16 * 1024]; + unsigned char *txbuf; unsigned int txlen; if (!stream_running(s) || stream_idle(s)) { return; } + txbuf = g_malloc(16 * 1024); while (1) { stream_desc_load(s, s->regs[R_CURDESC]); @@ -304,6 +305,7 @@ static void stream_process_mem2s(struct Stream *s, StreamSlave *tx_data_dev, break; } } + g_free(txbuf); } static size_t stream_process_s2mem(struct Stream *s, unsigned char *buf,