From: Kalle Valo <kvalo@kernel.org>
To: ath12k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH v4 4/6] wifi: ath12k: cleanup unneeded labels
Date: Mon, 7 Oct 2024 19:59:30 +0300 [thread overview]
Message-ID: <20241007165932.78081-5-kvalo@kernel.org> (raw)
In-Reply-To: <20241007165932.78081-1-kvalo@kernel.org>
From: Kalle Valo <quic_kvalo@quicinc.com>
After removing the conf_mutex in the previous patch there are now unnecessary
labels in mac.c. Remove those and instead use directly return.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
---
drivers/net/wireless/ath/ath12k/mac.c | 56 +++++++++++----------------
1 file changed, 22 insertions(+), 34 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 98894b4bf7e8..1d1e91b124ca 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -1282,24 +1282,23 @@ static int ath12k_mac_config(struct ath12k *ar, u32 changed)
ar->monitor_conf_enabled = conf->flags & IEEE80211_CONF_MONITOR;
if (ar->monitor_conf_enabled) {
if (ar->monitor_vdev_created)
- goto exit;
+ return ret;
ret = ath12k_mac_monitor_vdev_create(ar);
if (ret)
- goto exit;
+ return ret;
ret = ath12k_mac_monitor_start(ar);
if (ret)
goto err_mon_del;
} else {
if (!ar->monitor_vdev_created)
- goto exit;
+ return ret;
ret = ath12k_mac_monitor_stop(ar);
if (ret)
- goto exit;
+ return ret;
ath12k_mac_monitor_vdev_delete(ar);
}
}
-exit:
return ret;
err_mon_del:
@@ -4717,10 +4716,9 @@ static int ath12k_mac_op_sta_set_txpwr(struct ieee80211_hw *hw,
if (ret) {
ath12k_warn(ar->ab, "failed to set tx power for station ret: %d\n",
ret);
- goto out;
+ return ret;
}
-out:
return ret;
}
@@ -6472,7 +6470,7 @@ static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif)
if (ret) {
ath12k_warn(ab, "failed to create WMI vdev %d: %d\n",
arvif->vdev_id, ret);
- goto err;
+ return ret;
}
ar->num_created_vdevs++;
@@ -6589,13 +6587,13 @@ static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif)
if (ret) {
ath12k_warn(ar->ab, "failed to delete peer vdev_id %d addr %pM\n",
arvif->vdev_id, vif->addr);
- goto err;
+ return ret;
}
ret = ath12k_wait_for_peer_delete_done(ar, arvif->vdev_id,
vif->addr);
if (ret)
- goto err;
+ return ret;
ar->num_peers--;
}
@@ -7625,21 +7623,18 @@ ath12k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw,
arvif->vdev_type != WMI_VDEV_TYPE_MONITOR &&
!ath12k_peer_exist_by_vdev_id(ab, arvif->vdev_id)) {
memcpy(&arvif->chanctx, ctx, sizeof(*ctx));
- ret = 0;
- goto out;
+ return 0;
}
- if (WARN_ON(arvif->is_started)) {
- ret = -EBUSY;
- goto out;
- }
+ if (WARN_ON(arvif->is_started))
+ return -EBUSY;
if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) {
ret = ath12k_mac_monitor_start(ar);
if (ret)
- goto out;
+ return ret;
arvif->is_started = true;
- goto out;
+ return ret;
}
ret = ath12k_mac_vdev_start(arvif, ctx);
@@ -7647,7 +7642,7 @@ ath12k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw,
ath12k_warn(ab, "failed to start vdev %i addr %pM on freq %d: %d\n",
arvif->vdev_id, vif->addr,
ctx->def.chan->center_freq, ret);
- goto out;
+ return ret;
}
if (arvif->vdev_type != WMI_VDEV_TYPE_MONITOR && ar->monitor_vdev_created)
@@ -7657,7 +7652,6 @@ ath12k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw,
/* TODO: Setup ps and cts/rts protection */
-out:
return ret;
}
@@ -8125,10 +8119,8 @@ ath12k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw,
ldpc = !!(ar->ht_cap_info & WMI_HT_CAP_LDPC);
sgi = mask->control[band].gi;
- if (sgi == NL80211_TXRATE_FORCE_LGI) {
- ret = -EINVAL;
- goto out;
- }
+ if (sgi == NL80211_TXRATE_FORCE_LGI)
+ return -EINVAL;
/* mac80211 doesn't support sending a fixed HT/VHT MCS alone, rather it
* requires passing at least one of used basic rates along with them.
@@ -8144,7 +8136,7 @@ ath12k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw,
if (ret) {
ath12k_warn(ar->ab, "failed to get single legacy rate for vdev %i: %d\n",
arvif->vdev_id, ret);
- goto out;
+ return ret;
}
ieee80211_iterate_stations_mtx(hw,
ath12k_mac_disable_peer_fixed_rate,
@@ -8189,8 +8181,7 @@ ath12k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw,
*/
ath12k_warn(ar->ab,
"Setting more than one MCS Value in bitrate mask not supported\n");
- ret = -EINVAL;
- goto out;
+ return -EINVAL;
}
ieee80211_iterate_stations_mtx(hw,
@@ -8209,7 +8200,6 @@ ath12k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw,
arvif->vdev_id, ret);
}
-out:
return ret;
}
@@ -8520,7 +8510,7 @@ static int ath12k_mac_op_remain_on_channel(struct ieee80211_hw *hw,
spin_unlock_bh(&ar->data_lock);
if (ret)
- goto exit;
+ return ret;
scan_time_msec = hw->wiphy->max_remain_on_channel_duration * 2;
@@ -8529,10 +8519,8 @@ static int ath12k_mac_op_remain_on_channel(struct ieee80211_hw *hw,
arg.num_chan = 1;
arg.chan_list = kcalloc(arg.num_chan, sizeof(*arg.chan_list),
GFP_KERNEL);
- if (!arg.chan_list) {
- ret = -ENOMEM;
- goto exit;
- }
+ if (!arg.chan_list)
+ return -ENOMEM;
arg.vdev_id = arvif->vdev_id;
arg.scan_id = ATH12K_SCAN_ID;
@@ -8570,7 +8558,7 @@ static int ath12k_mac_op_remain_on_channel(struct ieee80211_hw *hw,
free_chan_list:
kfree(arg.chan_list);
-exit:
+
return ret;
}
--
2.39.5
next prev parent reply other threads:[~2024-10-07 16:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 16:59 [PATCH v4 0/6] wifi: ath12k: switch to using wiphy_lock() Kalle Valo
2024-10-07 16:59 ` [PATCH v4 1/6] wifi: ath12k: fix atomic calls in ath12k_mac_op_set_bitrate_mask() Kalle Valo
2024-10-10 14:56 ` Jeff Johnson
2024-10-07 16:59 ` [PATCH v4 2/6] wifi: ath12k: convert struct ath12k_sta::update_wk to use struct wiphy_work Kalle Valo
2024-10-07 16:59 ` [PATCH v4 3/6] wifi: ath12k: switch to using wiphy_lock() and remove ar->conf_mutex Kalle Valo
2024-10-10 15:14 ` Jeff Johnson
2024-10-07 16:59 ` Kalle Valo [this message]
2024-10-07 16:59 ` [PATCH v4 5/6] wifi: ath12k: ath12k_mac_set_key(): remove exit label Kalle Valo
2024-10-10 15:07 ` Jeff Johnson
2024-10-07 16:59 ` [PATCH v4 6/6] wifi: ath12k: ath12k_mac_op_sta_state(): clean up update_wk cancellation Kalle Valo
2024-10-11 14:39 ` [PATCH v4 0/6] wifi: ath12k: switch to using wiphy_lock() Jeff Johnson
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=20241007165932.78081-5-kvalo@kernel.org \
--to=kvalo@kernel.org \
--cc=ath12k@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).