Skip to contentSkip to conversation

ath10k: checkpatch fixes 20130430 part 2

PATCH New Kalle Valo 1 participant 13 messages Apr 30, 2013 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore

Kalle Valo

author
#0 lore raw

cover ath10k: checkpatch fixes 20130430 part 2

More checkpatch fixes. This should be enough, I'm not planning to make anymore checkpatch related changes.

---

Kalle Valo (10):
ath10k: document spinlock usage
ath10k: fix rest of long lines in wmi.c
ath10k: fix a long line in ath10k_pci_start_ce()
ath10k: fix more long lines in mac.c
ath10k: mac: fix mac80211 iterator related long warnings
ath10k: fix a long line in ath10k_update_channel_list()
ath10k: No space is necessary after a cast
ath10k: Blank lines aren't necessary after/before a close brace
ath10k: braces should be used on all arms of this statement
ath10k: space prohibited before semicolon

 drivers/net/wireless/ath/ath10k/bmi.h   |    4 +-
 drivers/net/wireless/ath/ath10k/ce.c    |    5 +-
 drivers/net/wireless/ath/ath10k/ce.h    |    1 
 drivers/net/wireless/ath/ath10k/core.c  |    1 
 drivers/net/wireless/ath/ath10k/debug.c |    1 
 drivers/net/wireless/ath/ath10k/debug.h |    1 
 drivers/net/wireless/ath/ath10k/htc.c   |    5 +-
 drivers/net/wireless/ath/ath10k/htc.h   |    1 
 drivers/net/wireless/ath/ath10k/htt.c   |    1 
 drivers/net/wireless/ath/ath10k/htt.h   |    4 +-
 drivers/net/wireless/ath/ath10k/mac.c   |   75 +++++++++++++++++++++----------
 drivers/net/wireless/ath/ath10k/mac.h   |    2 -
 drivers/net/wireless/ath/ath10k/pci.c   |   32 ++++++-------
 drivers/net/wireless/ath/ath10k/pci.h   |   10 +++-
 drivers/net/wireless/ath/ath10k/wmi.c   |   41 ++++++++++-------
 drivers/net/wireless/ath/ath10k/wmi.h   |    2 -
 16 files changed, 110 insertions(+), 76 deletions(-)
author
#1 lore raw

PATCH 1/10 ath10k: document spinlock usage

Checkpatch warned that spinlocks are not documented.

---
 drivers/net/wireless/ath/ath10k/htc.h |    1 +
 drivers/net/wireless/ath/ath10k/htt.h |    3 +++
 drivers/net/wireless/ath/ath10k/pci.h |    6 ++++++
 3 files changed, 10 insertions(+)
drivers/net/wireless/ath/ath10k/htc.h +1 -0
index cf97bde..f2ba51d 100644
@@ -339,6 +339,7 @@ struct ath10k_htc {
 	struct ath10k *ar;
 	struct ath10k_htc_ep endpoint[ATH10K_HTC_EP_COUNT];
 
+	/* protects endpoint and stopping fields */
 	spinlock_t tx_lock;
 
 	struct ath10k_htc_ops htc_ops;
drivers/net/wireless/ath/ath10k/htt.h +3 -0
index be9dc72..77a3017 100644
@@ -1255,12 +1255,15 @@ struct ath10k_htt {
 		 */
 		struct timer_list refill_retry_timer;
 
+		/* FIXME: document what this protects */
 		spinlock_t lock;
 	} rx_ring;
 
 	unsigned int prefetch_len;
 
+	/* FIXME: document what this protects */
 	spinlock_t tx_lock;
+
 	struct sk_buff *pending_tx[HTT_MAX_NUM_PENDING_TX];
 	DECLARE_BITMAP(used_msdu_ids, HTT_MAX_NUM_PENDING_TX);
 	wait_queue_head_t empty_tx_wq;
drivers/net/wireless/ath/ath10k/pci.h +6 -0
index e22f764..e109a45 100644
@@ -171,6 +171,7 @@ struct hif_ce_pipe_info {
 
 	size_t buf_sz;
 
+	/* protects compl_free and num_send_allowed */
 	spinlock_t pipe_lock;
 
 	/* List of free CE completion slots */
@@ -211,7 +212,10 @@ struct ath10k_pci {
 
 	/* List of CE completions to be processed */
 	struct list_head compl_process;
+
+	/* protects compl_processing and compl_process */
 	spinlock_t compl_lock;
+
 	bool compl_processing;
 
 	struct hif_ce_pipe_info pipe_info[CE_COUNT_MAX];
@@ -224,11 +228,13 @@ struct ath10k_pci {
 	/* Copy Engine used for Diagnostic Accesses */
 	struct ce_state *ce_diag;
 
+	/* FIXME: document what this really protects */
 	spinlock_t ce_lock;
 
 	/* Map CE id to ce_state */
 	struct ce_state *ce_id_to_state[CE_COUNT_MAX];
 
+	/* makes sure that dummy reads are atomic */
 	spinlock_t hw_v1_workaround_lock;
 };
 
author
#2 lore raw

PATCH 1/10 ath10k: document spinlock usage

Quoted 3 lines · Kalle Valo

Checkpatch warned that spinlocks are not documented.

BTW, please send me feedback (or better yet patches) for the FIXME issues below. I didn't have time to go through all the locking in ath10k.

Quoted 35 lines
drivers/net/wireless/ath/ath10k/htt.h +3 -0
@@ -1255,12 +1255,15 @@ struct ath10k_htt {
 		 */
 		struct timer_list refill_retry_timer;
 
+		/* FIXME: document what this protects */
 		spinlock_t lock;
 	} rx_ring;
 
 	unsigned int prefetch_len;
 
+	/* FIXME: document what this protects */
 	spinlock_t tx_lock;
+
 	struct sk_buff *pending_tx[HTT_MAX_NUM_PENDING_TX];
 	DECLARE_BITMAP(used_msdu_ids, HTT_MAX_NUM_PENDING_TX);
 	wait_queue_head_t empty_tx_wq;
drivers/net/wireless/ath/ath10k/pci.h +2 -0
index e22f764..e109a45 100644
@@ -224,11 +228,13 @@ struct ath10k_pci {
 	/* Copy Engine used for Diagnostic Accesses */
 	struct ce_state *ce_diag;
 
+	/* FIXME: document what this really protects */
 	spinlock_t ce_lock;
 
 	/* Map CE id to ce_state */
 	struct ce_state *ce_id_to_state[CE_COUNT_MAX];
 
+	/* makes sure that dummy reads are atomic */
 	spinlock_t hw_v1_workaround_lock;
 };
Signature · 1 line
Kalle Valo
author
#3 lore raw

PATCH 2/10 ath10k: fix rest of long lines in wmi.c

In reply to Kalle Valo
---
 drivers/net/wireless/ath/ath10k/wmi.c |   26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)
drivers/net/wireless/ath/ath10k/wmi.c +15 -11
index 441fbcd..84bad13 100644
@@ -1257,6 +1257,7 @@ int ath10k_wmi_cmd_init(struct ath10k *ar)
 	struct wmi_init_cmd *cmd;
 	struct sk_buff *buf;
 	struct wmi_resource_config config = {};
+	u32 val;
 
 	config.num_vdevs = __cpu_to_le32(TARGET_NUM_VDEVS);
 	config.num_peers = __cpu_to_le32(TARGET_NUM_PEERS + TARGET_NUM_VDEVS);
@@ -1298,8 +1299,8 @@ int ath10k_wmi_cmd_init(struct ath10k *ar)
 	config.dma_burst_size = __cpu_to_le32(TARGET_DMA_BURST_SIZE);
 	config.mac_aggr_delim = __cpu_to_le32(TARGET_MAC_AGGR_DELIM);
 
-	config.rx_skip_defrag_timeout_dup_detection_check =
-		__cpu_to_le32(TARGET_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK);
+	val = TARGET_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK;
+	config.rx_skip_defrag_timeout_dup_detection_check = __cpu_to_le32(val);
 
 	config.vow_config = __cpu_to_le32(TARGET_VOW_CONFIG);
 
@@ -1634,14 +1635,17 @@ static int ath10k_wmi_vdev_start_restart(struct ath10k *ar,
 		memcpy(cmd->ssid.ssid, arg->ssid, arg->ssid_len);
 	}
 
-	cmd->chan.mhz               = __cpu_to_le32(arg->channel.freq);
-	cmd->chan.band_center_freq1 = __cpu_to_le32(arg->channel.band_center_freq1);
-	cmd->chan.mode              = arg->channel.mode;
-	cmd->chan.min_power         = arg->channel.min_power;
-	cmd->chan.max_power         = arg->channel.max_power;
-	cmd->chan.reg_power         = arg->channel.max_reg_power;
-	cmd->chan.reg_classid       = arg->channel.reg_class_id;
-	cmd->chan.antenna_max       = arg->channel.max_antenna_gain;
+	cmd->chan.mhz = __cpu_to_le32(arg->channel.freq);
+
+	cmd->chan.band_center_freq1 =
+		__cpu_to_le32(arg->channel.band_center_freq1);
+
+	cmd->chan.mode = arg->channel.mode;
+	cmd->chan.min_power = arg->channel.min_power;
+	cmd->chan.max_power = arg->channel.max_power;
+	cmd->chan.reg_power = arg->channel.max_reg_power;
+	cmd->chan.reg_classid = arg->channel.reg_class_id;
+	cmd->chan.antenna_max = arg->channel.max_antenna_gain;
 
 	ath10k_dbg(ATH10K_DBG_WMI,
 		   "wmi vdev %s id 0x%x freq %d, mode %d, ch_flags: 0x%0X,"
@@ -2032,7 +2036,7 @@ static void ath10k_wmi_pdev_set_wmm_param(struct wmi_wmm_params *params,
 }
 
 int ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,
-				   const struct wmi_pdev_set_wmm_params_arg *arg)
+			const struct wmi_pdev_set_wmm_params_arg *arg)
 {
 	struct wmi_pdev_set_wmm_params *cmd;
 	struct sk_buff *skb;
author
#4 lore raw

PATCH 3/10 ath10k: fix a long line in ath10k_pci_start_ce()

In reply to Kalle Valo
---
 drivers/net/wireless/ath/ath10k/pci.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +3 -2
index 266570d..a25a424 100644
@@ -763,7 +763,7 @@ static void ath10k_pci_start_ce(struct ath10k *ar)
 	const struct ce_attr *attr;
 	struct hif_ce_pipe_info *pipe_info;
 	struct ath10k_pci_compl *compl;
-	int i, pipe_num, completions;
+	int i, pipe_num, completions, disable_interrupts;
 
 	spin_lock_init(&ar_pci->compl_lock);
 	INIT_LIST_HEAD(&ar_pci->compl_process);
@@ -782,9 +782,10 @@ static void ath10k_pci_start_ce(struct ath10k *ar)
 		completions = 0;
 
 		if (attr->src_nentries) {
+			disable_interrupts = attr->flags & CE_ATTR_DIS_INTR;
 			ath10k_ce_send_cb_register(pipe_info->ce_hdl,
 						   ath10k_pci_ce_send_done,
-						   attr->flags & CE_ATTR_DIS_INTR);
+						   disable_interrupts);
 			completions += attr->src_nentries;
 			pipe_info->num_sends_allowed = attr->src_nentries - 1;
 		}
author
#5 lore raw

PATCH 4/10 ath10k: fix more long lines in mac.c

In reply to Kalle Valo
---
 drivers/net/wireless/ath/ath10k/mac.c |   42 +++++++++++++++++++++++----------
 1 file changed, 29 insertions(+), 13 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +29 -13
index a69d0dd..3adf9fe 100644
@@ -823,7 +823,10 @@ static void ath10k_peer_assoc_h_ht(struct ath10k *ar,
 	arg->peer_flags |= WMI_PEER_HT;
 	arg->peer_max_mpdu = (1 << (IEEE80211_HT_MAX_AMPDU_FACTOR +
 				    ht_cap->ampdu_factor)) - 1;
-	arg->peer_mpdu_density = ath10k_parse_mpdudensity(ht_cap->ampdu_density);
+
+	arg->peer_mpdu_density =
+		ath10k_parse_mpdudensity(ht_cap->ampdu_density);
+
 	arg->peer_ht_caps = ht_cap->cap;
 	arg->peer_rate_caps |= WMI_RC_HT_FLAG;
 
@@ -1114,9 +1117,14 @@ static void ath10k_update_channel_list(struct ath10k *ar)
 				continue;
 
 			ch->allow_ht   = true;
-			ch->allow_ibss = !(channel->flags & IEEE80211_CHAN_NO_IBSS);
-			ch->ht40plus = !(channel->flags & IEEE80211_CHAN_NO_HT40PLUS);
-			ch->passive = !!(channel->flags & IEEE80211_CHAN_PASSIVE_SCAN);
+
+			ch->allow_ibss =
+				!(channel->flags & IEEE80211_CHAN_NO_IBSS);
+
+			ch->ht40plus =
+				!(channel->flags & IEEE80211_CHAN_NO_HT40PLUS);
+			ch->passive =
+				!!(channel->flags & IEEE80211_CHAN_PASSIVE_SCAN);
 
 			ch->freq = channel->center_freq;
 			ch->min_power = channel->max_power * 3;
@@ -1609,7 +1617,9 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
 {
 	struct ath10k *ar = hw->priv;
 	struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+	enum wmi_sta_powersave_param param;
 	int ret = 0;
+	u32 value;
 	int bit;
 
 	mutex_lock(&ar->conf_mutex);
@@ -1684,21 +1694,24 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
 	}
 
 	if (arvif->vdev_type == WMI_VDEV_TYPE_STA) {
+		param = WMI_STA_PS_PARAM_RX_WAKE_POLICY;
+		value = WMI_STA_PS_RX_WAKE_POLICY_WAKE;
 		ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id,
-						  WMI_STA_PS_PARAM_RX_WAKE_POLICY,
-						  WMI_STA_PS_RX_WAKE_POLICY_WAKE);
+						  param, value);
 		if (ret)
 			ath10k_warn("Failed to set RX wake policy: %d\n", ret);
 
+		param = WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD;
+		value = WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS;
 		ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id,
-						  WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD,
-						  WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS);
+						  param, value);
 		if (ret)
 			ath10k_warn("Failed to set TX wake thresh: %d\n", ret);
 
+		param = WMI_STA_PS_PARAM_PSPOLL_COUNT;
+		value = WMI_STA_PS_PSPOLL_COUNT_NO_MAX;
 		ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id,
-						  WMI_STA_PS_PARAM_PSPOLL_COUNT,
-						  WMI_STA_PS_PSPOLL_COUNT_NO_MAX);
+						  param, value);
 		if (ret)
 			ath10k_warn("Failed to set PSPOLL count: %d\n", ret);
 	}
@@ -2346,14 +2359,17 @@ static void ath10k_set_frag_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
 	struct ath10k_generic_iter *ar_iter = data;
 	struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
 	u32 frag = ar_iter->ar->hw->wiphy->frag_threshold;
+	int ret;
 
 	frag = clamp_t(u32, frag,
 		       ATH10K_FRAGMT_THRESHOLD_MIN,
 		       ATH10K_FRAGMT_THRESHOLD_MAX);
 
-	ar_iter->ret = ath10k_wmi_vdev_set_param(ar_iter->ar, arvif->vdev_id,
-						 WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
-						 frag);
+	ret = ath10k_wmi_vdev_set_param(ar_iter->ar, arvif->vdev_id,
+					WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
+					frag);
+
+	ar_iter->ret = ret;
 	if (ar_iter->ret)
 		ath10k_warn("Failed to set frag threshold for VDEV: %d\n",
 			    arvif->vdev_id);
author
#6 lore raw

PATCH 5/10 ath10k: mac: fix mac80211 iterator related long warnings

In reply to Kalle Valo

I'm not exacly fond of how I shorten the lines, but it just makes my life so much easier to not have checkpatch spamming about these.

---
 drivers/net/wireless/ath/ath10k/mac.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +10 -5
index 3adf9fe..ef76c21 100644
@@ -661,8 +661,7 @@ static void ath10k_control_ibss(struct ath10k_vif *arvif,
 /*
  * Review this when mac80211 gains per-interface powersave support.
  */
-static void ath10k_config_ps_iter(void *data, u8 *mac,
-				  struct ieee80211_vif *vif)
+static void ath10k_ps_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
 {
 	struct ath10k_generic_iter *ar_iter = data;
 	struct ieee80211_conf *conf = &ar_iter->ar->hw->conf;
@@ -1575,6 +1574,7 @@ static int ath10k_config(struct ieee80211_hw *hw, u32 changed)
 	struct ath10k *ar = hw->priv;
 	struct ieee80211_conf *conf = &hw->conf;
 	int ret = 0;
+	u32 flags;
 
 	mutex_lock(&ar->conf_mutex);
 
@@ -1587,10 +1587,13 @@ static int ath10k_config(struct ieee80211_hw *hw, u32 changed)
 	if (changed & IEEE80211_CONF_CHANGE_PS) {
 		memset(&ar_iter, 0, sizeof(struct ath10k_generic_iter));
 		ar_iter.ar = ar;
+		flags = IEEE80211_IFACE_ITER_RESUME_ALL;
+
 		ieee80211_iterate_active_interfaces_atomic(hw,
-							   IEEE80211_IFACE_ITER_RESUME_ALL,
-							   ath10k_config_ps_iter,
+							   flags,
+							   ath10k_ps_iter,
 							   &ar_iter);
+
 		ret = ar_iter.ret;
 	}
 
@@ -2662,12 +2665,14 @@ static void ath10k_get_arvif_iter(void *data, u8 *mac,
 struct ath10k_vif *ath10k_get_arvif(struct ath10k *ar, u32 vdev_id)
 {
 	struct ath10k_vif_iter arvif_iter;
+	u32 flags;
 
 	memset(&arvif_iter, 0, sizeof(struct ath10k_vif_iter));
 	arvif_iter.vdev_id = vdev_id;
 
+	flags = IEEE80211_IFACE_ITER_RESUME_ALL;
 	ieee80211_iterate_active_interfaces_atomic(ar->hw,
-						   IEEE80211_IFACE_ITER_RESUME_ALL,
+						   flags,
 						   ath10k_get_arvif_iter,
 						   &arvif_iter);
 	if (!arvif_iter.arvif) {
author
#7 lore raw

PATCH 6/10 ath10k: fix a long line in ath10k_update_channel_list()

In reply to Kalle Valo

Workaround a long line by adding a temporary variable. Also remove the !! as it's unnecessary when assigning to a boolean.

---
 drivers/net/wireless/ath/ath10k/mac.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +4 -2
index ef76c21..b9c50fb 100644
@@ -1080,6 +1080,7 @@ static void ath10k_update_channel_list(struct ath10k *ar)
 	struct ieee80211_channel *channel;
 	struct wmi_scan_chan_list_arg arg = {0};
 	struct wmi_channel_arg *ch;
+	bool passive;
 	int len;
 	int i;
 
@@ -1122,8 +1123,9 @@ static void ath10k_update_channel_list(struct ath10k *ar)
 
 			ch->ht40plus =
 				!(channel->flags & IEEE80211_CHAN_NO_HT40PLUS);
-			ch->passive =
-				!!(channel->flags & IEEE80211_CHAN_PASSIVE_SCAN);
+
+			passive = channel->flags & IEEE80211_CHAN_PASSIVE_SCAN;
+			ch->passive = passive;
 
 			ch->freq = channel->center_freq;
 			ch->min_power = channel->max_power * 3;
author
#8 lore raw

PATCH 7/10 ath10k: No space is necessary after a cast

In reply to Kalle Valo

A checkpatch warning.

---
 drivers/net/wireless/ath/ath10k/bmi.h |    4 ++--
 drivers/net/wireless/ath/ath10k/mac.c |    2 +-
 drivers/net/wireless/ath/ath10k/mac.h |    2 +-
 drivers/net/wireless/ath/ath10k/pci.c |   16 ++++++++--------
 drivers/net/wireless/ath/ath10k/wmi.c |   12 ++++++------
 5 files changed, 18 insertions(+), 18 deletions(-)
drivers/net/wireless/ath/ath10k/bmi.h +2 -2
index 470b3c4..32c56aa 100644
@@ -199,7 +199,7 @@ int ath10k_bmi_write_memory(struct ath10k *ar, u32 address,
 		__le32 tmp;						\
 									\
 		addr = host_interest_item_address(HI_ITEM(item));	\
-		ret = ath10k_bmi_read_memory(ar, addr, (u8 *) &tmp, 4); \
+		ret = ath10k_bmi_read_memory(ar, addr, (u8 *)&tmp, 4); \
 		*val = __le32_to_cpu(tmp);				\
 		ret;							\
 	 })
@@ -212,7 +212,7 @@ int ath10k_bmi_write_memory(struct ath10k *ar, u32 address,
 									\
 		address = host_interest_item_address(HI_ITEM(item));	\
 		ret = ath10k_bmi_write_memory(ar, address,		\
-					      (u8 *) &v, sizeof(v));	\
+					      (u8 *)&v, sizeof(v));	\
 		ret;							\
 	})
 
drivers/net/wireless/ath/ath10k/mac.c +1 -1
index b9c50fb..f21189d 100644
@@ -1260,7 +1260,7 @@ static void ath10k_tx_h_update_wep_key(struct sk_buff *skb)
 
 static void ath10k_tx_h_add_p2p_noa_ie(struct ath10k *ar, struct sk_buff *skb)
 {
-	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 	struct ieee80211_vif *vif = info->control.vif;
 	struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
drivers/net/wireless/ath/ath10k/mac.h +1 -1
index 58eed18..27fc92e 100644
@@ -43,7 +43,7 @@ static inline struct ath10k_vif *ath10k_vif_to_arvif(struct ieee80211_vif *vif)
 static inline void ath10k_tx_h_seq_no(struct sk_buff *skb)
 {
 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
-	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
 	struct ieee80211_vif *vif = info->control.vif;
 	struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
 
drivers/net/wireless/ath/ath10k/pci.c +8 -8
index a25a424..56f41da 100644
@@ -143,9 +143,9 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
 	 *   2) Buffer in DMA-able space
 	 */
 	orig_nbytes = nbytes;
-	data_buf = (unsigned char *) pci_alloc_consistent(ar_pci->pdev,
-							  orig_nbytes,
-							  &ce_data_base);
+	data_buf = (unsigned char *)pci_alloc_consistent(ar_pci->pdev,
+							 orig_nbytes,
+							 &ce_data_base);
 
 	if (!data_buf) {
 		ret = -ENOMEM;
@@ -287,9 +287,9 @@ static int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
 	 *   2) Buffer in DMA-able space
 	 */
 	orig_nbytes = nbytes;
-	data_buf = (unsigned char *) pci_alloc_consistent(ar_pci->pdev,
-							  orig_nbytes,
-							  &ce_data_base);
+	data_buf = (unsigned char *)pci_alloc_consistent(ar_pci->pdev,
+							 orig_nbytes,
+							 &ce_data_base);
 	if (!data_buf) {
 		ret = -ENOMEM;
 		goto done;
@@ -1717,7 +1717,7 @@ static void ath10k_pci_ce_tasklet(unsigned long ptr)
 
 static void ath10k_msi_err_tasklet(unsigned long data)
 {
-	struct ath10k *ar = (struct ath10k *) data;
+	struct ath10k *ar = (struct ath10k *)data;
 
 	ath10k_pci_fw_interrupt_handler(ar);
 }
@@ -1798,7 +1798,7 @@ static irqreturn_t ath10k_pci_interrupt_handler(int irq, void *arg)
 
 static void ath10k_pci_tasklet(unsigned long data)
 {
-	struct ath10k *ar = (struct ath10k *) data;
+	struct ath10k *ar = (struct ath10k *)data;
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
 
 	ath10k_pci_fw_interrupt_handler(ar); /* FIXME: Handle FW error */
drivers/net/wireless/ath/ath10k/wmi.c +6 -6
index 84bad13..195a2e4 100644
@@ -568,8 +568,8 @@ static void ath10k_p2p_fill_noa_ie(u8 *data, u32 len,
 
 	/* NOA ATTR */
 	data[6] = IEEE80211_P2P_ATTR_ABSENCE_NOTICE;
-	noa_attr_len = (__le16 *) &data[7]; /* 2 bytes */
-	noa_attr = (struct ieee80211_p2p_noa_attr *) &data[9];
+	noa_attr_len = (__le16 *)&data[7]; /* 2 bytes */
+	noa_attr = (struct ieee80211_p2p_noa_attr *)&data[9];
 
 	noa_attr->index = noa->index;
 	noa_attr->oppps_ctwindow = ctwindow;
@@ -1621,7 +1621,7 @@ static int ath10k_wmi_vdev_start_restart(struct ath10k *ar,
 	if (arg->pmf_enabled)
 		flags |= WMI_VDEV_START_PMF_ENABLED;
 
-	cmd = (struct wmi_vdev_start_request_cmd *) skb->data;
+	cmd = (struct wmi_vdev_start_request_cmd *)skb->data;
 	cmd->vdev_id         = __cpu_to_le32(arg->vdev_id);
 	cmd->disable_hw_ack  = __cpu_to_le32(arg->disable_hw_ack);
 	cmd->beacon_interval = __cpu_to_le32(arg->bcn_intval);
@@ -1851,7 +1851,7 @@ int ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id,
 	if (!skb)
 		return -ENOMEM;
 
-	cmd = (struct wmi_peer_set_param_cmd *) skb->data;
+	cmd = (struct wmi_peer_set_param_cmd *)skb->data;
 	cmd->vdev_id     = __cpu_to_le32(vdev_id);
 	cmd->param_id    = __cpu_to_le32(param_id);
 	cmd->param_value = __cpu_to_le32(param_value);
@@ -1874,7 +1874,7 @@ int ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id,
 	if (!skb)
 		return -ENOMEM;
 
-	cmd = (struct wmi_sta_powersave_mode_cmd *) skb->data;
+	cmd = (struct wmi_sta_powersave_mode_cmd *)skb->data;
 	cmd->vdev_id     = __cpu_to_le32(vdev_id);
 	cmd->sta_ps_mode = __cpu_to_le32(psmode);
 
@@ -1896,7 +1896,7 @@ int ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id,
 	if (!skb)
 		return -ENOMEM;
 
-	cmd = (struct wmi_sta_powersave_param_cmd *) skb->data;
+	cmd = (struct wmi_sta_powersave_param_cmd *)skb->data;
 	cmd->vdev_id     = __cpu_to_le32(vdev_id);
 	cmd->param_id    = __cpu_to_le32(param_id);
 	cmd->param_value = __cpu_to_le32(value);
author
#9 lore raw

PATCH 8/10 ath10k: Blank lines aren't necessary after/before a close brace

In reply to Kalle Valo

A checkpatch warning.

---
 drivers/net/wireless/ath/ath10k/ce.c    |    2 --
 drivers/net/wireless/ath/ath10k/ce.h    |    1 -
 drivers/net/wireless/ath/ath10k/core.c  |    1 -
 drivers/net/wireless/ath/ath10k/debug.c |    1 -
 drivers/net/wireless/ath/ath10k/debug.h |    1 -
 drivers/net/wireless/ath/ath10k/htc.c   |    2 --
 drivers/net/wireless/ath/ath10k/htt.c   |    1 -
 drivers/net/wireless/ath/ath10k/htt.h   |    1 -
 drivers/net/wireless/ath/ath10k/pci.c   |    3 ---
 drivers/net/wireless/ath/ath10k/pci.h   |    1 -
 10 files changed, 14 deletions(-)
drivers/net/wireless/ath/ath10k/ce.c +0 -2
index b9c1f21..0de509a 100644
@@ -106,7 +106,6 @@ static inline void ath10k_ce_src_ring_write_index_set(struct ath10k *ar,
 		iowrite32(0, indicator_addr);
 		local_irq_restore(irq_flags);
 	}
-
 }
 
 static inline u32 ath10k_ce_src_ring_write_index_get(struct ath10k *ar,
@@ -151,7 +150,6 @@ static inline void ath10k_ce_src_ring_byte_swap_set(struct ath10k *ar,
 						    u32 ce_ctrl_addr,
 						    unsigned int n)
 {
-
 	u32 ctrl1_addr = ath10k_pci_read32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS);
 
 	ath10k_pci_write32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS,
drivers/net/wireless/ath/ath10k/ce.h +0 -1
index a6c97ac..c17f07c 100644
@@ -59,7 +59,6 @@ struct ce_desc {
 
 /* Copy Engine Ring internal state */
 struct ce_ring_state {
-
 	/* Number of entries in this ring; must be power of 2 */
 	unsigned int nentries;
 	unsigned int nentries_mask;
drivers/net/wireless/ath/ath10k/core.c +0 -1
index 4f6967e..13ffe78 100644
@@ -648,7 +648,6 @@ EXPORT_SYMBOL(ath10k_core_target_suspend);
 
 int ath10k_core_target_resume(struct ath10k *ar)
 {
-
 	int ret;
 
 	ath10k_dbg(ATH10K_DBG_CORE, "%s: called", __func__);
drivers/net/wireless/ath/ath10k/debug.c +0 -1
index 6cfcb95..700b44d 100644
@@ -125,7 +125,6 @@ static ssize_t ath10k_read_wmi_services(struct file *file,
 	len += scnprintf(buf + len, buf_len - len, "%30s\n\n",
 				 "=================");
 	for (i = 0; i < WMI_SERVICE_LAST; i++) {
-
 		if (WMI_SERVICE_IS_ENABLED(ar->debug.wmi_service_bitmap, i))
 			status = "enabled";
 		else
drivers/net/wireless/ath/ath10k/debug.h +0 -1
index aeca3af..380678f 100644
@@ -159,7 +159,6 @@ static inline void ath10k_debug_read_target_stats(struct ath10k *ar,
 
 	mutex_unlock(&ar->conf_mutex);
 	complete(&ar->debug.event_stats_compl);
-
 }
 
 #else
drivers/net/wireless/ath/ath10k/htc.c +0 -2
index 518e061..d4c1136 100644
@@ -588,7 +588,6 @@ static int ath10k_htc_rx_completion_handler(struct ath10k *ar,
 			break;
 		case ATH10K_HTC_MSG_SEND_SUSPEND_COMPLETE:
 			htc->htc_ops.target_send_suspend_complete(ar);
-
 		}
 		goto out;
 	}
@@ -662,7 +661,6 @@ static void ath10k_htc_reset_endpoint_states(struct ath10k_htc *htc)
 		ep->htc = htc;
 		ep->tx_credit_flow_enabled = true;
 		INIT_WORK(&ep->send_work, ath10k_htc_send_work);
-
 	}
 }
 
drivers/net/wireless/ath/ath10k/htt.c +0 -1
index f9601d3..4131cc6 100644
@@ -155,7 +155,6 @@ int ath10k_htt_attach_target(struct ath10k_htt *htt)
 		return status;
 
 	return ath10k_htt_send_rx_ring_cfg_ll(htt);
-
 }
 
 void ath10k_htt_detach(struct ath10k_htt *htt)
drivers/net/wireless/ath/ath10k/htt.h +0 -1
index 77a3017..63beff5 100644
@@ -778,7 +778,6 @@ struct htt_dbg_stats_rx_reorder_stats {
 };
 
 struct htt_dbg_stats_wal_tx_stats {
-
 	/* Num HTT cookies queued to dispatch list */
 	__le32 comp_queued;
 
drivers/net/wireless/ath/ath10k/pci.c +0 -3
index 56f41da..63516c3 100644
@@ -718,7 +718,6 @@ static void ath10k_pci_hif_dump_area(struct ath10k *ar)
 	ath10k_err("target Register Dump\n");
 	for (i = 0; i < REG_DUMP_COUNT_QCA988X; i++)
 		ath10k_err("[%02d]: 0x%08X\n", i, reg_dump_values[i]);
-
 }
 
 static void ath10k_pci_hif_send_complete_check(struct ath10k *ar, u8 pipe,
@@ -1201,7 +1200,6 @@ static void ath10k_pci_buffer_cleanup(struct ath10k *ar)
 
 static void ath10k_pci_ce_deinit(struct ath10k *ar)
 {
-
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
 	struct hif_ce_pipe_info *pipe_info;
 	int pipe_num;
@@ -1995,7 +1993,6 @@ static int ath10k_pci_reset_target(struct ath10k *ar)
 	while (wait_limit-- &&
 	       !(ioread32(ar_pci->mem + FW_INDICATOR_ADDRESS) &
 		 FW_IND_INITIALIZED)) {
-
 		if (ar_pci->num_msi_intrs == 0)
 			/* Fix potential race by repeating CORE_BASE writes */
 			iowrite32(PCIE_INTR_FIRMWARE_MASK |
drivers/net/wireless/ath/ath10k/pci.h +0 -1
index e109a45..41b4f6f 100644
@@ -308,7 +308,6 @@ static inline void ath10k_pci_reg_write32(void __iomem *mem, u32 addr, u32 val)
 static inline void ath10k_pci_write32(struct ath10k *ar, u32 offset,
 				      u32 value)
 {
-
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
 	void __iomem *addr = ar_pci->mem;
 
author
#10 lore raw

PATCH 9/10 ath10k: braces should be used on all arms of this statement

In reply to Kalle Valo

A checkpatch warning.

---
 drivers/net/wireless/ath/ath10k/ce.c  |    3 ++-
 drivers/net/wireless/ath/ath10k/htc.c |    3 ++-
 drivers/net/wireless/ath/ath10k/mac.c |   14 ++++++++++----
 drivers/net/wireless/ath/ath10k/pci.c |    8 ++++----
 drivers/net/wireless/ath/ath10k/pci.h |    3 ++-
 drivers/net/wireless/ath/ath10k/wmi.c |    3 ++-
 6 files changed, 22 insertions(+), 12 deletions(-)
drivers/net/wireless/ath/ath10k/ce.c +2 -1
index 0de509a..3ef7f39 100644
@@ -717,8 +717,9 @@ int ath10k_ce_cancel_send_next(struct ce_state *ce_state,
 		sw_index = CE_RING_IDX_INCR(nentries_mask, sw_index);
 		src_ring->sw_index = sw_index;
 		ret = 0;
-	} else
+	} else {
 		ret = -EIO;
+	}
 
 	spin_unlock_bh(&ar_pci->ce_lock);
 
drivers/net/wireless/ath/ath10k/htc.c +2 -1
index d4c1136..60f471c 100644
@@ -60,8 +60,9 @@ static inline void ath10k_htc_recalc_queue(struct ath10k_htc_ep *ep, int delta)
 	if (ep->tx_queue_stopped) {
 		if (ep->tx_queue_len <= ep->max_tx_queue_depth/2)
 			ath10k_htc_wake_queue(ep);
-	} else if (ep->tx_queue_len >= ep->max_tx_queue_depth)
+	} else if (ep->tx_queue_len >= ep->max_tx_queue_depth) {
 		ath10k_htc_stop_queue(ep);
+	}
 }
 
 static inline void ath10k_htc_send_complete_check(struct ath10k_htc_ep *ep,
drivers/net/wireless/ath/ath10k/mac.c +10 -4
index f21189d..b419f8d 100644
@@ -688,8 +688,9 @@ static void ath10k_ps_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
 		}
 
 		ar_iter->ret = ret;
-	} else
+	} else {
 		psmode = WMI_STA_PS_MODE_DISABLED;
+	}
 
 	ar_iter->ret = ath10k_wmi_set_psmode(ar_iter->ar, arvif->vdev_id,
 					     psmode);
@@ -917,8 +918,10 @@ static void ath10k_peer_assoc_h_phymode(struct ath10k *ar,
 				phymode = MODE_11NG_HT40;
 			else
 				phymode = MODE_11NG_HT20;
-		} else
+		} else {
 			phymode = MODE_11G;
+		}
+
 		break;
 	case IEEE80211_BAND_5GHZ:
 		if (sta->ht_cap.ht_supported) {
@@ -926,8 +929,10 @@ static void ath10k_peer_assoc_h_phymode(struct ath10k *ar,
 				phymode = MODE_11NA_HT40;
 			else
 				phymode = MODE_11NA_HT20;
-		} else
+		} else {
 			phymode = MODE_11A;
+		}
+
 		break;
 	default:
 		break;
@@ -1499,8 +1504,9 @@ static void ath10k_tx(struct ieee80211_hw *hw,
 	if (info->control.vif) {
 		arvif = ath10k_vif_to_arvif(info->control.vif);
 		vdev_id = arvif->vdev_id;
-	} else if (ar->monitor_enabled)
+	} else if (ar->monitor_enabled) {
 		vdev_id = ar->monitor_vdev_id;
+	}
 
 	/* We should disable CCK RATE due to P2P */
 	if (info->flags & IEEE80211_TX_CTL_NO_CCK_RATE)
drivers/net/wireless/ath/ath10k/pci.c +4 -4
index 63516c3..e85d806 100644
@@ -1679,9 +1679,9 @@ static void ath10k_pci_fw_interrupt_handler(struct ath10k *ar)
 		ath10k_pci_write32(ar, fw_indicator_address,
 				   fw_indicator & ~FW_IND_EVENT_PENDING);
 
-		if (ar_pci->started)
+		if (ar_pci->started) {
 			ath10k_pci_hif_dump_area(ar);
-		else {
+		} else {
 			/*
 			 * Probable Target failure before we're prepared
 			 * to handle it.  Generally unexpected.
@@ -2222,9 +2222,9 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
 	if (ret)
 		goto err_intr;
 
-	if (ath10k_target_ps)
+	if (ath10k_target_ps) {
 		ath10k_dbg(ATH10K_DBG_PCI, "on-chip power save enabled\n");
-	else {
+	} else {
 		/* Force AWAKE forever */
 		ath10k_dbg(ATH10K_DBG_PCI, "on-chip power save disabled\n");
 		ath10k_do_pci_wake(ar);
drivers/net/wireless/ath/ath10k/pci.h +2 -1
index 41b4f6f..d2a055a 100644
@@ -323,8 +323,9 @@ static inline void ath10k_pci_write32(struct ath10k *ar, u32 offset,
 
 		spin_unlock_irqrestore(&ar_pci->hw_v1_workaround_lock,
 				       irq_flags);
-	} else
+	} else {
 		iowrite32(value, addr+offset);
+	}
 }
 
 static inline u32 ath10k_pci_read32(struct ath10k *ar, u32 offset)
drivers/net/wireless/ath/ath10k/wmi.c +2 -1
index 195a2e4..3b819c8 100644
@@ -529,8 +529,9 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,
 			ie[1] += expand_size;
 			ie_len += expand_size;
 			pvm_len += expand_size;
-		} else
+		} else {
 			ath10k_warn("tim expansion failed\n");
+		}
 	}
 
 	if (pvm_len > sizeof(arvif->u.ap.tim_bitmap)) {
author
#11 lore raw

PATCH 10/10 ath10k: space prohibited before semicolon

In reply to Kalle Valo

A warning from checkpatch.

---
 drivers/net/wireless/ath/ath10k/wmi.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/wmi.h +1 -1
index d286f3e..2ad0431 100644
@@ -1883,7 +1883,7 @@ enum wmi_vdev_subtype {
 
 struct wmi_p2p_noa_descriptor {
 	__le32 type_count; /* 255: continuous schedule, 0: reserved */
-	__le32 duration ;  /* Absent period duration in micro seconds */
+	__le32 duration;  /* Absent period duration in micro seconds */
 	__le32 interval;   /* Absent period interval in micro seconds */
 	__le32 start_time; /* 32 bit tsf time when in starts */
 } __packed;
author Applied
#12 lore raw

cover ath10k: checkpatch fixes 20130430 part 2

In reply to Kalle Valo
Quoted 5 lines · Kalle Valo

More checkpatch fixes. This should be enough, I'm not planning to make anymore checkpatch related changes.

---

Quoted 11 lines

Kalle Valo (10):
ath10k: document spinlock usage
ath10k: fix rest of long lines in wmi.c
ath10k: fix a long line in ath10k_pci_start_ce()
ath10k: fix more long lines in mac.c
ath10k: mac: fix mac80211 iterator related long warnings
ath10k: fix a long line in ath10k_update_channel_list()
ath10k: No space is necessary after a cast
ath10k: Blank lines aren't necessary after/before a close brace
ath10k: braces should be used on all arms of this statement
ath10k: space prohibited before semicolon

Applied.

Signature · 1 line
Kalle Valo