]> www.infradead.org Git - users/jedix/linux-maple.git/commit
wifi: ath12k: Decrease ath12k_mac_op_remain_on_channel() stack usage
authorJeff Johnson <quic_jjohnson@quicinc.com>
Tue, 17 Dec 2024 20:26:15 +0000 (22:26 +0200)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Thu, 19 Dec 2024 17:41:04 +0000 (09:41 -0800)
commitaa21668ab3c7c479998be11393e1a1c3c2624fce
treefadd61a7415274500308e24da18737482544b208
parentbe8d47f181fd4f341b8beee1ca11a96d296d2df2
wifi: ath12k: Decrease ath12k_mac_op_remain_on_channel() stack usage

Building the ath12k driver with llvm-18.1.7-x86_64 produces the warning:

drivers/net/wireless/ath/ath12k/mac.c:10028:12: warning: stack frame size (1080) exceeds limit (1024) in 'ath12k_mac_op_remain_on_channel' [-Wframe-larger-than]

A major contributor to the stack usage in this function is:

struct ath12k_wmi_scan_req_arg arg;

Avoid the excess stack usage by dynamically allocating arg instead of
declaring it on the stack. As part of the effort use __free() for both
this new allocation as well as the existing chan_list allocation, and
since then no central cleanup is required, replace all cleanup gotos
with returns.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://patch.msgid.link/20241217202618.1329312-2-kvalo@kernel.org
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/mac.c