[PATCH] ath6kl: fix return value in ath6kl_wmi_set_pvb_cmd

2016-09-18 Thread Chaehyun Lim
When building with W=1, we got one warning as belows:
drivers/net/wireless/ath/ath6kl/wmi.c:3509:6: warning: variable ‘ret’
set but not used [-Wunused-but-set-variable]

At the end of ath6kl_wmi_set_pvb_cmd, it is returned by 0 regardless of
return value of ath6kl_wmi_cmd_send.
This patch fixes return value from 0 to ret that has result of
ath6kl_wmi_cmd_send execution.

Signed-off-by: Chaehyun Lim <chaehyun@gmail.com>
---
 drivers/net/wireless/ath/ath6kl/wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c 
b/drivers/net/wireless/ath/ath6kl/wmi.c
index b8cf04d..3fd1cc9 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -3520,7 +3520,7 @@ int ath6kl_wmi_set_pvb_cmd(struct wmi *wmi, u8 if_idx, 
u16 aid,
ret = ath6kl_wmi_cmd_send(wmi, if_idx, skb, WMI_AP_SET_PVB_CMDID,
  NO_SYNC_WMIFLAG);
 
-   return 0;
+   return ret;
 }
 
 int ath6kl_wmi_set_rx_frame_format_cmd(struct wmi *wmi, u8 if_idx,
-- 
2.9.3



[PATCH] ath10k: remove unused variable ar_pci

2016-09-05 Thread Chaehyun Lim
Trival fix to remove unused variable ar_pci in ath10k_pci_tx_pipe_cleanup
when building with W=1:
drivers/net/wireless/ath/ath10k/pci.c:1696:21: warning: variable
'ar_pci' set but not used [-Wunused-but-set-variable]

Signed-off-by: Chaehyun Lim <chaehyun@gmail.com>
---
 drivers/net/wireless/ath/ath10k/pci.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 1b841ad..afd5ef7 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -1693,14 +1693,12 @@ static void ath10k_pci_rx_pipe_cleanup(struct 
ath10k_pci_pipe *pci_pipe)
 static void ath10k_pci_tx_pipe_cleanup(struct ath10k_pci_pipe *pci_pipe)
 {
struct ath10k *ar;
-   struct ath10k_pci *ar_pci;
struct ath10k_ce_pipe *ce_pipe;
struct ath10k_ce_ring *ce_ring;
struct sk_buff *skb;
int i;
 
ar = pci_pipe->hif_ce_state;
-   ar_pci = ath10k_pci_priv(ar);
ce_pipe = pci_pipe->ce_hdl;
ce_ring = ce_pipe->src_ring;
 
-- 
2.9.2



[PATCH V2 2/2] ath6kl: replace semaphore with mutex

2016-06-21 Thread Chaehyun Lim
It replaces struct semaphore sem with struct mutex mutex

Reported-by: kbuild test robot <l...@intel.com>
Signed-off-by: Chaehyun Lim <chaehyun@gmail.com>
---
V2: fix build failure reported by kbuild test robot

 drivers/net/wireless/ath/ath6kl/cfg80211.c | 30 +++---
 drivers/net/wireless/ath/ath6kl/core.c |  2 +-
 drivers/net/wireless/ath/ath6kl/core.h |  2 +-
 drivers/net/wireless/ath/ath6kl/debug.c| 12 ++--
 drivers/net/wireless/ath/ath6kl/init.c |  6 +++---
 5 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c 
b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index f6b5390..d4eb066 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -480,14 +480,14 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, 
struct net_device *dev,
return -EINVAL;
}
 
-   if (down_interruptible(>sem)) {
+   if (mutex_lock_interruptible(>mutex)) {
ath6kl_err("busy, couldn't get access\n");
return -ERESTARTSYS;
}
 
if (test_bit(DESTROY_IN_PROGRESS, >flag)) {
ath6kl_err("busy, destroy in progress\n");
-   up(>sem);
+   mutex_unlock(>mutex);
return -EBUSY;
}
 
@@ -500,14 +500,14 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, 
struct net_device *dev,
 WMI_TIMEOUT);
if (signal_pending(current)) {
ath6kl_err("cmd queue drain timeout\n");
-   up(>sem);
+   mutex_unlock(>mutex);
return -EINTR;
}
}
 
status = ath6kl_set_assoc_req_ies(vif, sme->ie, sme->ie_len);
if (status) {
-   up(>sem);
+   mutex_unlock(>mutex);
return status;
}
 
@@ -522,7 +522,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, 
struct net_device *dev,
  vif->req_bssid,
  vif->ch_hint);
 
-   up(>sem);
+   mutex_unlock(>mutex);
if (status) {
ath6kl_err("wmi_reconnect_cmd failed\n");
return -EIO;
@@ -548,7 +548,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, 
struct net_device *dev,
 
status = ath6kl_set_auth_type(vif, sme->auth_type);
if (status) {
-   up(>sem);
+   mutex_unlock(>mutex);
return status;
}
 
@@ -570,7 +570,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, 
struct net_device *dev,
if (sme->key_idx > WMI_MAX_KEY_INDEX) {
ath6kl_err("key index %d out of bounds\n",
   sme->key_idx);
-   up(>sem);
+   mutex_unlock(>mutex);
return -ENOENT;
}
 
@@ -594,7 +594,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, 
struct net_device *dev,
if (ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx,
 ALL_BSS_FILTER, 0) != 0) {
ath6kl_err("couldn't set bss filtering\n");
-   up(>sem);
+   mutex_unlock(>mutex);
return -EIO;
}
}
@@ -626,7 +626,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, 
struct net_device *dev,
   0);
if (status) {
ath6kl_err("couldn't set listen intervel\n");
-   up(>sem);
+   mutex_unlock(>mutex);
return status;
}
}
@@ -651,7 +651,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, 
struct net_device *dev,
ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, 0, 0,
  sme->bg_scan_period, 0, 0, 0, 3, 0, 0, 0);
 
-   up(>sem);
+   mutex_unlock(>mutex);
 
if (status == -EINVAL) {
memset(vif->ssid, 0, sizeof(vif->ssid));
@@ -832,7 +832,7 @@ static int ath6kl_cfg80211_disconnect(struct wiphy *wiphy,
return -EBUSY;
}
 
-   if (down_interruptible(>sem)) {
+   if (mutex_lock_interruptible(>mutex)) {
ath6kl_err("busy, couldn't get access\n");
return -ERESTARTSYS;
}
@@ -845,7 +845,7 @@ static int ath6kl_cfg80211_disconnect(struct wiphy *wiphy,
if (!test

[PATCH 1/2] ath10k: remove unused

2016-06-21 Thread Chaehyun Lim
 is not used anymore, so just remove it.

Signed-off-by: Chaehyun Lim <chaehyun@gmail.com>
---
 drivers/net/wireless/ath/ath10k/htc.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/htc.h 
b/drivers/net/wireless/ath/ath10k/htc.h
index cc82718..0c55cd9 100644
--- a/drivers/net/wireless/ath/ath10k/htc.h
+++ b/drivers/net/wireless/ath/ath10k/htc.h
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 struct ath10k;
-- 
2.9.0



[PATCH 2/2] ath6kl: replace semaphore with mutex

2016-06-21 Thread Chaehyun Lim
It replaces struct semaphore sem with struct mutex mutex

Signed-off-by: Chaehyun Lim <chaehyun@gmail.com>
---
 drivers/net/wireless/ath/ath6kl/cfg80211.c | 30 +++---
 drivers/net/wireless/ath/ath6kl/core.c |  2 +-
 drivers/net/wireless/ath/ath6kl/core.h |  2 +-
 drivers/net/wireless/ath/ath6kl/debug.c| 12 ++--
 drivers/net/wireless/ath/ath6kl/init.c |  6 +++---
 5 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c 
b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index f6b5390..d4eb066 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -480,14 +480,14 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, 
struct net_device *dev,
return -EINVAL;
}
 
-   if (down_interruptible(>sem)) {
+   if (mutex_lock_interruptible(>mutex)) {
ath6kl_err("busy, couldn't get access\n");
return -ERESTARTSYS;
}
 
if (test_bit(DESTROY_IN_PROGRESS, >flag)) {
ath6kl_err("busy, destroy in progress\n");
-   up(>sem);
+   mutex_unlock(>mutex);
return -EBUSY;
}
 
@@ -500,14 +500,14 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, 
struct net_device *dev,
 WMI_TIMEOUT);
if (signal_pending(current)) {
ath6kl_err("cmd queue drain timeout\n");
-   up(>sem);
+   mutex_unlock(>mutex);
return -EINTR;
}
}
 
status = ath6kl_set_assoc_req_ies(vif, sme->ie, sme->ie_len);
if (status) {
-   up(>sem);
+   mutex_unlock(>mutex);
return status;
}
 
@@ -522,7 +522,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, 
struct net_device *dev,
  vif->req_bssid,
  vif->ch_hint);
 
-   up(>sem);
+   mutex_unlock(>mutex);
if (status) {
ath6kl_err("wmi_reconnect_cmd failed\n");
return -EIO;
@@ -548,7 +548,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, 
struct net_device *dev,
 
status = ath6kl_set_auth_type(vif, sme->auth_type);
if (status) {
-   up(>sem);
+   mutex_unlock(>mutex);
return status;
}
 
@@ -570,7 +570,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, 
struct net_device *dev,
if (sme->key_idx > WMI_MAX_KEY_INDEX) {
ath6kl_err("key index %d out of bounds\n",
   sme->key_idx);
-   up(>sem);
+   mutex_unlock(>mutex);
return -ENOENT;
}
 
@@ -594,7 +594,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, 
struct net_device *dev,
if (ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx,
 ALL_BSS_FILTER, 0) != 0) {
ath6kl_err("couldn't set bss filtering\n");
-   up(>sem);
+   mutex_unlock(>mutex);
return -EIO;
}
}
@@ -626,7 +626,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, 
struct net_device *dev,
   0);
if (status) {
ath6kl_err("couldn't set listen intervel\n");
-   up(>sem);
+   mutex_unlock(>mutex);
return status;
}
}
@@ -651,7 +651,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, 
struct net_device *dev,
ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, 0, 0,
  sme->bg_scan_period, 0, 0, 0, 3, 0, 0, 0);
 
-   up(>sem);
+   mutex_unlock(>mutex);
 
if (status == -EINVAL) {
memset(vif->ssid, 0, sizeof(vif->ssid));
@@ -832,7 +832,7 @@ static int ath6kl_cfg80211_disconnect(struct wiphy *wiphy,
return -EBUSY;
}
 
-   if (down_interruptible(>sem)) {
+   if (mutex_lock_interruptible(>mutex)) {
ath6kl_err("busy, couldn't get access\n");
return -ERESTARTSYS;
}
@@ -845,7 +845,7 @@ static int ath6kl_cfg80211_disconnect(struct wiphy *wiphy,
if (!test_bit(SKIP_SCAN, >flag))
memset(vif->req_bssid, 0, sizeof(vif->req_bssid));
 
-