summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/wcn36xx/debug.c
diff options
context:
space:
mode:
authorPontus Fuchs <pontus.fuchs@gmail.com>2016-04-18 22:00:41 -0700
committerKalle Valo <kvalo@qca.qualcomm.com>2016-04-25 20:37:04 +0300
commitce75877f6c3da01cd5efe41683dd32beee1b4b33 (patch)
tree8bbd0337722edaec0a32805998ae4aeb6937e56a /drivers/net/wireless/ath/wcn36xx/debug.c
parent91c3eeba45e13ab7edfb50610df8672d52809394 (diff)
downloadlinux-ce75877f6c3da01cd5efe41683dd32beee1b4b33.tar.gz
linux-ce75877f6c3da01cd5efe41683dd32beee1b4b33.tar.xz
wcn36xx: Add helper macros to cast vif to private vif and vice versa
Makes the code a little easier to read. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/wcn36xx/debug.c')
-rw-r--r--drivers/net/wireless/ath/wcn36xx/debug.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/wcn36xx/debug.c b/drivers/net/wireless/ath/wcn36xx/debug.c
index ef44a2da644d..2a6bb62e785c 100644
--- a/drivers/net/wireless/ath/wcn36xx/debug.c
+++ b/drivers/net/wireless/ath/wcn36xx/debug.c
@@ -33,9 +33,7 @@ static ssize_t read_file_bool_bmps(struct file *file, char __user *user_buf,
char buf[3];
list_for_each_entry(vif_priv, &wcn->vif_list, list) {
- vif = container_of((void *)vif_priv,
- struct ieee80211_vif,
- drv_priv);
+ vif = wcn36xx_priv_to_vif(vif_priv);
if (NL80211_IFTYPE_STATION == vif->type) {
if (vif_priv->pw_state == WCN36XX_BMPS)
buf[0] = '1';
@@ -70,9 +68,7 @@ static ssize_t write_file_bool_bmps(struct file *file,
case 'Y':
case '1':
list_for_each_entry(vif_priv, &wcn->vif_list, list) {
- vif = container_of((void *)vif_priv,
- struct ieee80211_vif,
- drv_priv);
+ vif = wcn36xx_priv_to_vif(vif_priv);
if (NL80211_IFTYPE_STATION == vif->type) {
wcn36xx_enable_keep_alive_null_packet(wcn, vif);
wcn36xx_pmc_enter_bmps_state(wcn, vif);
@@ -83,9 +79,7 @@ static ssize_t write_file_bool_bmps(struct file *file,
case 'N':
case '0':
list_for_each_entry(vif_priv, &wcn->vif_list, list) {
- vif = container_of((void *)vif_priv,
- struct ieee80211_vif,
- drv_priv);
+ vif = wcn36xx_priv_to_vif(vif_priv);
if (NL80211_IFTYPE_STATION == vif->type)
wcn36xx_pmc_exit_bmps_state(wcn, vif);
}