Patch from: Matthew Wilcox Reduces stack use in random.c by 350 (or maybe 700) bytes by sharing a local array between two functions. drivers/char/random.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff -puN drivers/char/random.c~random-stack-use drivers/char/random.c --- 25/drivers/char/random.c~random-stack-use Mon Mar 3 12:08:26 2003 +++ 25-akpm/drivers/char/random.c Mon Mar 3 12:08:26 2003 @@ -1228,10 +1228,8 @@ static ssize_t extract_entropy(struct en * at which point we do a "catastrophic reseeding". */ static inline void xfer_secondary_pool(struct entropy_store *r, - size_t nbytes) + size_t nbytes, __u32 *tmp) { - __u32 tmp[TMP_BUF_SIZE]; - if (r->entropy_count < nbytes * 8 && r->entropy_count < r->poolinfo.POOLBITS) { int nwords = min_t(int, @@ -1284,7 +1282,7 @@ static ssize_t extract_entropy(struct en r->entropy_count = r->poolinfo.POOLBITS; if (flags & EXTRACT_ENTROPY_SECONDARY) - xfer_secondary_pool(r, nbytes); + xfer_secondary_pool(r, nbytes, tmp); DEBUG_ENT("%s has %d bits, want %d bits\n", r == sec_random_state ? "secondary" : _