* [PATCH 0/2] wifi: ath10k: clean up structure initialization
@ 2025-10-30 13:00 Zhongqiu Han
2025-10-30 13:00 ` [PATCH 1/2] wifi: ath10k: use = {} to initialize pm_qos_request instead of memset Zhongqiu Han
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Zhongqiu Han @ 2025-10-30 13:00 UTC (permalink / raw)
To: jjohnson; +Cc: ath10k, linux-wireless, linux-kernel, zhongqiu.han
This patchset simplifies structure initialization in ath10k by replacing
explicit memset() calls with zero initializers (`= {}`) for local
variables.
Patch 1 updates the initialization of `pm_qos_request` in
ath10k_download_fw().
Patch 2 updates the initialization of `bmi_target_info` in
ath10k_core_probe_fw().
These changes improve code clarity and efficiency by avoiding unnecessary
runtime memset calls.
Zhongqiu Han (2):
wifi: ath10k: use = {} to initialize pm_qos_request instead of memset
wifi: ath10k: use = {} to initialize bmi_target_info instead of memset
drivers/net/wireless/ath/ath10k/core.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] wifi: ath10k: use = {} to initialize pm_qos_request instead of memset
2025-10-30 13:00 [PATCH 0/2] wifi: ath10k: clean up structure initialization Zhongqiu Han
@ 2025-10-30 13:00 ` Zhongqiu Han
2025-10-30 13:00 ` [PATCH 2/2] wifi: ath10k: use = {} to initialize bmi_target_info " Zhongqiu Han
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Zhongqiu Han @ 2025-10-30 13:00 UTC (permalink / raw)
To: jjohnson; +Cc: ath10k, linux-wireless, linux-kernel, zhongqiu.han
Initialize the pm_qos_request structure using = {} instead of memset() in
ath10k_download_fw(). This ensures the structure is properly zeroed before
passing it to cpu_latency_qos_add_request(), and improves efficiency by
avoiding an explicit runtime memset.
Signed-off-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 9ae3595fb698..670c31a52a12 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1186,7 +1186,7 @@ static int ath10k_download_fw(struct ath10k *ar)
u32 address, data_len;
const void *data;
int ret;
- struct pm_qos_request latency_qos;
+ struct pm_qos_request latency_qos = {};
address = ar->hw_params.patch_load_addr;
@@ -1220,7 +1220,6 @@ static int ath10k_download_fw(struct ath10k *ar)
ret);
}
- memset(&latency_qos, 0, sizeof(latency_qos));
cpu_latency_qos_add_request(&latency_qos, 0);
ret = ath10k_bmi_fast_download(ar, address, data, data_len);
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] wifi: ath10k: use = {} to initialize bmi_target_info instead of memset
2025-10-30 13:00 [PATCH 0/2] wifi: ath10k: clean up structure initialization Zhongqiu Han
2025-10-30 13:00 ` [PATCH 1/2] wifi: ath10k: use = {} to initialize pm_qos_request instead of memset Zhongqiu Han
@ 2025-10-30 13:00 ` Zhongqiu Han
2025-10-30 18:26 ` [PATCH 0/2] wifi: ath10k: clean up structure initialization Vasanthakumar Thiagarajan
2025-10-30 21:57 ` Jeff Johnson
3 siblings, 0 replies; 5+ messages in thread
From: Zhongqiu Han @ 2025-10-30 13:00 UTC (permalink / raw)
To: jjohnson; +Cc: ath10k, linux-wireless, linux-kernel, zhongqiu.han
Initialize the bmi_target_info structure using = {} at declaration time
instead of calling memset() in each bus-specific code path. This
simplifies the code and avoids an explicit memset.
Signed-off-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 670c31a52a12..7c2939cbde5f 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -3352,7 +3352,7 @@ EXPORT_SYMBOL(ath10k_core_stop);
*/
static int ath10k_core_probe_fw(struct ath10k *ar)
{
- struct bmi_target_info target_info;
+ struct bmi_target_info target_info = {};
int ret = 0;
ret = ath10k_hif_power_up(ar, ATH10K_FIRMWARE_MODE_NORMAL);
@@ -3363,7 +3363,6 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
switch (ar->hif.bus) {
case ATH10K_BUS_SDIO:
- memset(&target_info, 0, sizeof(target_info));
ret = ath10k_bmi_get_target_info_sdio(ar, &target_info);
if (ret) {
ath10k_err(ar, "could not get target info (%d)\n", ret);
@@ -3375,7 +3374,6 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
case ATH10K_BUS_PCI:
case ATH10K_BUS_AHB:
case ATH10K_BUS_USB:
- memset(&target_info, 0, sizeof(target_info));
ret = ath10k_bmi_get_target_info(ar, &target_info);
if (ret) {
ath10k_err(ar, "could not get target info (%d)\n", ret);
@@ -3385,7 +3383,6 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
ar->hw->wiphy->hw_version = target_info.version;
break;
case ATH10K_BUS_SNOC:
- memset(&target_info, 0, sizeof(target_info));
ret = ath10k_hif_get_target_info(ar, &target_info);
if (ret) {
ath10k_err(ar, "could not get target info (%d)\n", ret);
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] wifi: ath10k: clean up structure initialization
2025-10-30 13:00 [PATCH 0/2] wifi: ath10k: clean up structure initialization Zhongqiu Han
2025-10-30 13:00 ` [PATCH 1/2] wifi: ath10k: use = {} to initialize pm_qos_request instead of memset Zhongqiu Han
2025-10-30 13:00 ` [PATCH 2/2] wifi: ath10k: use = {} to initialize bmi_target_info " Zhongqiu Han
@ 2025-10-30 18:26 ` Vasanthakumar Thiagarajan
2025-10-30 21:57 ` Jeff Johnson
3 siblings, 0 replies; 5+ messages in thread
From: Vasanthakumar Thiagarajan @ 2025-10-30 18:26 UTC (permalink / raw)
To: Zhongqiu Han, jjohnson; +Cc: ath10k, linux-wireless, linux-kernel
On 10/30/2025 6:30 PM, Zhongqiu Han wrote:
> This patchset simplifies structure initialization in ath10k by replacing
> explicit memset() calls with zero initializers (`= {}`) for local
> variables.
>
> Patch 1 updates the initialization of `pm_qos_request` in
> ath10k_download_fw().
>
> Patch 2 updates the initialization of `bmi_target_info` in
> ath10k_core_probe_fw().
>
> These changes improve code clarity and efficiency by avoiding unnecessary
> runtime memset calls.
>
> Zhongqiu Han (2):
> wifi: ath10k: use = {} to initialize pm_qos_request instead of memset
> wifi: ath10k: use = {} to initialize bmi_target_info instead of memset
>
> drivers/net/wireless/ath/ath10k/core.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
Branch name is missing, with that addressed
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] wifi: ath10k: clean up structure initialization
2025-10-30 13:00 [PATCH 0/2] wifi: ath10k: clean up structure initialization Zhongqiu Han
` (2 preceding siblings ...)
2025-10-30 18:26 ` [PATCH 0/2] wifi: ath10k: clean up structure initialization Vasanthakumar Thiagarajan
@ 2025-10-30 21:57 ` Jeff Johnson
3 siblings, 0 replies; 5+ messages in thread
From: Jeff Johnson @ 2025-10-30 21:57 UTC (permalink / raw)
To: jjohnson, Zhongqiu Han; +Cc: ath10k, linux-wireless, linux-kernel
On Thu, 30 Oct 2025 21:00:21 +0800, Zhongqiu Han wrote:
> This patchset simplifies structure initialization in ath10k by replacing
> explicit memset() calls with zero initializers (`= {}`) for local
> variables.
>
> Patch 1 updates the initialization of `pm_qos_request` in
> ath10k_download_fw().
>
> [...]
Applied, thanks!
[1/2] wifi: ath10k: use = {} to initialize pm_qos_request instead of memset
commit: 877f9c22fdf424c657de757bfe8543cf77461324
[2/2] wifi: ath10k: use = {} to initialize bmi_target_info instead of memset
commit: 059ca8fd692b67a77fb89e9d4e8f57cf08e32b08
Best regards,
--
Jeff Johnson <jeff.johnson@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-10-30 21:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-30 13:00 [PATCH 0/2] wifi: ath10k: clean up structure initialization Zhongqiu Han
2025-10-30 13:00 ` [PATCH 1/2] wifi: ath10k: use = {} to initialize pm_qos_request instead of memset Zhongqiu Han
2025-10-30 13:00 ` [PATCH 2/2] wifi: ath10k: use = {} to initialize bmi_target_info " Zhongqiu Han
2025-10-30 18:26 ` [PATCH 0/2] wifi: ath10k: clean up structure initialization Vasanthakumar Thiagarajan
2025-10-30 21:57 ` 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®