From: Frank Seidel <frank@f-seidel.de>
To: linux kernel <linux-kernel@vger.kernel.org>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
akpm@linux-foundation.org, hannes@hanneseder.net,
johannes@sipsolutions.net,
"David S. Miller" <davem@davemloft.net>,
Frank Seidel <fseidel@suse.de>, Frank Seidel <frank@f-seidel.de>,
wangchen@cn.fujitsu.com,
"John W. Linville" <linville@tuxdriver.com>
Subject: [PATCH][trivial] airo: reduce stack memory footpring
Date: Wed, 25 Feb 2009 15:39:57 +0100 [thread overview]
Message-ID: <49A5583D.5050502@f-seidel.de> (raw)
From: Frank Seidel <frank@f-seidel.de>
Applying kernel janitors todos (reduce stack
footprint where possible) to airo wireless driver.
(Before 1124 bytes on i386, now 876)
Signed-off-by: Frank Seidel <frank@f-seidel.de>
---
drivers/net/wireless/airo.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -7031,11 +7031,15 @@ static int airo_get_aplist(struct net_de
{
struct airo_info *local = dev->ml_priv;
struct sockaddr *address = (struct sockaddr *) extra;
- struct iw_quality qual[IW_MAX_AP];
+ struct iw_quality *qual;
BSSListRid BSSList;
int i;
int loseSync = capable(CAP_NET_ADMIN) ? 1: -1;
+ qual = kmalloc(IW_MAX_AP * sizeof(*qual), GFP_KERNEL);
+ if (!qual)
+ return -ENOMEM;
+
for (i = 0; i < IW_MAX_AP; i++) {
u16 dBm;
if (readBSSListRid(local, loseSync, &BSSList))
@@ -7090,6 +7094,7 @@ static int airo_get_aplist(struct net_de
}
dwrq->length = i;
+ kfree(qual);
return 0;
}
next reply other threads:[~2009-02-25 14:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-25 14:39 Frank Seidel [this message]
2009-02-25 14:44 ` [PATCH][trivial] airo: reduce stack memory footpring Frank Seidel
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=49A5583D.5050502@f-seidel.de \
--to=frank@f-seidel.de \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=fseidel@suse.de \
--cc=hannes@hanneseder.net \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=wangchen@cn.fujitsu.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.