ATH11K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Manikanta Pubbisetty <mpubbise@codeaurora.org>
To: ath11k@lists.infradead.org
Cc: Manikanta Pubbisetty <mpubbise@codeaurora.org>
Subject: [PATCH 8/8] ath11k: use switch statement when necessary
Date: Mon, 24 Jun 2019 17:19:29 +0530	[thread overview]
Message-ID: <1561376969-3999-8-git-send-email-mpubbise@codeaurora.org> (raw)
In-Reply-To: <1561376969-3999-1-git-send-email-mpubbise@codeaurora.org>

use switch statement instead of mutliple if statements in
ath11k_mac_op_add_interface() in mac.c file.

Signed-off-by: Manikanta Pubbisetty <mpubbise@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/mac.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 2274f77..fa92cf7 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -3828,7 +3828,8 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
 		goto err_vdev_del;
 	}
 
-	if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
+	switch (arvif->vdev_type) {
+	case WMI_VDEV_TYPE_AP:
 		peer_param.vdev_id = arvif->vdev_id;
 		peer_param.peer_addr = vif->addr;
 		peer_param.peer_type = WMI_PEER_TYPE_DEFAULT;
@@ -3838,18 +3839,15 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
 				    arvif->vdev_id, ret);
 			goto err_vdev_del;
 		}
-	}
 
-	if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
 		ret = ath11k_mac_set_kickout(arvif);
 		if (ret) {
 			ath11k_warn(ar->ab, "failed to set vdev %i kickout parameters: %d\n",
 				    arvif->vdev_id, ret);
 			goto err_peer_del;
 		}
-	}
-
-	if (arvif->vdev_type == WMI_VDEV_TYPE_STA) {
+		break;
+	case WMI_VDEV_TYPE_STA:
 		param_id = WMI_STA_PS_PARAM_RX_WAKE_POLICY;
 		param_value = WMI_STA_PS_RX_WAKE_POLICY_WAKE;
 		ret = ath11k_wmi_set_sta_ps_param(ar, arvif->vdev_id,
@@ -3879,6 +3877,9 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
 				    arvif->vdev_id, ret);
 			goto err_peer_del;
 		}
+		break;
+	default:
+		break;
 	}
 
 	arvif->txpower = vif->bss_conf.txpower;
-- 
2.7.4


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

  parent reply	other threads:[~2019-06-24 11:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 11:49 [PATCH 1/8] ath11k: correct prefix for public functions in mac.c Manikanta Pubbisetty
2019-06-24 11:49 ` [PATCH 2/8] ath11k: make ath11k_mgmt_over_wmi_tx_*() functions static Manikanta Pubbisetty
2019-06-24 11:49 ` [PATCH 3/8] ath11k: move ath11k_smps_map[] to the beginning of the file Manikanta Pubbisetty
2019-06-24 11:49 ` [PATCH 4/8] ath11k: use ath11k_mac_op_ prefix for functions in ath11k_ops Manikanta Pubbisetty
2019-06-24 11:49 ` [PATCH 5/8] ath11k: add approprite comments for no-op functions Manikanta Pubbisetty
2019-06-24 11:49 ` [PATCH 6/8] ath11k: avoid use of magic numbers Manikanta Pubbisetty
2019-06-24 11:49 ` [PATCH 7/8] ath11k: remove unnecessary parenthesis Manikanta Pubbisetty
2019-06-24 11:49 ` Manikanta Pubbisetty [this message]
2019-06-25 14:23 ` [PATCH 1/8] ath11k: correct prefix for public functions in mac.c 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=1561376969-3999-8-git-send-email-mpubbise@codeaurora.org \
    --to=mpubbise@codeaurora.org \
    --cc=ath11k@lists.infradead.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