mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] wifi: ath: Remove ath*_base::bd_api
@ 2023-10-13 14:24 Jeff Johnson
  2023-10-13 14:24 ` [PATCH 1/2] wifi: ath11k: Remove ath11k_base::bd_api Jeff Johnson
  2023-10-13 14:24 ` [PATCH 2/2] wifi: ath12k: Remove ath12k_base::bd_api Jeff Johnson
  0 siblings, 2 replies; 4+ messages in thread
From: Jeff Johnson @ 2023-10-13 14:24 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath11k, linux-wireless, linux-kernel, ath12k, Jeff Johnson

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.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
---
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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] wifi: ath11k: Remove ath11k_base::bd_api
  2023-10-13 14:24 [PATCH 0/2] wifi: ath: Remove ath*_base::bd_api Jeff Johnson
@ 2023-10-13 14:24 ` Jeff Johnson
  2023-10-18  8:31   ` Kalle Valo
  2023-10-13 14:24 ` [PATCH 2/2] wifi: ath12k: Remove ath12k_base::bd_api Jeff Johnson
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff Johnson @ 2023-10-13 14:24 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath11k, linux-wireless, linux-kernel, ath12k, Jeff Johnson

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.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/core.c | 7 ++++---
 drivers/net/wireless/ath/ath11k/core.h | 1 -
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index c3a0dd15d8ea..1469ab4a2df9 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -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;
 }
diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h
index 650972f9d146..f4e8b3b9ed4d 100644
--- a/drivers/net/wireless/ath/ath11k/core.h
+++ b/drivers/net/wireless/ath/ath11k/core.h
@@ -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;
 

-- 
2.42.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] wifi: ath12k: Remove ath12k_base::bd_api
  2023-10-13 14:24 [PATCH 0/2] wifi: ath: Remove ath*_base::bd_api Jeff Johnson
  2023-10-13 14:24 ` [PATCH 1/2] wifi: ath11k: Remove ath11k_base::bd_api Jeff Johnson
@ 2023-10-13 14:24 ` Jeff Johnson
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Johnson @ 2023-10-13 14:24 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath11k, linux-wireless, linux-kernel, ath12k, Jeff Johnson

Currently 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.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/core.c | 7 ++++---
 drivers/net/wireless/ath/ath12k/core.h | 1 -
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
index c68750cb3c4d..dbffd1c7cd88 100644
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -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;
 }
 
diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
index 254eb42a85c5..fafb2a5b9350 100644
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -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;
 

-- 
2.42.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] wifi: ath11k: Remove ath11k_base::bd_api
  2023-10-13 14:24 ` [PATCH 1/2] wifi: ath11k: Remove ath11k_base::bd_api Jeff Johnson
@ 2023-10-18  8:31   ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2023-10-18  8:31 UTC (permalink / raw)
  To: Jeff Johnson; +Cc: ath11k, linux-wireless, linux-kernel, ath12k, Jeff Johnson

Jeff Johnson <quic_jjohnson@quicinc.com> wrote:

> 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.
> 
> Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

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

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20231013-ath11k_bd_api-v1-1-3fefe4629706@quicinc.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-18  8:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-13 14:24 [PATCH 0/2] wifi: ath: Remove ath*_base::bd_api Jeff Johnson
2023-10-13 14:24 ` [PATCH 1/2] wifi: ath11k: Remove ath11k_base::bd_api Jeff Johnson
2023-10-18  8:31   ` Kalle Valo
2023-10-13 14:24 ` [PATCH 2/2] wifi: ath12k: Remove ath12k_base::bd_api Jeff Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®