2015-10-20 18:32:43

by Manikanta

[permalink] [raw]
Subject: [PATCH] ath10k: consolidate if statements in ath10k_wmi_event_mgmt_rx

From: Manikanta Pubbisetty <[email protected]>

This patch combines several if statements into a single if condition
in WMI management rx handler. Found during code review.

Signed-off-by: Manikanta Pubbisetty <[email protected]>
---
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..a9d42ef 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_stats & (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



2015-10-20 19:00:36

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] ath10k: consolidate if statements in ath10k_wmi_event_mgmt_rx

Hi Manikanta,

[auto build test ERROR on wireless-drivers/master -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url: https://github.com/0day-ci/linux/commits/manikanta-pubbisetty-gmail-com/ath10k-consolidate-if-statements-in-ath10k_wmi_event_mgmt_rx/20151021-023414
config: xtensa-allyesconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa

All errors (new ones prefixed by >>):

drivers/net/wireless/ath/ath10k/wmi.c: In function 'ath10k_wmi_event_mgmt_rx':
>> drivers/net/wireless/ath/ath10k/wmi.c:2204:7: error: 'rx_stats' undeclared (first use in this function)
(rx_stats & (WMI_RX_STATUS_ERR_DECRYPT |
^
drivers/net/wireless/ath/ath10k/wmi.c:2204:7: note: each undeclared identifier is reported only once for each function it appears in

vim +/rx_stats +2204 drivers/net/wireless/ath/ath10k/wmi.c

2198 memset(status, 0, sizeof(*status));
2199
2200 ath10k_dbg(ar, ATH10K_DBG_MGMT,
2201 "event mgmt rx status %08x\n", rx_status);
2202
2203 if ((test_bit(ATH10K_CAC_RUNNING, &ar->dev_flags)) ||
> 2204 (rx_stats & (WMI_RX_STATUS_ERR_DECRYPT |
2205 WMI_RX_STATUS_ERR_KEY_CACHE_MISS | WMI_RX_STATUS_ERR_CRC))) {
2206 dev_kfree_skb(skb);
2207 return 0;

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (1.62 kB)
.config.gz (41.34 kB)
Download all attachments