Apply a patch from Richard Kennedy:

hi,
there's been a discussion on lkml about making 4k stacks the default for
x86, and Fedora already uses 4k stacks so we don't seem to have any
problems.

Even so, this simple patch just moves temporary buffers to allow gcc to
better manage the stack usage in prism2mib_priv.

checkstack reports the usage going from 1120 down to 480 in
prism2_usb.ko

I think it's worth doing this just to head off any problems before we
have them.
This commit is contained in:
pizza 2008-06-14 15:32:24 +00:00
parent 3598e4d67a
commit 6cf4a0fd05
2 changed files with 9 additions and 13 deletions

View File

@ -41,6 +41,7 @@
* Intersil Corporation as part of PRISM(R) chipset product development.
*
* --------------------------------------------------------------------
- Reduce stack usage in prism2mib_priv (Richard Kennedy)
- WEXT functions should return -EBUSY when the hardware is still
being initialized (Richard Kennedy)
- Use round_jiffies wherever possible (Richard Kennedy)

View File

@ -2698,15 +2698,6 @@ void *data)
int i, cnt, result, done;
prism2sta_authlist_t old;
/*
** "test" is a lot longer than necessary but who cares? ...as long as
** it is long enough!
*/
UINT8 test[sizeof(wlandev->rx) + sizeof(hw->tallies)];
DBFENTER;
switch (mib->did) {
@ -2727,13 +2718,14 @@ void *data)
** we copy the values.
*/
if (isget)
if (isget) {
UINT8 test[sizeof(wlandev->rx)];
for (i = 0; i < 10; i++) {
memcpy(data, &wlandev->rx, sizeof(wlandev->rx));
memcpy(test, &wlandev->rx, sizeof(wlandev->rx));
if (memcmp(data, test, sizeof(wlandev->rx)) == 0) break;
}
}
break;
case DIDmib_p2_p2Table_p2CommunicationTallies:
@ -2746,6 +2738,7 @@ void *data)
*/
if (isget) {
UINT8 test[sizeof(hw->tallies)];
result = hfa384x_drvr_commtallies(hw);
/* ?????? We need to wait a bit here for the */
@ -2781,6 +2774,7 @@ void *data)
case DIDmib_p2_p2Table_p2Authenticated:
if (isget) {
prism2sta_authlist_t old;
prism2mib_priv_authlist(hw, &old);
macarray->cnt = 0;
@ -2791,12 +2785,13 @@ void *data)
}
}
}
break;
case DIDmib_p2_p2Table_p2Associated:
if (isget) {
prism2sta_authlist_t old;
prism2mib_priv_authlist(hw, &old);
macarray->cnt = 0;
@ -2807,7 +2802,7 @@ void *data)
}
}
}
break;
case DIDmib_p2_p2Table_p2PowerSaveUserCount: