public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frank Seidel <fseidel@suse.de>
To: linux kernel <linux-kernel@vger.kernel.org>
Cc: akpm@linux-foundation.org, kkeil@suse.de,
	linux-isdn@vger.kernel.org, "Frank Seidel" <frank@f-seidel.de>,
	"Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>,
	"Andreas Eversberg" <andreas@eversberg.eu>,
	"Hannes Eder" <hannes@hanneseder.net>,
	"Adrian Bunk" <bunk@kernel.org>, "Frank Seidel" <fseidel@suse.de>
Subject: [PATCHv2] isdn: reduce stack size of mISDN_dsp
Date: Sun, 01 Mar 2009 18:10:24 +0100	[thread overview]
Message-ID: <49AAC180.9000707@suse.de> (raw)
In-Reply-To: <49AAB8B2.8060801@suse.de>

From: Frank Seidel <frank@f-seidel.de>

Reduce stack size memory footprint of mISDN_dsp.
(From 1468 bytes for dsp_cmx_send on i386 down
to 44).

Signed-off-by: Frank Seidel <frank@f-seidel.de>
---
 drivers/isdn/mISDN/dsp_cmx.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

--- a/drivers/isdn/mISDN/dsp_cmx.c
+++ b/drivers/isdn/mISDN/dsp_cmx.c
@@ -1592,13 +1592,21 @@ dsp_cmx_send(void *arg)
 	struct dsp_conf_member *member;
 	struct dsp *dsp;
 	int mustmix, members;
-	s32 mixbuffer[MAX_POLL+100], *c;
+	s32 *mixbuffer;
+	s32 *c;
 	u8 *p, *q;
 	int r, rr;
 	int jittercheck = 0, delay, i;
 	u_long flags;
 	u16 length, count;
 
+	mixbuffer = kmalloc(sizeof(*mixbuffer) * (MAX_POLL + 100), GFP_KERNEL);
+	if (!mixbuffer) {
+		printk(KERN_ERR "mISDN_dsp: cannot allocate buffer(%s)\n",
+		       __func__);
+		return;
+	}
+
 	/* lock */
 	spin_lock_irqsave(&dsp_lock, flags);
 
@@ -1811,6 +1819,8 @@ dsp_cmx_send(void *arg)
 
 	/* unlock */
 	spin_unlock_irqrestore(&dsp_lock, flags);
+
+	kfree(mixbuffer);
 }
 
 /*


  parent reply	other threads:[~2009-03-01 17:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-01 16:32 [PATCH] isdn: reduce stack size of mISDN_dsp Frank Seidel
2009-03-01 16:51 ` Karsten Keil
2009-03-01 16:53   ` Frank Seidel
2009-03-01 17:10 ` Frank Seidel [this message]
2009-03-01 19:54   ` [PATCHv2] " Karsten Keil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49AAC180.9000707@suse.de \
    --to=fseidel@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=andreas@eversberg.eu \
    --cc=bunk@kernel.org \
    --cc=frank@f-seidel.de \
    --cc=hannes@hanneseder.net \
    --cc=ilpo.jarvinen@helsinki.fi \
    --cc=kkeil@suse.de \
    --cc=linux-isdn@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox