[PATCH] ipw2200: stack reduction
authorZhu Yi <yi.zhu@intel.com>
Tue, 24 Jan 2006 08:37:28 +0000 (16:37 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 31 Jan 2006 01:35:34 +0000 (20:35 -0500)
commit0a7bcf261ea584c87a9cee4523023fa74168de4a
treef5ccb4cf6b3e376bbb16a1a0cb12b700b58ba928
parent397ae121ee0116d3b4125d621f0ef528d1d52580
[PATCH] ipw2200: stack reduction

Checking the stack usage of my kernel, showed that ipw2200 had a few bad
offenders. This is on i386 32-bit:

0x00002876 ipw_send_associate:                          544
0x000028ee ipw_send_associate:                          544
0x000027dc ipw_send_scan_request_ext:                   520
0x00002864 ipw_set_sensitivity:                         520
0x00005eac ipw_set_rsn_capa:                            520

The reason is the host_cmd structure is large (500 bytes). All other
functions currently using ipw_send_cmd() suffer from the same problem.
This patch introduces ipw_send_cmd_simple() for commands with no data
transfer, and ipw_send_cmd_pdu() for commands with a data payload and
makes the payload a pointer to the buffer passed in from the caller.

As an added bonus, the diffstat looks like this:

 ipw2200.c |  260 +++++++++++++++++++++-----------------------------------------
 ipw2200.h |    2
 2 files changed, 92 insertions(+), 170 deletions(-)

and it shrinks the module a lot as well:

Before:

   text    data     bss     dec     hex filename
  75177    2472      44   77693   12f7d drivers/net/wireless/ipw2200.ko

After:

   text    data     bss     dec     hex filename
  61363    2488      44   63895    f997 drivers/net/wireless/ipw2200.ko

So about a ~18% reduction in module size.

Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ipw2200.c
drivers/net/wireless/ipw2200.h