From: Kalle Valo <kvalo@kernel.org>
To: ath11k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 07/15] wifi: ath11k: wmi: use common error handling style
Date: Fri, 9 Jun 2023 17:24:32 +0300 [thread overview]
Message-ID: <20230609142440.24643-8-kvalo@kernel.org> (raw)
In-Reply-To: <20230609142440.24643-1-kvalo@kernel.org>
From: Kalle Valo <quic_kvalo@quicinc.com>
Also these functions don't follow the preferred style so fix those.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
---
drivers/net/wireless/ath/ath11k/wmi.c | 80 +++++++++++++++++++--------
1 file changed, 56 insertions(+), 24 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 3b26e227e80c..972f282a3032 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -3181,10 +3181,12 @@ int ath11k_wmi_send_twt_enable_cmd(struct ath11k *ar, u32 pdev_id,
if (ret) {
ath11k_warn(ab, "Failed to send WMI_TWT_ENABLE_CMDID");
dev_kfree_skb(skb);
- } else {
- ar->twt_enabled = 1;
+ return ret;
}
- return ret;
+
+ ar->twt_enabled = 1;
+
+ return 0;
}
int
@@ -3211,10 +3213,12 @@ ath11k_wmi_send_twt_disable_cmd(struct ath11k *ar, u32 pdev_id)
if (ret) {
ath11k_warn(ab, "Failed to send WMI_TWT_DISABLE_CMDID");
dev_kfree_skb(skb);
- } else {
- ar->twt_enabled = 0;
+ return ret;
}
- return ret;
+
+ ar->twt_enabled = 0;
+
+ return 0;
}
int ath11k_wmi_send_twt_add_dialog_cmd(struct ath11k *ar,
@@ -3266,8 +3270,10 @@ int ath11k_wmi_send_twt_add_dialog_cmd(struct ath11k *ar,
"failed to send wmi command to add twt dialog: %d",
ret);
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int ath11k_wmi_send_twt_del_dialog_cmd(struct ath11k *ar,
@@ -3303,8 +3309,10 @@ int ath11k_wmi_send_twt_del_dialog_cmd(struct ath11k *ar,
"failed to send wmi command to delete twt dialog: %d",
ret);
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int ath11k_wmi_send_twt_pause_dialog_cmd(struct ath11k *ar,
@@ -3341,8 +3349,10 @@ int ath11k_wmi_send_twt_pause_dialog_cmd(struct ath11k *ar,
"failed to send wmi command to pause twt dialog: %d",
ret);
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int ath11k_wmi_send_twt_resume_dialog_cmd(struct ath11k *ar,
@@ -3382,8 +3392,10 @@ int ath11k_wmi_send_twt_resume_dialog_cmd(struct ath11k *ar,
"failed to send wmi command to resume twt dialog: %d",
ret);
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int
@@ -3417,8 +3429,10 @@ ath11k_wmi_send_obss_spr_cmd(struct ath11k *ar, u32 vdev_id,
ath11k_warn(ab,
"Failed to send WMI_PDEV_OBSS_PD_SPATIAL_REUSE_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int
@@ -3453,9 +3467,10 @@ ath11k_wmi_pdev_set_srg_bss_color_bitmap(struct ath11k *ar, u32 *bitmap)
ath11k_warn(ab,
"failed to send WMI_PDEV_SET_SRG_BSS_COLOR_BITMAP_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+ return 0;
}
int
@@ -3491,9 +3506,10 @@ ath11k_wmi_pdev_set_srg_patial_bssid_bitmap(struct ath11k *ar, u32 *bitmap)
ath11k_warn(ab,
"failed to send WMI_PDEV_SET_SRG_PARTIAL_BSSID_BITMAP_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+ return 0;
}
int
@@ -3529,9 +3545,10 @@ ath11k_wmi_pdev_srg_obss_color_enable_bitmap(struct ath11k *ar, u32 *bitmap)
ath11k_warn(ab,
"failed to send WMI_PDEV_SET_SRG_OBSS_COLOR_ENABLE_BITMAP_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+ return 0;
}
int
@@ -3567,9 +3584,10 @@ ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap(struct ath11k *ar, u32 *bitmap)
ath11k_warn(ab,
"failed to send WMI_PDEV_SET_SRG_OBSS_BSSID_ENABLE_BITMAP_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+ return 0;
}
int
@@ -3605,9 +3623,10 @@ ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap(struct ath11k *ar, u32 *bitmap)
ath11k_warn(ab,
"failed to send WMI_PDEV_SET_NON_SRG_OBSS_COLOR_ENABLE_BITMAP_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+ return 0;
}
int
@@ -3643,9 +3662,10 @@ ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap(struct ath11k *ar, u32 *bitmap)
ath11k_warn(ab,
"failed to send WMI_PDEV_SET_NON_SRG_OBSS_BSSID_ENABLE_BITMAP_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+ return 0;
}
int
@@ -3688,8 +3708,10 @@ ath11k_wmi_send_obss_color_collision_cfg_cmd(struct ath11k *ar, u32 vdev_id,
if (ret) {
ath11k_warn(ab, "Failed to send WMI_OBSS_COLOR_COLLISION_DET_CONFIG_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int ath11k_wmi_send_bss_color_change_enable_cmd(struct ath11k *ar, u32 vdev_id,
@@ -3722,8 +3744,10 @@ int ath11k_wmi_send_bss_color_change_enable_cmd(struct ath11k *ar, u32 vdev_id,
if (ret) {
ath11k_warn(ab, "Failed to send WMI_BSS_COLOR_CHANGE_ENABLE_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int ath11k_wmi_fils_discovery_tmpl(struct ath11k *ar, u32 vdev_id,
@@ -3765,8 +3789,10 @@ int ath11k_wmi_fils_discovery_tmpl(struct ath11k *ar, u32 vdev_id,
"WMI vdev %i failed to send FILS discovery template command\n",
vdev_id);
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int ath11k_wmi_probe_resp_tmpl(struct ath11k *ar, u32 vdev_id,
@@ -3818,8 +3844,10 @@ int ath11k_wmi_probe_resp_tmpl(struct ath11k *ar, u32 vdev_id,
"WMI vdev %i failed to send probe response template command\n",
vdev_id);
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int ath11k_wmi_fils_discovery(struct ath11k *ar, u32 vdev_id, u32 interval,
@@ -3853,8 +3881,10 @@ int ath11k_wmi_fils_discovery(struct ath11k *ar, u32 vdev_id, u32 interval,
"WMI vdev %i failed to send FILS discovery enable/disable command\n",
vdev_id);
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
static void
@@ -4122,9 +4152,10 @@ static int ath11k_init_cmd_send(struct ath11k_pdev_wmi *wmi,
if (ret) {
ath11k_warn(ab, "failed to send WMI_INIT_CMDID\n");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+ return 0;
}
int ath11k_wmi_pdev_lro_cfg(struct ath11k *ar,
@@ -4213,9 +4244,10 @@ int ath11k_wmi_set_hw_mode(struct ath11k_base *ab,
if (ret) {
ath11k_warn(ab, "failed to send WMI_PDEV_SET_HW_MODE_CMDID\n");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+ return 0;
}
int ath11k_wmi_cmd_init(struct ath11k_base *ab)
--
2.30.2
--
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@kernel.org>
To: ath11k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 07/15] wifi: ath11k: wmi: use common error handling style
Date: Fri, 9 Jun 2023 17:24:32 +0300 [thread overview]
Message-ID: <20230609142440.24643-8-kvalo@kernel.org> (raw)
In-Reply-To: <20230609142440.24643-1-kvalo@kernel.org>
From: Kalle Valo <quic_kvalo@quicinc.com>
Also these functions don't follow the preferred style so fix those.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
---
drivers/net/wireless/ath/ath11k/wmi.c | 80 +++++++++++++++++++--------
1 file changed, 56 insertions(+), 24 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 3b26e227e80c..972f282a3032 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -3181,10 +3181,12 @@ int ath11k_wmi_send_twt_enable_cmd(struct ath11k *ar, u32 pdev_id,
if (ret) {
ath11k_warn(ab, "Failed to send WMI_TWT_ENABLE_CMDID");
dev_kfree_skb(skb);
- } else {
- ar->twt_enabled = 1;
+ return ret;
}
- return ret;
+
+ ar->twt_enabled = 1;
+
+ return 0;
}
int
@@ -3211,10 +3213,12 @@ ath11k_wmi_send_twt_disable_cmd(struct ath11k *ar, u32 pdev_id)
if (ret) {
ath11k_warn(ab, "Failed to send WMI_TWT_DISABLE_CMDID");
dev_kfree_skb(skb);
- } else {
- ar->twt_enabled = 0;
+ return ret;
}
- return ret;
+
+ ar->twt_enabled = 0;
+
+ return 0;
}
int ath11k_wmi_send_twt_add_dialog_cmd(struct ath11k *ar,
@@ -3266,8 +3270,10 @@ int ath11k_wmi_send_twt_add_dialog_cmd(struct ath11k *ar,
"failed to send wmi command to add twt dialog: %d",
ret);
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int ath11k_wmi_send_twt_del_dialog_cmd(struct ath11k *ar,
@@ -3303,8 +3309,10 @@ int ath11k_wmi_send_twt_del_dialog_cmd(struct ath11k *ar,
"failed to send wmi command to delete twt dialog: %d",
ret);
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int ath11k_wmi_send_twt_pause_dialog_cmd(struct ath11k *ar,
@@ -3341,8 +3349,10 @@ int ath11k_wmi_send_twt_pause_dialog_cmd(struct ath11k *ar,
"failed to send wmi command to pause twt dialog: %d",
ret);
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int ath11k_wmi_send_twt_resume_dialog_cmd(struct ath11k *ar,
@@ -3382,8 +3392,10 @@ int ath11k_wmi_send_twt_resume_dialog_cmd(struct ath11k *ar,
"failed to send wmi command to resume twt dialog: %d",
ret);
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int
@@ -3417,8 +3429,10 @@ ath11k_wmi_send_obss_spr_cmd(struct ath11k *ar, u32 vdev_id,
ath11k_warn(ab,
"Failed to send WMI_PDEV_OBSS_PD_SPATIAL_REUSE_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int
@@ -3453,9 +3467,10 @@ ath11k_wmi_pdev_set_srg_bss_color_bitmap(struct ath11k *ar, u32 *bitmap)
ath11k_warn(ab,
"failed to send WMI_PDEV_SET_SRG_BSS_COLOR_BITMAP_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+ return 0;
}
int
@@ -3491,9 +3506,10 @@ ath11k_wmi_pdev_set_srg_patial_bssid_bitmap(struct ath11k *ar, u32 *bitmap)
ath11k_warn(ab,
"failed to send WMI_PDEV_SET_SRG_PARTIAL_BSSID_BITMAP_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+ return 0;
}
int
@@ -3529,9 +3545,10 @@ ath11k_wmi_pdev_srg_obss_color_enable_bitmap(struct ath11k *ar, u32 *bitmap)
ath11k_warn(ab,
"failed to send WMI_PDEV_SET_SRG_OBSS_COLOR_ENABLE_BITMAP_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+ return 0;
}
int
@@ -3567,9 +3584,10 @@ ath11k_wmi_pdev_srg_obss_bssid_enable_bitmap(struct ath11k *ar, u32 *bitmap)
ath11k_warn(ab,
"failed to send WMI_PDEV_SET_SRG_OBSS_BSSID_ENABLE_BITMAP_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+ return 0;
}
int
@@ -3605,9 +3623,10 @@ ath11k_wmi_pdev_non_srg_obss_color_enable_bitmap(struct ath11k *ar, u32 *bitmap)
ath11k_warn(ab,
"failed to send WMI_PDEV_SET_NON_SRG_OBSS_COLOR_ENABLE_BITMAP_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+ return 0;
}
int
@@ -3643,9 +3662,10 @@ ath11k_wmi_pdev_non_srg_obss_bssid_enable_bitmap(struct ath11k *ar, u32 *bitmap)
ath11k_warn(ab,
"failed to send WMI_PDEV_SET_NON_SRG_OBSS_BSSID_ENABLE_BITMAP_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+ return 0;
}
int
@@ -3688,8 +3708,10 @@ ath11k_wmi_send_obss_color_collision_cfg_cmd(struct ath11k *ar, u32 vdev_id,
if (ret) {
ath11k_warn(ab, "Failed to send WMI_OBSS_COLOR_COLLISION_DET_CONFIG_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int ath11k_wmi_send_bss_color_change_enable_cmd(struct ath11k *ar, u32 vdev_id,
@@ -3722,8 +3744,10 @@ int ath11k_wmi_send_bss_color_change_enable_cmd(struct ath11k *ar, u32 vdev_id,
if (ret) {
ath11k_warn(ab, "Failed to send WMI_BSS_COLOR_CHANGE_ENABLE_CMDID");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int ath11k_wmi_fils_discovery_tmpl(struct ath11k *ar, u32 vdev_id,
@@ -3765,8 +3789,10 @@ int ath11k_wmi_fils_discovery_tmpl(struct ath11k *ar, u32 vdev_id,
"WMI vdev %i failed to send FILS discovery template command\n",
vdev_id);
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int ath11k_wmi_probe_resp_tmpl(struct ath11k *ar, u32 vdev_id,
@@ -3818,8 +3844,10 @@ int ath11k_wmi_probe_resp_tmpl(struct ath11k *ar, u32 vdev_id,
"WMI vdev %i failed to send probe response template command\n",
vdev_id);
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
int ath11k_wmi_fils_discovery(struct ath11k *ar, u32 vdev_id, u32 interval,
@@ -3853,8 +3881,10 @@ int ath11k_wmi_fils_discovery(struct ath11k *ar, u32 vdev_id, u32 interval,
"WMI vdev %i failed to send FILS discovery enable/disable command\n",
vdev_id);
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+
+ return 0;
}
static void
@@ -4122,9 +4152,10 @@ static int ath11k_init_cmd_send(struct ath11k_pdev_wmi *wmi,
if (ret) {
ath11k_warn(ab, "failed to send WMI_INIT_CMDID\n");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+ return 0;
}
int ath11k_wmi_pdev_lro_cfg(struct ath11k *ar,
@@ -4213,9 +4244,10 @@ int ath11k_wmi_set_hw_mode(struct ath11k_base *ab,
if (ret) {
ath11k_warn(ab, "failed to send WMI_PDEV_SET_HW_MODE_CMDID\n");
dev_kfree_skb(skb);
+ return ret;
}
- return ret;
+ return 0;
}
int ath11k_wmi_cmd_init(struct ath11k_base *ab)
--
2.30.2
next prev parent reply other threads:[~2023-06-09 14:24 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-09 14:24 [PATCH 00/15] wifi: ath11k: debug message improvements Kalle Valo
2023-06-09 14:24 ` Kalle Valo
2023-06-09 14:24 ` [PATCH 01/15] wifi: ath11k: debug: remove unused ATH11K_DBG_ANY Kalle Valo
2023-06-09 14:24 ` Kalle Valo
2023-06-13 9:11 ` Kalle Valo
2023-06-13 9:11 ` Kalle Valo
2023-06-09 14:24 ` [PATCH 02/15] wifi: ath11k: print debug level in debug messages Kalle Valo
2023-06-09 14:24 ` Kalle Valo
2023-06-09 14:24 ` [PATCH 03/15] wifi: ath11k: remove manual mask names from " Kalle Valo
2023-06-09 14:24 ` Kalle Valo
2023-06-09 14:24 ` [PATCH 04/15] wifi: ath11k: add WMI event " Kalle Valo
2023-06-09 14:24 ` Kalle Valo
2023-06-09 14:24 ` [PATCH 05/15] wifi: ath11k: remove unsupported event handlers Kalle Valo
2023-06-09 14:24 ` Kalle Valo
2023-06-09 14:24 ` [PATCH 06/15] wifi: ath11k: wmi: cleanup error handling in ath11k_wmi_send_init_country_cmd() Kalle Valo
2023-06-09 14:24 ` Kalle Valo
2023-06-09 14:24 ` Kalle Valo [this message]
2023-06-09 14:24 ` [PATCH 07/15] wifi: ath11k: wmi: use common error handling style Kalle Valo
2023-06-09 14:24 ` [PATCH 08/15] wifi: ath11k: wmi: add unified command debug messages Kalle Valo
2023-06-09 14:24 ` Kalle Valo
2023-06-09 14:24 ` [PATCH 09/15] wifi: ath11k: pci: cleanup debug logging Kalle Valo
2023-06-09 14:24 ` Kalle Valo
2023-06-09 14:24 ` [PATCH 10/15] wifi: ath11k: dp: cleanup debug message Kalle Valo
2023-06-09 14:24 ` Kalle Valo
2023-06-09 14:24 ` [PATCH 11/15] wifi: ath11k: debug: use all upper case in ATH11k_DBG_HAL Kalle Valo
2023-06-09 14:24 ` Kalle Valo
2023-06-09 14:24 ` [PATCH 12/15] wifi: ath11k: hal: cleanup debug message Kalle Valo
2023-06-09 14:24 ` Kalle Valo
2023-06-09 14:24 ` [PATCH 13/15] wifi: ath11k: don't use %pK Kalle Valo
2023-06-09 14:24 ` Kalle Valo
2023-06-09 14:24 ` [PATCH 14/15] wifi: ath11k: htc: cleanup debug messages Kalle Valo
2023-06-09 14:24 ` Kalle Valo
2023-06-09 14:24 ` [PATCH 15/15] wifi: ath11k: debug: add ATH11K_DBG_CE Kalle Valo
2023-06-09 14:24 ` Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230609142440.24643-8-kvalo@kernel.org \
--to=kvalo@kernel.org \
--cc=ath11k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.