Skip to contentSkip to conversation

ath11k: fix warning in ath11k_mhi_config

PATCH In review Anilkumar Kolli 2 participants 3 messages Apr 8, 2021 – Apr 22, 2021 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath11k: fix warning in ath11k_mhi_config

Initialize static variable ath11k_mhi_config for all hw_rev, return error for unknown hw_rev.
This patch fixes below Smatch warning:
drivers/net/wireless/ath/ath11k/mhi.c:357 ath11k_mhi_register()
error: uninitialized symbol 'ath11k_mhi_config'.

Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1

Fixes a233811ef600 ("ath11k: Add qcn9074 mhi controller config")
---
 drivers/net/wireless/ath/ath11k/mhi.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath11k/mhi.c +12 -3
index 626764da4d6f..27b394d115e2 100644
@@ -349,10 +349,19 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
 	mhi_ctrl->read_reg = ath11k_mhi_op_read_reg;
 	mhi_ctrl->write_reg = ath11k_mhi_op_write_reg;
 
-	if (ab->hw_rev == ATH11K_HW_QCA6390_HW20)
-		ath11k_mhi_config = &ath11k_mhi_config_qca6390;
-	else if (ab->hw_rev == ATH11K_HW_QCN9074_HW10)
+	switch (ab->hw_rev) {
+	case ATH11K_HW_QCN9074_HW10:
 		ath11k_mhi_config = &ath11k_mhi_config_qcn9074;
+		break;
+	case ATH11K_HW_QCA6390_HW20:
+		ath11k_mhi_config = &ath11k_mhi_config_qca6390;
+		break;
+	default:
+		ath11k_err(ab, "failed assign mhi_config for unknown hw rev %d\n",
+			   ab->hw_rev);
+		mhi_free_controller(mhi_ctrl);
+		return -EINVAL;
+	}
 
 	ret = mhi_register_controller(mhi_ctrl, ath11k_mhi_config);
 	if (ret) {
Signature · 1 line
2.7.4
#1 lore raw
Quoted 6 lines · Anilkumar Kolli

Initialize static variable ath11k_mhi_config for all hw_rev, return error for unknown hw_rev.
This patch fixes below Smatch warning:
drivers/net/wireless/ath/ath11k/mhi.c:357 ath11k_mhi_register()
error: uninitialized symbol 'ath11k_mhi_config'.

Quoted 6 lines

Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1

Fixes a233811ef600 ("ath11k: Add qcn9074 mhi controller config")

Patch applied to ath-next branch of ath.git, thanks.

ff9f732a87ca ath11k: fix warning in ath11k_mhi_config

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#2 lore raw
In reply to Anilkumar Kolli
Quoted 6 lines · Anilkumar Kolli

Initialize static variable ath11k_mhi_config for all hw_rev, return error for unknown hw_rev.
This patch fixes below Smatch warning:
drivers/net/wireless/ath/ath11k/mhi.c:357 ath11k_mhi_register()
error: uninitialized symbol 'ath11k_mhi_config'.

Quoted 6 lines

Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1

Fixes a233811ef600 ("ath11k: Add qcn9074 mhi controller config")

Patch applied to ath-next branch of ath.git, thanks.

ff9f732a87ca ath11k: fix warning in ath11k_mhi_config

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