Arnd Bergmann <arnd@xxxxxxxxxx> wrote: > From: Arnd Bergmann <arnd@xxxxxxxx> > > txpower_info_{2g,5g} are too big to fit on the stack, but in most of the > rtlwifi variants this stays below the warning limit for stack frames. > In rtl8192ee and a few others, I see a case where clang decides to fully > inline this into rtl92ee_read_eeprom_info, triggering this warning: > > drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c:2178:6: error: stack frame size (1312) exceeds limit (1280) in 'rtl92ee_read_eeprom_info' [-Werror,-Wframe-larger-than] > > Mark _rtl92ee_read_txpower_info_from_hwpg() as noinline_for_stack to > and mark _rtl92ee_get_chnl_group() as __always_inline to make clang > behave the same way as gcc. Inlining _rtl92ee_get_chnl_group helps > let the compiler see that the index is always in range. The same > change appears to be necessary in all rtlwifi variants. > > A more thorough approach would be to avoid the use of the two structures > on the stack entirely and combine them with the struct rtl_efuse > data that is dynamically allocated and holds the same information. > > Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx> 1 patch(es) applied to rtw-next branch of rtw.git, thanks. 2baacfe83346 wifi: rtlwifi: avoid stack size warning for _read_eeprom_info --- https://github.com/pkshih/rtw.git