linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2] ath10k: consolidate if statements in ath10k_wmi_event_mgmt_rx
@ 2015-10-20  6:41 manikanta.pubbisetty
  2015-11-04 17:29 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: manikanta.pubbisetty @ 2015-10-20  6:41 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Manikanta Pubbisetty

From: Manikanta Pubbisetty <manikanta.pubbisetty@gmail.com>

This patch replaces mutliple if conditional checks with a single if condition
in WMI management rx handler. Found during code review.

Signed-off-by: Manikanta Pubbisetty <manikanta.pubbisetty@gmail.com>
---
v2:
	1) Changed commit log
	2) removed compilation error

 drivers/net/wireless/ath/ath10k/wmi.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 6e7d7a7..551e4b63 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -2200,22 +2200,9 @@ int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
 	ath10k_dbg(ar, ATH10K_DBG_MGMT,
 		   "event mgmt rx status %08x\n", rx_status);
 
-	if (test_bit(ATH10K_CAC_RUNNING, &ar->dev_flags)) {
-		dev_kfree_skb(skb);
-		return 0;
-	}
-
-	if (rx_status & WMI_RX_STATUS_ERR_DECRYPT) {
-		dev_kfree_skb(skb);
-		return 0;
-	}
-
-	if (rx_status & WMI_RX_STATUS_ERR_KEY_CACHE_MISS) {
-		dev_kfree_skb(skb);
-		return 0;
-	}
-
-	if (rx_status & WMI_RX_STATUS_ERR_CRC) {
+	if ((test_bit(ATH10K_CAC_RUNNING, &ar->dev_flags)) ||
+	    (rx_status & (WMI_RX_STATUS_ERR_DECRYPT |
+	    WMI_RX_STATUS_ERR_KEY_CACHE_MISS | WMI_RX_STATUS_ERR_CRC))) {
 		dev_kfree_skb(skb);
 		return 0;
 	}
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCHv2] ath10k: consolidate if statements in ath10k_wmi_event_mgmt_rx
  2015-10-20  6:41 [PATCHv2] ath10k: consolidate if statements in ath10k_wmi_event_mgmt_rx manikanta.pubbisetty
@ 2015-11-04 17:29 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2015-11-04 17:29 UTC (permalink / raw)
  To: manikanta.pubbisetty; +Cc: ath10k, linux-wireless

manikanta.pubbisetty@gmail.com writes:

> From: Manikanta Pubbisetty <manikanta.pubbisetty@gmail.com>
>
> This patch replaces mutliple if conditional checks with a single if condition
> in WMI management rx handler. Found during code review.
>
> Signed-off-by: Manikanta Pubbisetty <manikanta.pubbisetty@gmail.com>

Applied, thanks.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-04 17:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-20  6:41 [PATCHv2] ath10k: consolidate if statements in ath10k_wmi_event_mgmt_rx manikanta.pubbisetty
2015-11-04 17:29 ` Kalle Valo

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).