wifi: ath: Remove ath*_base::bd_api
cover wifi: ath: Remove ath*_base::bd_api
Both ath11k and ath12k inherited the bd_api member in their struct ath*_base. In ath10k this member is accessed from both ath10k_core_fetch_board_file() and ath10k_debug_print_board_info(), so it is justified. However, in ath11k and ath12k, this member is only used within a single function, so it is not justified in those drivers.
---
Jeff Johnson (2):
wifi: ath11k: Remove ath11k_base::bd_api
wifi: ath12k: Remove ath12k_base::bd_api
drivers/net/wireless/ath/ath11k/core.c | 7 ++++--- drivers/net/wireless/ath/ath11k/core.h | 1 - drivers/net/wireless/ath/ath12k/core.c | 7 ++++--- drivers/net/wireless/ath/ath12k/core.h | 1 - 4 files changed, 8 insertions(+), 8 deletions(-)
---
base-commit: 13556aef0bdc0e98df7b6bf2e10d706c59dce6f4
change-id: 20231011-ath11k_bd_api-a9c1678e4cbc
Signature · 3 lines
ath12k mailing list [email protected] https://lists.infradead.org/mailman/listinfo/ath12k
PATCH 1/2 wifi: ath11k: Remove ath11k_base::bd_api
Currently struct ath11k_base defines the member bd_api. However, this member is only accessed within ath11k_core_fetch_bdf(). Since the scope is local just to that one function, remove it from ath11k_base and instead just use a local stack variable.
No functional changes, compile tested only.
--- drivers/net/wireless/ath/ath11k/core.c | 7 ++++--- drivers/net/wireless/ath/ath11k/core.h | 1 - 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath11k/core.c +4 -3
@@ -1317,6 +1317,7 @@ int ath11k_core_fetch_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd) {char *boardname =NULL , *fallback_boardname =NULL , *chip_id_boardname =NULL ;char *filename, filepath[100 ]; +int bd_api;int ret =0 ; filename =ATH11K_BOARD_API2_FILE ;
@@ -1332,7 +1333,7 @@ int ath11k_core_fetch_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd) goto exit; } - ab->bd_api =2 ; + bd_api =2 ; ret = ath11k_core_fetch_board_data_api_n(ab, bd, boardname, ATH11K_BD_IE_BOARD, ATH11K_BD_IE_BOARD_NAME,
@@ -1381,7 +1382,7 @@ int ath11k_core_fetch_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd)if (!ret) goto exit; - ab->bd_api =1 ; + bd_api =1 ; ret =ath11k_core_fetch_board_data_api_1 (ab, bd,ATH11K_DEFAULT_BOARD_FILE );if (ret) { ath11k_core_create_firmware_path(ab, filename,
@@ -1405,7 +1406,7 @@ int ath11k_core_fetch_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd)kfree (chip_id_boardname);if (!ret) -ath11k_dbg (ab,ATH11K_DBG_BOOT ,"using board api %d\n" , ab->bd_api); +ath11k_dbg (ab,ATH11K_DBG_BOOT ,"using board api %d\n" , bd_api);return ret; }
drivers/net/wireless/ath/ath11k/core.h +0 -1
@@ -906,7 +906,6 @@ struct ath11k_base {struct ath11k_targ_cap target_caps;u32 ext_service_bitmap[WMI_SERVICE_EXT_BM_SIZE ];bool pdevs_macaddr_valid; -int bd_api;struct ath11k_hw_params hw_params;
Signature · 7 lines
2.42.0 -- ath12k mailing list [email protected] https://lists.infradead.org/mailman/listinfo/ath12k
Re: [PATCH 1/2] wifi: ath11k: Remove ath11k_base::bd_api
Quoted 9 lines · Jeff Johnson
Currently struct
ath11k_basedefines the memberbd_api. However, this member is only accessed withinath11k_core_fetch_bdf(). Since the scope is local just to that one function, remove it fromath11k_baseand instead just use a local stack variable.No functional changes, compile tested only.
Signed-off-by Jeff Johnson <[email protected]>Signed-off-by Kalle Valo <[email protected]>
2 patches applied to ath-next branch of ath.git, thanks.
b4f70ac0fa88 wifi: ath11k: Remove ath11k_base::bd_api 2180f7ac0abe wifi: ath12k: Remove ath12k_base::bd_api
Signature · 9 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 2/2 wifi: ath12k: Remove ath12k_base::bd_api
In reply to Jeff JohnsonCurrently struct ath12k_base defines the member bd_api. However, this member is only accessed within ath12k_core_fetch_bdf(). Since the scope is local just to that one function, remove it from ath12k_base and instead just use a local stack variable.
No functional changes, compile tested only.
--- drivers/net/wireless/ath/ath12k/core.c | 7 ++++--- drivers/net/wireless/ath/ath12k/core.h | 1 - 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath12k/core.c +4 -3
@@ -360,6 +360,7 @@ int ath12k_core_fetch_board_data_api_1(struct ath12k_base *ab,int ath12k_core_fetch_bdf (struct ath12k_base *ab,struct ath12k_board_data *bd) {char boardname[BOARD_NAME_SIZE ]; +int bd_api;int ret; ret =ath12k_core_create_board_name (ab, boardname,BOARD_NAME_SIZE );
@@ -368,12 +369,12 @@ int ath12k_core_fetch_bdf(struct ath12k_base *ab, struct ath12k_board_data *bd)return ret; } - ab->bd_api =2 ; + bd_api =2 ; ret =ath12k_core_fetch_board_data_api_n (ab, bd, boardname);if (!ret) goto success; - ab->bd_api =1 ; + bd_api =1 ; ret =ath12k_core_fetch_board_data_api_1 (ab, bd,ATH12K_DEFAULT_BOARD_FILE );if (ret) { ath12k_err(ab, "failed to fetch board-2.bin or board.bin from %s\n",
@@ -382,7 +383,7 @@ int ath12k_core_fetch_bdf(struct ath12k_base *ab, struct ath12k_board_data *bd) } success: -ath12k_dbg (ab,ATH12K_DBG_BOOT ,"using board api %d\n" , ab->bd_api); +ath12k_dbg (ab,ATH12K_DBG_BOOT ,"using board api %d\n" , bd_api);return 0 ; }
drivers/net/wireless/ath/ath12k/core.h +0 -1
@@ -737,7 +737,6 @@ struct ath12k_base {struct ath12k_wmi_target_cap_arg target_caps;u32 ext_service_bitmap[WMI_SERVICE_EXT_BM_SIZE ];bool pdevs_macaddr_valid; -int bd_api;const struct ath12k_hw_params *hw_params;
Signature · 7 lines
2.42.0 -- ath12k mailing list [email protected] https://lists.infradead.org/mailman/listinfo/ath12k