Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1349950 > unrolled thread

Re: [PATCH] ath9k: reduce stack usage in ar9003_aic_cal_post_process

Started by"Valo, Kalle" <kvalo@qca.qualcomm.com>
First post2016-03-04 09:40 +0100
Last post2016-03-04 09:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] ath9k: reduce stack usage in ar9003_aic_cal_post_process "Valo, Kalle" <kvalo@qca.qualcomm.com> - 2016-03-04 09:40 +0100

#1349950 — Re: [PATCH] ath9k: reduce stack usage in ar9003_aic_cal_post_process

From"Valo, Kalle" <kvalo@qca.qualcomm.com>
Date2016-03-04 09:40 +0100
SubjectRe: [PATCH] ath9k: reduce stack usage in ar9003_aic_cal_post_process
Message-ID<r8Trd-3ZI-23@gated-at.bofh.it>
Arnd Bergmann <arnd@arndb.de> writes:

> In some configurations, this function uses more than the warning limit
> of 1024 bytes:
>
> drivers/net/wireless/ath/ath9k/ar9003_aic.c: In function 'ar9003_aic_cal_post_process':
> drivers/net/wireless/ath/ath9k/ar9003_aic.c:434:1: error: the frame size of 1040 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
>
> It turns out that there are two large arrays on the stack here, but
> almost all the data in them is never used outside of the loop in
> which it gets written, so we can replace the array with a single
> instance.
>
> The .valid flag is used later, so I'm replacing the array of structures
> with an array of bools. An obvious follow-up optimization would be
> to replace it with a bitmask and set_bit()/find_first_bit()/
> find_last_bit()/... operations. However, I have not tested this patch,
> so I sticked to the simpler transformation that does the job of
> reducing the stack usage to a harmless level.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied to ath.git, thanks.

-- 
Kalle Valo

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web