Skip to contentSkip to conversation

ath10k: checkpatch fixes 20130430

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

lore
Share & tools
lore

Kalle Valo

author
#0 lore raw

cover ath10k: checkpatch fixes 20130430

And here I'm breaking my own rule, sending over a double of the max 12 patches limit! :)

But I have a good excuse. I noticed that checkpatch warnings were rising again, even though I have been trying to tackle them. Now I was able to reduce them to 25 warnings and it's now easier for me to follow them. That's why I want to apply these ASAP.

Please review.

---

Kalle Valo (27):
ath10k: fix new warning in ath10k_push_board_ext_data()
ath10k: fix long line in ath10k_htt_htc_attach()
ath10k: fix long line in ath10k_read_wmi_services()
ath10k: simple long line fixes
ath10k: fix long lines related htd credit reporting
ath10k: fix long lines in htc.c
ath10k: get rid of unnecessary else branch
ath10k: fix long lines in htt_rx.c
ath10k: fix comment style in htt.h
ath10k: fix long lines in ce.c
ath10k: rename WMI_CMD_GRP_START_ID()
ath10k: rename struct wmi_p2p_noa_info::noa_descriptors
ath10k: shorten ath10k_wmi_pdev_set_wmm_params() declaration
ath10k: fix few long lines in wmi.c
ath10k: change config initialisation in ath10k_wmi_cmd_init()
ath10k: rename hif_ce_completion_state to ath10k_pci_compl
ath10k: fix a long line in ath10k_pci_hif_dump_area()
ath10k: pci: rename pipe cleanup functions
ath10k: pci: rename receive post buffer functions
ath10k: rename msg_callbacks variable in ath10k_pci_process_ce()
ath10k: rename struct ath10k_hif_cb field names
ath10k: simplify arg variable initialisation in ath10k_vdev_start()
ath10k: simplify arg variable initialisation in ath10k_monitor_start()
ath10k: fix long lines in ath10k_config_ps_iter()
ath10k: use min_t() instead of min()
ath10k: whitespace fixes found by checkpatch
ath10k: remove multiple assignments

 drivers/net/wireless/ath/ath10k/bmi.c    |    2 
 drivers/net/wireless/ath/ath10k/ce.c     |   43 ++++----
 drivers/net/wireless/ath/ath10k/ce.h     |    3 -
 drivers/net/wireless/ath/ath10k/core.c   |   11 +-
 drivers/net/wireless/ath/ath10k/debug.c  |   10 +-
 drivers/net/wireless/ath/ath10k/hif.h    |   12 +-
 drivers/net/wireless/ath/ath10k/htc.c    |  169 ++++++++++++++++--------------
 drivers/net/wireless/ath/ath10k/htt.c    |    3 -
 drivers/net/wireless/ath/ath10k/htt.h    |  166 ++++++++++++++++++++++-------
 drivers/net/wireless/ath/ath10k/htt_rx.c |   53 ++++++---
 drivers/net/wireless/ath/ath10k/htt_tx.c |    2 
 drivers/net/wireless/ath/ath10k/mac.c    |   85 +++++++++------
 drivers/net/wireless/ath/ath10k/pci.c    |   80 +++++++-------
 drivers/net/wireless/ath/ath10k/pci.h    |    5 +
 drivers/net/wireless/ath/ath10k/wmi.c    |  111 ++++++++++++--------
 drivers/net/wireless/ath/ath10k/wmi.h    |   60 +++++------
 16 files changed, 492 insertions(+), 323 deletions(-)
author
#1 lore raw

PATCH 1/27 ath10k: fix new warning in ath10k_push_board_ext_data()

drivers/net/wireless/ath/ath10k/core.c: In function 'ath10k_push_board_ext_data':
drivers/net/wireless/ath/ath10k/core.c:225:7: warning: format '%lu' expects
argument of type 'long unsigned int', but argument 2 has type 'size_t' [-Wformat]

---
 drivers/net/wireless/ath/ath10k/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/core.c +1 -1
index a5b9eb6..88890a4 100644
@@ -221,7 +221,7 @@ static int ath10k_push_board_ext_data(struct ath10k *ar,
 		return 0;
 
 	if (fw->size != (board_data_size + board_ext_data_size)) {
-		ath10k_err("invalid board (ext) data sizes %lu != %d+%d\n",
+		ath10k_err("invalid board (ext) data sizes %zu != %d+%d\n",
 			   fw->size, board_data_size, board_ext_data_size);
 		return -EINVAL;
 	}
author
#2 lore raw

PATCH 2/27 ath10k: fix long line in ath10k_htt_htc_attach()

In reply to Kalle Valo
---
 drivers/net/wireless/ath/ath10k/htt.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/htt.c +2 -1
index 8116e6c..f9601d3 100644
@@ -54,7 +54,8 @@ static int ath10k_htt_htc_attach(struct ath10k_htt *htt)
 	/* connect to control service */
 	conn_req.service_id = ATH10K_HTC_SVC_ID_HTT_DATA_MSG;
 
-	status = ath10k_htc_connect_service(htt->ar->htc, &conn_req, &conn_resp);
+	status = ath10k_htc_connect_service(htt->ar->htc, &conn_req,
+					    &conn_resp);
 
 	if (status)
 		return status;
author
#3 lore raw

PATCH 3/27 ath10k: fix long line in ath10k_read_wmi_services()

In reply to Kalle Valo
---
 drivers/net/wireless/ath/ath10k/debug.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/debug.c +7 -3
index 3357917..6cfcb95 100644
@@ -106,6 +106,7 @@ static ssize_t ath10k_read_wmi_services(struct file *file,
 	struct ath10k *ar = file->private_data;
 	char *buf;
 	unsigned int len = 0, buf_len = 1500;
+	const char *status;
 	ssize_t ret_cnt;
 	int i;
 
@@ -125,11 +126,14 @@ static ssize_t ath10k_read_wmi_services(struct file *file,
 				 "=================");
 	for (i = 0; i < WMI_SERVICE_LAST; i++) {
 
+		if (WMI_SERVICE_IS_ENABLED(ar->debug.wmi_service_bitmap, i))
+			status = "enabled";
+		else
+			status = "disabled";
+
 		len += scnprintf(buf + len, buf_len - len,
 				 " - 0x%02x - %20s - %s\n",
-				 i, wmi_service_name(i),
-				 WMI_SERVICE_IS_ENABLED(ar->debug.wmi_service_bitmap, i) ?
-				 "enabled" : "disabled");
+				 i, wmi_service_name(i), status);
 	}
 
 	ret_cnt = simple_read_from_buffer(user_buf, count, ppos, buf, len);
author
#4 lore raw

PATCH 4/27 ath10k: simple long line fixes

In reply to Kalle Valo
---
 drivers/net/wireless/ath/ath10k/core.c   |    9 ++++++---
 drivers/net/wireless/ath/ath10k/htc.c    |   12 ++++++++----
 drivers/net/wireless/ath/ath10k/htt_rx.c |    3 ++-
 drivers/net/wireless/ath/ath10k/pci.c    |    3 ++-
 drivers/net/wireless/ath/ath10k/pci.h    |    3 ++-
 5 files changed, 20 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath10k/core.c +6 -3
index 88890a4..4f6967e 100644
@@ -254,7 +254,8 @@ static int ath10k_download_board_data(struct ath10k *ar)
 	fw = ath10k_fetch_fw_file(ar, ar->hw_params.fw.dir,
 				  ar->hw_params.fw.board);
 	if (IS_ERR(fw)) {
-		ath10k_err("could not fetch board data fw file (%ld)\n", PTR_ERR(fw));
+		ath10k_err("could not fetch board data fw file (%ld)\n",
+			   PTR_ERR(fw));
 		return PTR_ERR(fw);
 	}
 
@@ -304,7 +305,8 @@ static int ath10k_download_and_run_otp(struct ath10k *ar)
 
 	address = ar->hw_params.patch_load_addr;
 
-	fw = ath10k_fetch_fw_file(ar, ar->hw_params.fw.dir, ar->hw_params.fw.otp);
+	fw = ath10k_fetch_fw_file(ar, ar->hw_params.fw.dir,
+				  ar->hw_params.fw.otp);
 	if (IS_ERR(fw)) {
 		ath10k_warn("could not fetch otp (%ld)\n", PTR_ERR(fw));
 		return 0;
@@ -339,7 +341,8 @@ static int ath10k_download_fw(struct ath10k *ar)
 
 	address = ar->hw_params.patch_load_addr;
 
-	fw = ath10k_fetch_fw_file(ar, ar->hw_params.fw.dir, ar->hw_params.fw.fw);
+	fw = ath10k_fetch_fw_file(ar, ar->hw_params.fw.dir,
+				  ar->hw_params.fw.fw);
 	if (IS_ERR(fw)) {
 		ath10k_err("could not fetch fw (%ld)\n", PTR_ERR(fw));
 		return PTR_ERR(fw);
drivers/net/wireless/ath/ath10k/htc.c +8 -4
index 1e4c075..be41e11 100644
@@ -74,7 +74,8 @@ static inline void ath10k_htc_send_complete_check(struct ath10k_htc_ep *ep,
 	ath10k_hif_send_complete_check(ep->htc->ar, ep->ul_pipe_id, force);
 }
 
-static void ath10k_htc_control_tx_complete(struct ath10k *ar, struct sk_buff *skb)
+static void ath10k_htc_control_tx_complete(struct ath10k *ar,
+					   struct sk_buff *skb)
 {
 	kfree_skb(skb);
 }
@@ -596,7 +597,8 @@ out:
 	return status;
 }
 
-static void ath10k_htc_control_rx_complete(struct ath10k *ar, struct sk_buff *skb)
+static void ath10k_htc_control_rx_complete(struct ath10k *ar,
+					   struct sk_buff *skb)
 {
 	/* TODO, can't receive HTC control messages yet */
 	ath10k_dbg(ATH10K_DBG_HTC, "Invalid call to %s\n", __func__);
@@ -849,14 +851,16 @@ int ath10k_htc_connect_service(struct ath10k_htc *htc,
 
 		ath10k_dbg(ATH10K_DBG_HTC,
 			   "HTC Service %s connect response: status: 0x%x, assigned ep: 0x%x\n",
-			   htc_service_name(service_id), resp_msg->status, resp_msg->eid);
+			   htc_service_name(service_id),
+			   resp_msg->status, resp_msg->eid);
 
 		conn_resp->connect_resp_code = resp_msg->status;
 
 		/* check response status */
 		if (resp_msg->status != ATH10K_HTC_CONN_SVC_STATUS_SUCCESS) {
 			ath10k_err("HTC Service %s connect request failed: 0x%x)\n",
-				   htc_service_name(service_id), resp_msg->status);
+				   htc_service_name(service_id),
+				   resp_msg->status);
 			return -EPROTO;
 		}
 
drivers/net/wireless/ath/ath10k/htt_rx.c +2 -1
index cbd5508..23399d1 100644
@@ -978,7 +978,8 @@ static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt,
 end:
 	if (fw_desc_len > 0) {
 		ath10k_dbg(ATH10K_DBG_HTT,
-			   "expecting more fragmented rx in one indication %d\n", fw_desc_len);
+			   "expecting more fragmented rx in one indication %d\n",
+			   fw_desc_len);
 	}
 }
 
drivers/net/wireless/ath/ath10k/pci.c +2 -1
index 072cfd8..7eab49c 100644
@@ -184,7 +184,8 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
 
 		i = 0;
 		while (ath10k_ce_completed_send_next(ce_diag, NULL, &buf,
-						     &completed_nbytes, &id) != 0) {
+						     &completed_nbytes,
+						     &id) != 0) {
 			mdelay(1);
 			if (i++ > DIAG_ACCESS_CE_TIMEOUT_MS) {
 				ret = -EBUSY;
drivers/net/wireless/ath/ath10k/pci.h +2 -1
index 49f2d1b..e78b861 100644
@@ -316,7 +316,8 @@ static inline void ath10k_pci_write32(struct ath10k *ar, u32 offset,
 		ioread32(addr+offset+4); /* 1st read prior to write */
 		iowrite32(value, addr+offset);
 
-		spin_unlock_irqrestore(&ar_pci->hw_v1_workaround_lock, irq_flags);
+		spin_unlock_irqrestore(&ar_pci->hw_v1_workaround_lock,
+				       irq_flags);
 	} else
 		iowrite32(value, addr+offset);
 }
author
#5 lore raw

PATCH 5/27 ath10k: fix long lines related htd credit reporting

In reply to Kalle Valo
---
 drivers/net/wireless/ath/ath10k/htc.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath10k/htc.c +8 -5
index be41e11..a12c05b 100644
@@ -374,10 +374,11 @@ static void ath10k_htc_flush_endpoint_tx(struct ath10k_htc *htc,
 /* Receive */
 /***********/
 
-static void ath10k_htc_process_credit_report(struct ath10k_htc *htc,
-					     const struct ath10k_htc_credit_report *report,
-					     int len,
-					     enum ath10k_htc_ep_id eid)
+static void
+ath10k_htc_process_credit_report(struct ath10k_htc *htc,
+				 const struct ath10k_htc_credit_report *report,
+				 int len,
+				 enum ath10k_htc_ep_id eid)
 {
 	struct ath10k_htc_ep *ep;
 	int i, n_reports;
@@ -413,6 +414,7 @@ static int ath10k_htc_process_trailer(struct ath10k_htc *htc,
 	struct ath10k_htc_record *record;
 	u8 *orig_buffer;
 	int orig_length;
+	size_t len;
 
 	orig_buffer = buffer;
 	orig_length = length;
@@ -435,7 +437,8 @@ static int ath10k_htc_process_trailer(struct ath10k_htc *htc,
 
 		switch (record->hdr.id) {
 		case ATH10K_HTC_RECORD_CREDITS:
-			if (record->hdr.len < sizeof(struct ath10k_htc_credit_report)) {
+			len = sizeof(struct ath10k_htc_credit_report);
+			if (record->hdr.len < len) {
 				ath10k_warn("Credit report too long\n");
 				status = -EINVAL;
 				break;
author
#6 lore raw

PATCH 6/27 ath10k: fix long lines in htc.c

In reply to Kalle Valo
---
 drivers/net/wireless/ath/ath10k/htc.c    |    5 ++++-
 drivers/net/wireless/ath/ath10k/htt_rx.c |    7 +++++--
 2 files changed, 9 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/htc.c +4 -1
index a12c05b..ede91bd 100644
@@ -479,6 +479,7 @@ static int ath10k_htc_rx_completion_handler(struct ath10k *ar,
 	struct ath10k_htc_ep *ep;
 	u16 payload_len;
 	u32 trailer_len = 0;
+	size_t min_len;
 	u8 eid;
 	bool trailer_present;
 
@@ -533,7 +534,9 @@ static int ath10k_htc_rx_completion_handler(struct ath10k *ar,
 		u8 *trailer;
 
 		trailer_len = hdr->trailer_len;
-		if ((trailer_len < sizeof(struct ath10k_ath10k_htc_record_hdr)) ||
+		min_len = sizeof(struct ath10k_ath10k_htc_record_hdr);
+
+		if ((trailer_len < min_len) ||
 		    (trailer_len > payload_len)) {
 			ath10k_warn("Invalid trailer length: %d\n",
 				    trailer_len);
drivers/net/wireless/ath/ath10k/htt_rx.c +5 -2
index 23399d1..ed61dd3 100644
@@ -104,6 +104,7 @@ static int ath10k_htt_rx_ring_fill_level(struct ath10k_htt *htt)
 static void ath10k_htt_rx_ring_fill_n(struct ath10k_htt *htt, int num)
 {
 	struct htt_rx_desc *rx_desc;
+	unsigned long timeout;
 	struct sk_buff *skb;
 	dma_addr_t paddr;
 	int idx;
@@ -120,8 +121,10 @@ static void ath10k_htt_rx_ring_fill_n(struct ath10k_htt *htt, int num)
 			 * As long as enough buffers are left in the ring for
 			 * another A-MPDU rx, no special recovery is needed.
 			 */
-			mod_timer(&htt->rx_ring.refill_retry_timer, jiffies +
-				  msecs_to_jiffies(HTT_RX_RING_REFILL_RETRY_MS));
+			timeout = jiffies +
+				msecs_to_jiffies(HTT_RX_RING_REFILL_RETRY_MS);
+			mod_timer(&htt->rx_ring.refill_retry_timer,
+				  timeout);
 			goto fail;
 		}
 
author
#7 lore raw

PATCH 7/27 ath10k: get rid of unnecessary else branch

In reply to Kalle Valo

We can handle the same with a simple goto. Also
this gets rid of few long lines.

---
 drivers/net/wireless/ath/ath10k/htc.c |  137 +++++++++++++++++----------------
 1 file changed, 70 insertions(+), 67 deletions(-)
drivers/net/wireless/ath/ath10k/htc.c +70 -67
index ede91bd..42106ef 100644
@@ -793,87 +793,90 @@ int ath10k_htc_connect_service(struct ath10k_htc *htc,
 		assigned_eid = ATH10K_HTC_EP_0;
 		max_msg_size = ATH10K_HTC_MAX_CTRL_MSG_LEN;
 		memset(&resp_msg_dummy, 0, sizeof(resp_msg_dummy));
-	} else {
-		tx_alloc = ath10k_htc_get_credit_allocation(htc,
-							    conn_req->service_id);
-		if (!tx_alloc)
-			ath10k_warn("HTC Service %s does not allocate target credits\n",
-				    htc_service_name(conn_req->service_id));
-
-		skb = ath10k_htc_build_tx_ctrl_skb(htc->ar);
-		if (!skb) {
-			ath10k_err("Failed to allocate HTC packet\n");
-			return -ENOMEM;
-		}
+		goto setup;
+	}
 
-		length = sizeof(msg->hdr) + sizeof(msg->connect_service);
-		skb_put(skb, length);
-		memset(skb->data, 0, length);
+	tx_alloc = ath10k_htc_get_credit_allocation(htc,
+						    conn_req->service_id);
+	if (!tx_alloc)
+		ath10k_warn("HTC Service %s does not allocate target credits\n",
+			    htc_service_name(conn_req->service_id));
 
-		msg = (struct ath10k_htc_msg *)skb->data;
-		msg->hdr.message_id =
-			__cpu_to_le16(ATH10K_HTC_MSG_CONNECT_SERVICE_ID);
+	skb = ath10k_htc_build_tx_ctrl_skb(htc->ar);
+	if (!skb) {
+		ath10k_err("Failed to allocate HTC packet\n");
+		return -ENOMEM;
+	}
 
-		flags |= SM(tx_alloc, ATH10K_HTC_CONN_FLAGS_RECV_ALLOC);
+	length = sizeof(msg->hdr) + sizeof(msg->connect_service);
+	skb_put(skb, length);
+	memset(skb->data, 0, length);
 
-		req_msg = &msg->connect_service;
-		req_msg->flags = __cpu_to_le16(flags);
-		req_msg->service_id = __cpu_to_le16(conn_req->service_id);
+	msg = (struct ath10k_htc_msg *)skb->data;
+	msg->hdr.message_id =
+		__cpu_to_le16(ATH10K_HTC_MSG_CONNECT_SERVICE_ID);
 
-		/* Only enable credit flow control for WMI ctrl service */
-		if (conn_req->service_id != ATH10K_HTC_SVC_ID_WMI_CONTROL) {
-			flags |= ATH10K_HTC_CONN_FLAGS_DISABLE_CREDIT_FLOW_CTRL;
-			disable_credit_flow_ctrl = true;
-		}
+	flags |= SM(tx_alloc, ATH10K_HTC_CONN_FLAGS_RECV_ALLOC);
 
-		INIT_COMPLETION(htc->ctl_resp);
+	req_msg = &msg->connect_service;
+	req_msg->flags = __cpu_to_le16(flags);
+	req_msg->service_id = __cpu_to_le16(conn_req->service_id);
 
-		status = ath10k_htc_send(htc, ATH10K_HTC_EP_0, skb);
-		if (status)
-			return status;
-
-		/* wait for response */
-		status = wait_for_completion_timeout(&htc->ctl_resp,
-						     ATH10K_HTC_CONN_SVC_TIMEOUT_HZ);
-		if (status <= 0) {
-			if (status == 0)
-				status = -ETIMEDOUT;
-			ath10k_err("Service connect timeout: %d\n", status);
-			return status;
-		}
+	/* Only enable credit flow control for WMI ctrl service */
+	if (conn_req->service_id != ATH10K_HTC_SVC_ID_WMI_CONTROL) {
+		flags |= ATH10K_HTC_CONN_FLAGS_DISABLE_CREDIT_FLOW_CTRL;
+		disable_credit_flow_ctrl = true;
+	}
 
-		/* we controlled the buffer creation, it's aligned */
-		msg = (struct ath10k_htc_msg *)htc->control_resp_buffer;
-		resp_msg = &msg->connect_service_response;
-		message_id = __le16_to_cpu(msg->hdr.message_id);
-		service_id = __le16_to_cpu(resp_msg->service_id);
-
-		if ((message_id != ATH10K_HTC_MSG_CONNECT_SERVICE_RESP_ID) ||
-		    (htc->control_resp_len < sizeof(msg->hdr) +
-		     sizeof(msg->connect_service_response))) {
-			ath10k_err("Invalid resp message ID 0x%x", message_id);
-			return -EPROTO;
-		}
+	INIT_COMPLETION(htc->ctl_resp);
 
-		ath10k_dbg(ATH10K_DBG_HTC,
-			   "HTC Service %s connect response: status: 0x%x, assigned ep: 0x%x\n",
-			   htc_service_name(service_id),
-			   resp_msg->status, resp_msg->eid);
+	status = ath10k_htc_send(htc, ATH10K_HTC_EP_0, skb);
+	if (status)
+		return status;
 
-		conn_resp->connect_resp_code = resp_msg->status;
+	/* wait for response */
+	status = wait_for_completion_timeout(&htc->ctl_resp,
+					     ATH10K_HTC_CONN_SVC_TIMEOUT_HZ);
+	if (status <= 0) {
+		if (status == 0)
+			status = -ETIMEDOUT;
+		ath10k_err("Service connect timeout: %d\n", status);
+		return status;
+	}
 
-		/* check response status */
-		if (resp_msg->status != ATH10K_HTC_CONN_SVC_STATUS_SUCCESS) {
-			ath10k_err("HTC Service %s connect request failed: 0x%x)\n",
-				   htc_service_name(service_id),
-				   resp_msg->status);
-			return -EPROTO;
-		}
+	/* we controlled the buffer creation, it's aligned */
+	msg = (struct ath10k_htc_msg *)htc->control_resp_buffer;
+	resp_msg = &msg->connect_service_response;
+	message_id = __le16_to_cpu(msg->hdr.message_id);
+	service_id = __le16_to_cpu(resp_msg->service_id);
+
+	if ((message_id != ATH10K_HTC_MSG_CONNECT_SERVICE_RESP_ID) ||
+	    (htc->control_resp_len < sizeof(msg->hdr) +
+	     sizeof(msg->connect_service_response))) {
+		ath10k_err("Invalid resp message ID 0x%x", message_id);
+		return -EPROTO;
+	}
+
+	ath10k_dbg(ATH10K_DBG_HTC,
+		   "HTC Service %s connect response: status: 0x%x, assigned ep: 0x%x\n",
+		   htc_service_name(service_id),
+		   resp_msg->status, resp_msg->eid);
+
+	conn_resp->connect_resp_code = resp_msg->status;
 
-		assigned_eid = (enum ath10k_htc_ep_id)resp_msg->eid;
-		max_msg_size = __le16_to_cpu(resp_msg->max_msg_size);
+	/* check response status */
+	if (resp_msg->status != ATH10K_HTC_CONN_SVC_STATUS_SUCCESS) {
+		ath10k_err("HTC Service %s connect request failed: 0x%x)\n",
+			   htc_service_name(service_id),
+			   resp_msg->status);
+		return -EPROTO;
 	}
 
+	assigned_eid = (enum ath10k_htc_ep_id)resp_msg->eid;
+	max_msg_size = __le16_to_cpu(resp_msg->max_msg_size);
+
+setup:
+
 	if (assigned_eid >= ATH10K_HTC_EP_COUNT)
 		return -EPROTO;
 
author
#8 lore raw

PATCH 8/27 ath10k: fix long lines in htt_rx.c

In reply to Kalle Valo
---
 drivers/net/wireless/ath/ath10k/htt_rx.c |   43 ++++++++++++++++++++----------
 1 file changed, 28 insertions(+), 15 deletions(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +28 -15
index ed61dd3..1bd1589 100644
@@ -569,6 +569,8 @@ static int ath10k_htt_rx_amsdu(struct ath10k_htt *htt,
 	struct sk_buff *skb = info->skb;
 	enum rx_msdu_decap_format fmt;
 	enum htt_rx_mpdu_encrypt_type enctype;
+	unsigned int hdr_len;
+	int crypto_len;
 
 	rxd = (void *)skb->data - sizeof(*rxd);
 	fmt = MS(__le32_to_cpu(rxd->msdu_start.info1),
@@ -619,8 +621,11 @@ static int ath10k_htt_rx_amsdu(struct ath10k_htt *htt,
 			 * aligned to 4 byte boundary. */
 
 			hdr = (void *)amsdu->data;
-			decap_hdr += roundup(ieee80211_hdrlen(hdr->frame_control), 4);
-			decap_hdr += roundup(ath10k_htt_rx_crypto_param_len(enctype), 4);
+			hdr_len = ieee80211_hdrlen(hdr->frame_control);
+			crypto_len = ath10k_htt_rx_crypto_param_len(enctype);
+
+			decap_hdr += roundup(hdr_len, 4);
+			decap_hdr += roundup(crypto_len, 4);
 		}
 
 		if (fmt == RX_MSDU_DECAP_ETHERNET2_DIX) {
@@ -766,6 +771,7 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt,
 {
 	struct htt_rx_info info;
 	struct htt_rx_indication_mpdu_range *mpdu_ranges;
+	struct ieee80211_hdr *hdr;
 	int num_mpdu_ranges;
 	int fw_desc_len;
 	u8 *fw_desc;
@@ -791,6 +797,7 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt,
 
 		for (j = 0; j < mpdu_ranges[i].mpdu_count; j++) {
 			struct sk_buff *msdu_head, *msdu_tail;
+			enum htt_rx_mpdu_status status;
 			int msdu_chaining;
 
 			msdu_head = NULL;
@@ -818,18 +825,20 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt,
 				continue;
 			}
 
+			status = info.status;
+
 			/* Skip mgmt frames while we handle this in WMI */
-			if (info.status == HTT_RX_IND_MPDU_STATUS_MGMT_CTRL) {
+			if (status == HTT_RX_IND_MPDU_STATUS_MGMT_CTRL) {
 				ath10k_htt_rx_free_msdu_chain(msdu_head);
 				continue;
 			}
 
-			if (info.status != HTT_RX_IND_MPDU_STATUS_OK &&
-			    info.status != HTT_RX_IND_MPDU_STATUS_TKIP_MIC_ERR &&
+			if (status != HTT_RX_IND_MPDU_STATUS_OK &&
+			    status != HTT_RX_IND_MPDU_STATUS_TKIP_MIC_ERR &&
 			    !htt->ar->monitor_enabled) {
 				ath10k_dbg(ATH10K_DBG_HTT,
 					   "htt rx ignoring frame w/ status %d\n",
-					   info.status);
+					   status);
 				ath10k_htt_rx_free_msdu_chain(msdu_head);
 				continue;
 			}
@@ -851,7 +860,9 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt,
 			info.rate.info1 = __le32_to_cpu(rx->ppdu.info1);
 			info.rate.info2 = __le32_to_cpu(rx->ppdu.info2);
 
-			if (ath10k_htt_rx_hdr_is_amsdu(ath10k_htt_rx_skb_get_hdr(msdu_head)))
+			hdr = ath10k_htt_rx_skb_get_hdr(msdu_head);
+
+			if (ath10k_htt_rx_hdr_is_amsdu(hdr))
 				ret = ath10k_htt_rx_amsdu(htt, &info);
 			else
 				ret = ath10k_htt_rx_msdu(htt, &info);
@@ -886,7 +897,7 @@ static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt,
 	bool tkip_mic_err;
 	bool decrypt_err;
 	u8 *fw_desc;
-	int fw_desc_len;
+	int fw_desc_len, hdrlen, paramlen;
 	int trim;
 
 	fw_desc_len = __le16_to_cpu(frag->fw_rx_desc_bytes);
@@ -944,8 +955,8 @@ static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt,
 	}
 
 	if (info.encrypt_type != HTT_RX_MPDU_ENCRYPT_NONE) {
-		int hdrlen = ieee80211_hdrlen(hdr->frame_control);
-		int paramlen = ath10k_htt_rx_crypto_param_len(info.encrypt_type);
+		hdrlen = ieee80211_hdrlen(hdr->frame_control);
+		paramlen = ath10k_htt_rx_crypto_param_len(info.encrypt_type);
 
 		/* It is more efficient to move the header than the payload */
 		memmove((void *)info.skb->data + paramlen,
@@ -1025,11 +1036,12 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 		break;
 	}
 	case HTT_T2H_MSG_TYPE_MGMT_TX_COMPLETION: {
-		struct htt_tx_done tx_done = {
-			.msdu_id = __le32_to_cpu(resp->mgmt_tx_completion.desc_id),
-		};
+		struct htt_tx_done tx_done = {};
 		int status = __le32_to_cpu(resp->mgmt_tx_completion.status);
 
+		tx_done.msdu_id =
+			__le32_to_cpu(resp->mgmt_tx_completion.desc_id);
+
 		switch (status) {
 		case HTT_MGMT_TX_STATUS_OK:
 			tx_done.discard = false;
@@ -1047,6 +1059,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 		struct htt_tx_done tx_done = {};
 		int status = MS(resp->data_tx_completion.flags,
 				HTT_DATA_TX_STATUS);
+		__le16 msdu_id;
 		int i;
 
 		switch (status) {
@@ -1073,8 +1086,8 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 			   resp->data_tx_completion.num_msdus);
 
 		for (i = 0; i < resp->data_tx_completion.num_msdus; i++) {
-			tx_done.msdu_id =
-				__le16_to_cpu(resp->data_tx_completion.msdus[i]);
+			msdu_id = resp->data_tx_completion.msdus[i];
+			tx_done.msdu_id = __le16_to_cpu(msdu_id);
 			ath10k_txrx_tx_completed(htt, &tx_done);
 		}
 		break;
author
#9 lore raw

PATCH 9/27 ath10k: fix comment style in htt.h

In reply to Kalle Valo

Fixes few long lines at the same time.

---
 drivers/net/wireless/ath/ath10k/htt.h |  166 +++++++++++++++++++++++++--------
 1 file changed, 125 insertions(+), 41 deletions(-)
drivers/net/wireless/ath/ath10k/htt.h +125 -41
index 95898ba..be9dc72 100644
@@ -734,65 +734,149 @@ struct htt_pktlog_msg {
 } __packed;
 
 struct htt_dbg_stats_rx_reorder_stats {
-	__le32 deliver_non_qos; /* Non QoS MPDUs received */
-	__le32 deliver_in_order; /* MPDUs received in-order */
-	__le32 deliver_flush_timeout; /* Flush due to reorder timer expired */
-	__le32 deliver_flush_oow; /* Flush due to move out of window */
-	__le32 deliver_flush_delba; /* Flush due to DELBA */
-	__le32 fcs_error; /* MPDUs dropped due to FCS error */
-	__le32 mgmt_ctrl; /* MPDUs dropped due to monitor mode non-data packet */
-	__le32 invalid_peer; /* MPDUs dropped due to invalid peer */
-	__le32 dup_non_aggr; /* MPDUs dropped due to duplication (non aggregation) */
-	__le32 dup_past; /* MPDUs dropped due to processed before */
-	__le32 dup_in_reorder; /* MPDUs dropped due to duplicate in reorder queue */
-	__le32 reorder_timeout; /* Reorder timeout happened */
-	__le32 invalid_bar_ssn; /* invalid bar ssn */
-	__le32 ssn_reset; /* reorder reset due to bar ssn */
+	/* Non QoS MPDUs received */
+	__le32 deliver_non_qos;
+
+	/* MPDUs received in-order */
+	__le32 deliver_in_order;
+
+	/* Flush due to reorder timer expired */
+	__le32 deliver_flush_timeout;
+
+	/* Flush due to move out of window */
+	__le32 deliver_flush_oow;
+
+	/* Flush due to DELBA */
+	__le32 deliver_flush_delba;
+
+	/* MPDUs dropped due to FCS error */
+	__le32 fcs_error;
+
+	/* MPDUs dropped due to monitor mode non-data packet */
+	__le32 mgmt_ctrl;
+
+	/* MPDUs dropped due to invalid peer */
+	__le32 invalid_peer;
+
+	/* MPDUs dropped due to duplication (non aggregation) */
+	__le32 dup_non_aggr;
+
+	/* MPDUs dropped due to processed before */
+	__le32 dup_past;
+
+	/* MPDUs dropped due to duplicate in reorder queue */
+	__le32 dup_in_reorder;
+
+	/* Reorder timeout happened */
+	__le32 reorder_timeout;
+
+	/* invalid bar ssn */
+	__le32 invalid_bar_ssn;
+
+	/* reorder reset due to bar ssn */
+	__le32 ssn_reset;
 };
 
 struct htt_dbg_stats_wal_tx_stats {
-	__le32 comp_queued; /* Num HTT cookies queued to dispatch list */
-	__le32 comp_delivered; /* Num HTT cookies dispatched */
-	__le32 msdu_enqued; /* Num MSDU queued to WAL */
-	__le32 mpdu_enqued; /* Num MPDU queue to WAL */
-	__le32 wmm_drop; /* Num MSDUs dropped by WMM limit */
-	__le32 local_enqued; /* Num Local frames queued */
-	__le32 local_freed; /* Num Local frames done */
-	__le32 hw_queued; /* Num queued to HW */
-	__le32 hw_reaped; /* Num PPDU reaped from HW */
-	__le32 underrun; /* Num underruns */
-	__le32 tx_abort; /* Num PPDUs cleaned up in TX abort */
-	__le32 mpdus_requed; /* Num MPDUs requed by SW */
-	__le32 tx_ko; /* excessive retries */
-	__le32 data_rc; /* data hw rate code */
-	__le32 self_triggers; /* Scheduler self triggers */
-	__le32 sw_retry_failure; /* frames dropped due to excessive sw retries */
-	__le32 illgl_rate_phy_err; /* illegal rate phy errors  */
-	__le32 pdev_cont_xretry; /* wal pdev continous xretry */
-	__le32 pdev_tx_timeout; /* wal pdev continous xretry */
-	__le32 pdev_resets; /* wal pdev resets  */
+
+	/* Num HTT cookies queued to dispatch list */
+	__le32 comp_queued;
+
+	/* Num HTT cookies dispatched */
+	__le32 comp_delivered;
+
+	/* Num MSDU queued to WAL */
+	__le32 msdu_enqued;
+
+	/* Num MPDU queue to WAL */
+	__le32 mpdu_enqued;
+
+	/* Num MSDUs dropped by WMM limit */
+	__le32 wmm_drop;
+
+	/* Num Local frames queued */
+	__le32 local_enqued;
+
+	/* Num Local frames done */
+	__le32 local_freed;
+
+	/* Num queued to HW */
+	__le32 hw_queued;
+
+	/* Num PPDU reaped from HW */
+	__le32 hw_reaped;
+
+	/* Num underruns */
+	__le32 underrun;
+
+	/* Num PPDUs cleaned up in TX abort */
+	__le32 tx_abort;
+
+	/* Num MPDUs requed by SW */
+	__le32 mpdus_requed;
+
+	/* excessive retries */
+	__le32 tx_ko;
+
+	/* data hw rate code */
+	__le32 data_rc;
+
+	/* Scheduler self triggers */
+	__le32 self_triggers;
+
+	/* frames dropped due to excessive sw retries */
+	__le32 sw_retry_failure;
+
+	/* illegal rate phy errors  */
+	__le32 illgl_rate_phy_err;
+
+	/* wal pdev continous xretry */
+	__le32 pdev_cont_xretry;
+
+	/* wal pdev continous xretry */
+	__le32 pdev_tx_timeout;
+
+	/* wal pdev resets  */
+	__le32 pdev_resets;
+
 	__le32 phy_underrun;
-	__le32 txop_ovf; /* MPDU is more than txop limit */
+
+	/* MPDU is more than txop limit */
+	__le32 txop_ovf;
 } __packed;
 
 struct htt_dbg_stats_wal_rx_stats {
-	__le32 mid_ppdu_route_change; /* Cnts any change in ring routing mid-ppdu */
-	__le32 status_rcvd; /* Total number of statuses processed */
+	/* Cnts any change in ring routing mid-ppdu */
+	__le32 mid_ppdu_route_change;
+
+	/* Total number of statuses processed */
+	__le32 status_rcvd;
+
 	/* Extra frags on rings 0-3 */
 	__le32 r0_frags;
 	__le32 r1_frags;
 	__le32 r2_frags;
 	__le32 r3_frags;
+
 	/* MSDUs / MPDUs delivered to HTT */
 	__le32 htt_msdus;
 	__le32 htt_mpdus;
+
 	/* MSDUs / MPDUs delivered to local stack */
 	__le32 loc_msdus;
 	__le32 loc_mpdus;
-	__le32 oversize_amsdu; /* AMSDUs that have more MSDUs than the status ring size */
-	__le32 phy_errs; /* Number of PHY errors */
-	__le32 phy_err_drop; /* Number of PHY errors drops */
-	__le32 mpdu_errs; /* Number of mpdu errors - FCS, MIC, ENC etc. */
+
+	/* AMSDUs that have more MSDUs than the status ring size */
+	__le32 oversize_amsdu;
+
+	/* Number of PHY errors */
+	__le32 phy_errs;
+
+	/* Number of PHY errors drops */
+	__le32 phy_err_drop;
+
+	/* Number of mpdu errors - FCS, MIC, ENC etc. */
+	__le32 mpdu_errs;
 } __packed;
 
 struct htt_dbg_stats_wal_peer_stats {
author
#10 lore raw

PATCH 10/27 ath10k: fix long lines in ce.c

In reply to Kalle Valo
---
 drivers/net/wireless/ath/ath10k/ce.c |   30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)
drivers/net/wireless/ath/ath10k/ce.c +14 -16
index 480b809..d439181 100644
@@ -194,11 +194,10 @@ static inline void ath10k_ce_src_ring_highmark_set(struct ath10k *ar,
 						   u32 ce_ctrl_addr,
 						   unsigned int n)
 {
-	u32 watermark_addr = ath10k_pci_read32(ar,
-					       ce_ctrl_addr + SRC_WATERMARK_ADDRESS);
+	u32 addr = ath10k_pci_read32(ar, ce_ctrl_addr + SRC_WATERMARK_ADDRESS);
 
 	ath10k_pci_write32(ar, ce_ctrl_addr + SRC_WATERMARK_ADDRESS,
-			   (watermark_addr & ~SRC_WATERMARK_HIGH_MASK) |
+			   (addr & ~SRC_WATERMARK_HIGH_MASK) |
 			   SRC_WATERMARK_HIGH_SET(n));
 }
 
@@ -206,11 +205,10 @@ static inline void ath10k_ce_src_ring_lowmark_set(struct ath10k *ar,
 						  u32 ce_ctrl_addr,
 						  unsigned int n)
 {
-	u32 watermark_addr = ath10k_pci_read32(ar,
-					       ce_ctrl_addr + SRC_WATERMARK_ADDRESS);
+	u32 addr = ath10k_pci_read32(ar, ce_ctrl_addr + SRC_WATERMARK_ADDRESS);
 
 	ath10k_pci_write32(ar, ce_ctrl_addr + SRC_WATERMARK_ADDRESS,
-			   (watermark_addr & ~SRC_WATERMARK_LOW_MASK) |
+			   (addr & ~SRC_WATERMARK_LOW_MASK) |
 			   SRC_WATERMARK_LOW_SET(n));
 }
 
@@ -218,11 +216,10 @@ static inline void ath10k_ce_dest_ring_highmark_set(struct ath10k *ar,
 						    u32 ce_ctrl_addr,
 						    unsigned int n)
 {
-	u32 watermark_addr = ath10k_pci_read32(ar,
-					       ce_ctrl_addr + DST_WATERMARK_ADDRESS);
+	u32 addr = ath10k_pci_read32(ar, ce_ctrl_addr + DST_WATERMARK_ADDRESS);
 
 	ath10k_pci_write32(ar, ce_ctrl_addr + DST_WATERMARK_ADDRESS,
-			   (watermark_addr & ~DST_WATERMARK_HIGH_MASK) |
+			   (addr & ~DST_WATERMARK_HIGH_MASK) |
 			   DST_WATERMARK_HIGH_SET(n));
 }
 
@@ -230,11 +227,10 @@ static inline void ath10k_ce_dest_ring_lowmark_set(struct ath10k *ar,
 						   u32 ce_ctrl_addr,
 						   unsigned int n)
 {
-	u32 watermark_addr = ath10k_pci_read32(ar,
-					       ce_ctrl_addr + DST_WATERMARK_ADDRESS);
+	u32 addr = ath10k_pci_read32(ar, ce_ctrl_addr + DST_WATERMARK_ADDRESS);
 
 	ath10k_pci_write32(ar, ce_ctrl_addr + DST_WATERMARK_ADDRESS,
-			   (watermark_addr & ~DST_WATERMARK_LOW_MASK) |
+			   (addr & ~DST_WATERMARK_LOW_MASK) |
 			   DST_WATERMARK_LOW_SET(n));
 }
 
@@ -397,14 +393,16 @@ int ath10k_ce_sendlist_send(struct ce_state *ce_state,
 	unsigned int num_items = sendlist->num_items;
 	unsigned int sw_index;
 	unsigned int write_index;
-	int i, ret = -ENOMEM;
+	int i, delta, ret = -ENOMEM;
 
 	spin_lock_bh(&ar_pci->ce_lock);
 
 	sw_index = src_ring->sw_index;
 	write_index = src_ring->write_index;
 
-	if (CE_RING_DELTA(nentries_mask, write_index, sw_index - 1) >= num_items) {
+	delta = CE_RING_DELTA(nentries_mask, write_index, sw_index - 1);
+
+	if (delta >= num_items) {
 		/*
 		 * Handle all but the last item uniformly.
 		 */
@@ -887,7 +885,7 @@ void ath10k_ce_disable_interrupts(struct ath10k *ar)
 
 void ath10k_ce_send_cb_register(struct ce_state *ce_state,
 				void (*send_cb) (struct ce_state *ce_state,
-						 void *per_transfer_send_context,
+						 void *transfer_context,
 						 u32 buffer,
 						 unsigned int nbytes,
 						 unsigned int transfer_id),
@@ -904,7 +902,7 @@ void ath10k_ce_send_cb_register(struct ce_state *ce_state,
 
 void ath10k_ce_recv_cb_register(struct ce_state *ce_state,
 				void (*recv_cb) (struct ce_state *ce_state,
-						 void *per_transfer_recv_context,
+						 void *transfer_context,
 						 u32 buffer,
 						 unsigned int nbytes,
 						 unsigned int transfer_id,
author
#11 lore raw

PATCH 11/27 ath10k: rename WMI_CMD_GRP_START_ID()

In reply to Kalle Valo

Just to make lines shorter.

---
 drivers/net/wireless/ath/ath10k/wmi.h |   56 +++++++++++++++++----------------
 1 file changed, 28 insertions(+), 28 deletions(-)
drivers/net/wireless/ath/ath10k/wmi.h +28 -28
index 9b15369..053d294 100644
@@ -218,7 +218,7 @@ enum wmi_cmd_group {
 	WMI_GRP_MISC,
 };
 
-#define WMI_CMD_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1)
+#define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)
 #define WMI_EVT_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1)
 
 /* Command IDs and commande events. */
@@ -226,13 +226,13 @@ enum wmi_cmd_id {
 	WMI_INIT_CMDID = 0x1,
 
 	/* Scan specific commands */
-	WMI_START_SCAN_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_SCAN),
+	WMI_START_SCAN_CMDID = WMI_CMD_GRP(WMI_GRP_SCAN),
 	WMI_STOP_SCAN_CMDID,
 	WMI_SCAN_CHAN_LIST_CMDID,
 	WMI_SCAN_SCH_PRIO_TBL_CMDID,
 
 	/* PDEV (physical device) specific commands */
-	WMI_PDEV_SET_REGDOMAIN_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_PDEV),
+	WMI_PDEV_SET_REGDOMAIN_CMDID = WMI_CMD_GRP(WMI_GRP_PDEV),
 	WMI_PDEV_SET_CHANNEL_CMDID,
 	WMI_PDEV_SET_PARAM_CMDID,
 	WMI_PDEV_PKTLOG_ENABLE_CMDID,
@@ -246,7 +246,7 @@ enum wmi_cmd_id {
 	WMI_PDEV_GET_TPC_CONFIG_CMDID,
 
 	/* VDEV (virtual device) specific commands */
-	WMI_VDEV_CREATE_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_VDEV),
+	WMI_VDEV_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_VDEV),
 	WMI_VDEV_DELETE_CMDID,
 	WMI_VDEV_START_REQUEST_CMDID,
 	WMI_VDEV_RESTART_REQUEST_CMDID,
@@ -259,7 +259,7 @@ enum wmi_cmd_id {
 	WMI_VDEV_INSTALL_KEY_CMDID,
 
 	/* peer specific commands */
-	WMI_PEER_CREATE_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_PEER),
+	WMI_PEER_CREATE_CMDID = WMI_CMD_GRP(WMI_GRP_PEER),
 	WMI_PEER_DELETE_CMDID,
 	WMI_PEER_FLUSH_TIDS_CMDID,
 	WMI_PEER_SET_PARAM_CMDID,
@@ -269,7 +269,7 @@ enum wmi_cmd_id {
 	WMI_PEER_MCAST_GROUP_CMDID,
 
 	/* beacon/management specific commands */
-	WMI_BCN_TX_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_MGMT),
+	WMI_BCN_TX_CMDID = WMI_CMD_GRP(WMI_GRP_MGMT),
 	WMI_PDEV_SEND_BCN_CMDID,
 	WMI_BCN_TMPL_CMDID,
 	WMI_BCN_FILTER_RX_CMDID,
@@ -278,7 +278,7 @@ enum wmi_cmd_id {
 	WMI_PRB_TMPL_CMDID,
 
 	/* commands to directly control BA negotiation directly from host. */
-	WMI_ADDBA_CLEAR_RESP_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_BA_NEG),
+	WMI_ADDBA_CLEAR_RESP_CMDID = WMI_CMD_GRP(WMI_GRP_BA_NEG),
 	WMI_ADDBA_SEND_CMDID,
 	WMI_ADDBA_STATUS_CMDID,
 	WMI_DELBA_SEND_CMDID,
@@ -286,96 +286,96 @@ enum wmi_cmd_id {
 	WMI_SEND_SINGLEAMSDU_CMDID,
 
 	/* Station power save specific config */
-	WMI_STA_POWERSAVE_MODE_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_STA_PS),
+	WMI_STA_POWERSAVE_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_STA_PS),
 	WMI_STA_POWERSAVE_PARAM_CMDID,
 	WMI_STA_MIMO_PS_MODE_CMDID,
 
 	/** DFS-specific commands */
-	WMI_PDEV_DFS_ENABLE_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_DFS),
+	WMI_PDEV_DFS_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_DFS),
 	WMI_PDEV_DFS_DISABLE_CMDID,
 
 	/* Roaming specific  commands */
-	WMI_ROAM_SCAN_MODE = WMI_CMD_GRP_START_ID(WMI_GRP_ROAM),
+	WMI_ROAM_SCAN_MODE = WMI_CMD_GRP(WMI_GRP_ROAM),
 	WMI_ROAM_SCAN_RSSI_THRESHOLD,
 	WMI_ROAM_SCAN_PERIOD,
 	WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
 	WMI_ROAM_AP_PROFILE,
 
 	/* offload scan specific commands */
-	WMI_OFL_SCAN_ADD_AP_PROFILE = WMI_CMD_GRP_START_ID(WMI_GRP_OFL_SCAN),
+	WMI_OFL_SCAN_ADD_AP_PROFILE = WMI_CMD_GRP(WMI_GRP_OFL_SCAN),
 	WMI_OFL_SCAN_REMOVE_AP_PROFILE,
 	WMI_OFL_SCAN_PERIOD,
 
 	/* P2P specific commands */
-	WMI_P2P_DEV_SET_DEVICE_INFO = WMI_CMD_GRP_START_ID(WMI_GRP_P2P),
+	WMI_P2P_DEV_SET_DEVICE_INFO = WMI_CMD_GRP(WMI_GRP_P2P),
 	WMI_P2P_DEV_SET_DISCOVERABILITY,
 	WMI_P2P_GO_SET_BEACON_IE,
 	WMI_P2P_GO_SET_PROBE_RESP_IE,
 	WMI_P2P_SET_VENDOR_IE_DATA_CMDID,
 
 	/* AP power save specific config */
-	WMI_AP_PS_PEER_PARAM_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_AP_PS),
+	WMI_AP_PS_PEER_PARAM_CMDID = WMI_CMD_GRP(WMI_GRP_AP_PS),
 	WMI_AP_PS_PEER_UAPSD_COEX_CMDID,
 
 	/* Rate-control specific commands */
 	WMI_PEER_RATE_RETRY_SCHED_CMDID =
-	WMI_CMD_GRP_START_ID(WMI_GRP_RATE_CTRL),
+	WMI_CMD_GRP(WMI_GRP_RATE_CTRL),
 
 	/* WLAN Profiling commands. */
-	WMI_WLAN_PROFILE_TRIGGER_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_PROFILE),
+	WMI_WLAN_PROFILE_TRIGGER_CMDID = WMI_CMD_GRP(WMI_GRP_PROFILE),
 	WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
 	WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
 	WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
 	WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
 
 	/* Suspend resume command Ids */
-	WMI_PDEV_SUSPEND_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_SUSPEND),
+	WMI_PDEV_SUSPEND_CMDID = WMI_CMD_GRP(WMI_GRP_SUSPEND),
 	WMI_PDEV_RESUME_CMDID,
 
 	/* Beacon filter commands */
-	WMI_ADD_BCN_FILTER_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_BCN_FILTER),
+	WMI_ADD_BCN_FILTER_CMDID = WMI_CMD_GRP(WMI_GRP_BCN_FILTER),
 	WMI_RMV_BCN_FILTER_CMDID,
 
 	/* WOW Specific WMI commands*/
-	WMI_WOW_ADD_WAKE_PATTERN_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_WOW),
+	WMI_WOW_ADD_WAKE_PATTERN_CMDID = WMI_CMD_GRP(WMI_GRP_WOW),
 	WMI_WOW_DEL_WAKE_PATTERN_CMDID,
 	WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
 	WMI_WOW_ENABLE_CMDID,
 	WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
 
 	/* RTT measurement related cmd */
-	WMI_RTT_MEASREQ_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_RTT),
+	WMI_RTT_MEASREQ_CMDID = WMI_CMD_GRP(WMI_GRP_RTT),
 	WMI_RTT_TSF_CMDID,
 
 	/* spectral scan commands */
-	WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_SPECTRAL),
+	WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID = WMI_CMD_GRP(WMI_GRP_SPECTRAL),
 	WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
 
 	/* F/W stats */
-	WMI_REQUEST_STATS_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_STATS),
+	WMI_REQUEST_STATS_CMDID = WMI_CMD_GRP(WMI_GRP_STATS),
 
 	/* ARP OFFLOAD REQUEST*/
-	WMI_SET_ARP_NS_OFFLOAD_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_ARP_NS_OFL),
+	WMI_SET_ARP_NS_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_ARP_NS_OFL),
 
 	/* NS offload confid*/
-	WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_NLO_OFL),
+	WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID = WMI_CMD_GRP(WMI_GRP_NLO_OFL),
 
 	/* GTK offload Specific WMI commands*/
-	WMI_GTK_OFFLOAD_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_GTK_OFL),
+	WMI_GTK_OFFLOAD_CMDID = WMI_CMD_GRP(WMI_GRP_GTK_OFL),
 
 	/* CSA offload Specific WMI commands*/
-	WMI_CSA_OFFLOAD_ENABLE_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_CSA_OFL),
+	WMI_CSA_OFFLOAD_ENABLE_CMDID = WMI_CMD_GRP(WMI_GRP_CSA_OFL),
 	WMI_CSA_OFFLOAD_CHANSWITCH_CMDID,
 
 	/* Chatter commands*/
-	WMI_CHATTER_SET_MODE_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_CHATTER),
+	WMI_CHATTER_SET_MODE_CMDID = WMI_CMD_GRP(WMI_GRP_CHATTER),
 
 	/* addba specific commands */
-	WMI_PEER_TID_ADDBA_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_TID_ADDBA),
+	WMI_PEER_TID_ADDBA_CMDID = WMI_CMD_GRP(WMI_GRP_TID_ADDBA),
 	WMI_PEER_TID_DELBA_CMDID,
 
 	/* misc command group */
-	WMI_ECHO_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_MISC),
+	WMI_ECHO_CMDID = WMI_CMD_GRP(WMI_GRP_MISC),
 	WMI_DBGLOG_CFG_CMDID,
 	WMI_PDEV_QVIT_CMDID,
 	WMI_PDEV_FTM_INTG_CMDID,
author
#12 lore raw

PATCH 12/27 ath10k: rename struct wmi_p2p_noa_info::noa_descriptors

In reply to Kalle Valo

The word noa is useless as a field name. This makes few lines shorter.

---
 drivers/net/wireless/ath/ath10k/wmi.c |    9 ++++-----
 drivers/net/wireless/ath/ath10k/wmi.h |    2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath10k/wmi.c +4 -5
index a1cf450..9d72f29 100644
@@ -575,11 +575,10 @@ static void ath10k_p2p_fill_noa_ie(u8 *data, u32 len,
 
 	for (i = 0; i < noa_descriptors; i++) {
 		noa_attr->desc[i].count =
-			__le32_to_cpu(noa->noa_descriptors[i].type_count);
-		noa_attr->desc[i].duration = noa->noa_descriptors[i].duration;
-		noa_attr->desc[i].interval = noa->noa_descriptors[i].interval;
-		noa_attr->desc[i].start_time =
-				noa->noa_descriptors[i].start_time;
+			__le32_to_cpu(noa->descriptors[i].type_count);
+		noa_attr->desc[i].duration = noa->descriptors[i].duration;
+		noa_attr->desc[i].interval = noa->descriptors[i].interval;
+		noa_attr->desc[i].start_time = noa->descriptors[i].start_time;
 	}
 
 	attr_len = 2; /* index + oppps_ctwindow */
drivers/net/wireless/ath/ath10k/wmi.h +1 -1
index 053d294..231f7b6 100644
@@ -2490,7 +2490,7 @@ struct wmi_p2p_noa_info {
 	/* Number of NOA descriptors */
 	u8 num_descriptors;
 
-	struct wmi_p2p_noa_descriptor noa_descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
+	struct wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
 } __packed;
 
 struct wmi_bcn_info {
author
#13 lore raw

PATCH 13/27 ath10k: shorten ath10k_wmi_pdev_set_wmm_params() declaration

In reply to Kalle Valo

To keep checkpatch happy.

---
 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 231f7b6..d286f3e 100644
@@ -2880,7 +2880,7 @@ int ath10k_wmi_scan_chan_list(struct ath10k *ar,
 			      const struct wmi_scan_chan_list_arg *arg);
 int ath10k_wmi_beacon_send(struct ath10k *ar, const struct wmi_bcn_tx_arg *arg);
 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);
 int ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id);
 
 #endif /* _WMI_H_ */
author
#14 lore raw

PATCH 14/27 ath10k: fix few long lines in wmi.c

In reply to Kalle Valo
---
 drivers/net/wireless/ath/ath10k/wmi.c |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath10k/wmi.c +12 -6
index 9d72f29..5e235d4 100644
@@ -407,10 +407,12 @@ static void ath10k_wmi_event_update_stats(struct ath10k *ar,
 static void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar,
 					     struct sk_buff *skb)
 {
-	struct wmi_vdev_start_response_event *ev = (struct wmi_vdev_start_response_event *)skb->data;
+	struct wmi_vdev_start_response_event *ev;
 
 	ath10k_dbg(ATH10K_DBG_WMI, "WMI_VDEV_START_RESP_EVENTID\n");
 
+	ev = (struct wmi_vdev_start_response_event *)skb->data;
+
 	if (WARN_ON(__le32_to_cpu(ev->status)))
 		return;
 
@@ -485,7 +487,8 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,
 			     sizeof(bcn_info->tim_info.tim_bitmap));
 
 		for (i = 0; i < sizeof(arvif->u.ap.tim_bitmap); i++) {
-			u32 v = __le32_to_cpu(bcn_info->tim_info.tim_bitmap[i / 4]);
+			__le32 t = bcn_info->tim_info.tim_bitmap[i / 4];
+			u32 v = __le32_to_cpu(t);
 			arvif->u.ap.tim_bitmap[i] = (v >> ((i % 4) * 8)) & 0xFF;
 		}
 
@@ -653,8 +656,8 @@ cleanup:
 
 static void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb)
 {
-	struct wmi_host_swba_event *ev = (struct wmi_host_swba_event *)skb->data;
-	u32 map = __le32_to_cpu(ev->vdev_map);
+	struct wmi_host_swba_event *ev;
+	u32 map;
 	int i = -1;
 	struct wmi_bcn_info *bcn_info;
 	struct ath10k_vif *arvif;
@@ -665,6 +668,9 @@ static void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb)
 
 	ath10k_dbg(ATH10K_DBG_BEACON, "WMI_HOST_SWBA_EVENTID\n");
 
+	ev = (struct wmi_host_swba_event *)skb->data;
+	map = __le32_to_cpu(ev->vdev_map);
+
 	ath10k_dbg(ATH10K_DBG_BEACON, "host swba:\n"
 		   "-vdev map 0x%x\n",
 		   ev->vdev_map);
@@ -1560,8 +1566,8 @@ int ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id)
 }
 
 static int ath10k_wmi_vdev_start_restart(struct ath10k *ar,
-					 const struct wmi_vdev_start_request_arg *arg,
-					 enum wmi_cmd_id cmd_id)
+				const struct wmi_vdev_start_request_arg *arg,
+				enum wmi_cmd_id cmd_id)
 {
 	struct wmi_vdev_start_request_cmd *cmd;
 	struct sk_buff *skb;
author
#15 lore raw

PATCH 15/27 ath10k: change config initialisation in ath10k_wmi_cmd_init()

In reply to Kalle Valo

Less long lines that way.

---
 drivers/net/wireless/ath/ath10k/wmi.c |   84 ++++++++++++++++++++-------------
 1 file changed, 52 insertions(+), 32 deletions(-)
drivers/net/wireless/ath/ath10k/wmi.c +52 -32
index 5e235d4..441fbcd 100644
@@ -1256,38 +1256,58 @@ int ath10k_wmi_cmd_init(struct ath10k *ar)
 {
 	struct wmi_init_cmd *cmd;
 	struct sk_buff *buf;
-	struct wmi_resource_config config = {
-		.num_vdevs = __cpu_to_le32(TARGET_NUM_VDEVS),
-		.num_peers = __cpu_to_le32(TARGET_NUM_PEERS + TARGET_NUM_VDEVS),
-		.num_offload_peers = __cpu_to_le32(TARGET_NUM_OFFLOAD_PEERS),
-		.num_offload_reorder_bufs = __cpu_to_le32(TARGET_NUM_OFFLOAD_REORDER_BUFS),
-		.num_peer_keys = __cpu_to_le32(TARGET_NUM_PEER_KEYS),
-		.num_tids = __cpu_to_le32(TARGET_NUM_TIDS),
-		.ast_skid_limit = __cpu_to_le32(TARGET_AST_SKID_LIMIT),
-		.tx_chain_mask = __cpu_to_le32(TARGET_TX_CHAIN_MASK),
-		.rx_chain_mask = __cpu_to_le32(TARGET_RX_CHAIN_MASK),
-		.rx_timeout_pri_vo = __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI),
-		.rx_timeout_pri_vi = __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI),
-		.rx_timeout_pri_be = __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI),
-		.rx_timeout_pri_bk = __cpu_to_le32(TARGET_RX_TIMEOUT_HI_PRI),
-		.rx_decap_mode = __cpu_to_le32(TARGET_RX_DECAP_MODE),
-		.scan_max_pending_reqs = __cpu_to_le32(TARGET_SCAN_MAX_PENDING_REQS),
-		.bmiss_offload_max_vdev = __cpu_to_le32(TARGET_BMISS_OFFLOAD_MAX_VDEV),
-		.roam_offload_max_vdev = __cpu_to_le32(TARGET_ROAM_OFFLOAD_MAX_VDEV),
-		.roam_offload_max_ap_profiles = __cpu_to_le32(TARGET_ROAM_OFFLOAD_MAX_AP_PROFILES),
-		.num_mcast_groups = __cpu_to_le32(TARGET_NUM_MCAST_GROUPS),
-		.num_mcast_table_elems = __cpu_to_le32(TARGET_NUM_MCAST_TABLE_ELEMS),
-		.mcast2ucast_mode = __cpu_to_le32(TARGET_MCAST2UCAST_MODE),
-		.tx_dbg_log_size = __cpu_to_le32(TARGET_TX_DBG_LOG_SIZE),
-		.num_wds_entries = __cpu_to_le32(TARGET_NUM_WDS_ENTRIES),
-		.dma_burst_size = __cpu_to_le32(TARGET_DMA_BURST_SIZE),
-		.mac_aggr_delim = __cpu_to_le32(TARGET_MAC_AGGR_DELIM),
-		.rx_skip_defrag_timeout_dup_detection_check = __cpu_to_le32(TARGET_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK),
-		.vow_config = __cpu_to_le32(TARGET_VOW_CONFIG),
-		.gtk_offload_max_vdev = __cpu_to_le32(TARGET_GTK_OFFLOAD_MAX_VDEV),
-		.num_msdu_desc = __cpu_to_le32(TARGET_NUM_MSDU_DESC),
-		.max_frag_entries = __cpu_to_le32(TARGET_MAX_FRAG_ENTRIES),
-	};
+	struct wmi_resource_config config = {};
+
+	config.num_vdevs = __cpu_to_le32(TARGET_NUM_VDEVS);
+	config.num_peers = __cpu_to_le32(TARGET_NUM_PEERS + TARGET_NUM_VDEVS);
+	config.num_offload_peers = __cpu_to_le32(TARGET_NUM_OFFLOAD_PEERS);
+
+	config.num_offload_reorder_bufs =
+		__cpu_to_le32(TARGET_NUM_OFFLOAD_REORDER_BUFS);
+
+	config.num_peer_keys = __cpu_to_le32(TARGET_NUM_PEER_KEYS);
+	config.num_tids = __cpu_to_le32(TARGET_NUM_TIDS);
+	config.ast_skid_limit = __cpu_to_le32(TARGET_AST_SKID_LIMIT);
+	config.tx_chain_mask = __cpu_to_le32(TARGET_TX_CHAIN_MASK);
+	config.rx_chain_mask = __cpu_to_le32(TARGET_RX_CHAIN_MASK);
+	config.rx_timeout_pri_vo = __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI);
+	config.rx_timeout_pri_vi = __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI);
+	config.rx_timeout_pri_be = __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI);
+	config.rx_timeout_pri_bk = __cpu_to_le32(TARGET_RX_TIMEOUT_HI_PRI);
+	config.rx_decap_mode = __cpu_to_le32(TARGET_RX_DECAP_MODE);
+
+	config.scan_max_pending_reqs =
+		__cpu_to_le32(TARGET_SCAN_MAX_PENDING_REQS);
+
+	config.bmiss_offload_max_vdev =
+		__cpu_to_le32(TARGET_BMISS_OFFLOAD_MAX_VDEV);
+
+	config.roam_offload_max_vdev =
+		__cpu_to_le32(TARGET_ROAM_OFFLOAD_MAX_VDEV);
+
+	config.roam_offload_max_ap_profiles =
+		__cpu_to_le32(TARGET_ROAM_OFFLOAD_MAX_AP_PROFILES);
+
+	config.num_mcast_groups = __cpu_to_le32(TARGET_NUM_MCAST_GROUPS);
+	config.num_mcast_table_elems =
+		__cpu_to_le32(TARGET_NUM_MCAST_TABLE_ELEMS);
+
+	config.mcast2ucast_mode = __cpu_to_le32(TARGET_MCAST2UCAST_MODE);
+	config.tx_dbg_log_size = __cpu_to_le32(TARGET_TX_DBG_LOG_SIZE);
+	config.num_wds_entries = __cpu_to_le32(TARGET_NUM_WDS_ENTRIES);
+	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);
+
+	config.vow_config = __cpu_to_le32(TARGET_VOW_CONFIG);
+
+	config.gtk_offload_max_vdev =
+		__cpu_to_le32(TARGET_GTK_OFFLOAD_MAX_VDEV);
+
+	config.num_msdu_desc = __cpu_to_le32(TARGET_NUM_MSDU_DESC);
+	config.max_frag_entries = __cpu_to_le32(TARGET_MAX_FRAG_ENTRIES);
 
 	buf = ath10k_wmi_alloc_skb(sizeof(*cmd));
 	if (!buf)
author
#16 lore raw

PATCH 16/27 ath10k: rename hif_ce_completion_state to ath10k_pci_compl

In reply to Kalle Valo

Makes few lines shorter at the same time.

---
 drivers/net/wireless/ath/ath10k/pci.c |   22 +++++++++++-----------
 drivers/net/wireless/ath/ath10k/pci.h |    2 +-
 2 files changed, 12 insertions(+), 12 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +11 -11
index 7eab49c..c973f6f 100644
@@ -485,9 +485,9 @@ void ath10k_do_pci_sleep(struct ath10k *ar)
  * FIXME: Handle OOM properly.
  */
 static inline
-struct hif_ce_completion_state *get_free_compl(struct hif_ce_pipe_info *pipe_info)
+struct ath10k_pci_compl *get_free_compl(struct hif_ce_pipe_info *pipe_info)
 {
-	struct hif_ce_completion_state *compl = NULL;
+	struct ath10k_pci_compl *compl = NULL;
 
 	spin_lock_bh(&pipe_info->pipe_lock);
 	if (list_empty(&pipe_info->compl_free)) {
@@ -495,7 +495,7 @@ struct hif_ce_completion_state *get_free_compl(struct hif_ce_pipe_info *pipe_inf
 		goto exit;
 	}
 	compl = list_first_entry(&pipe_info->compl_free,
-				 struct hif_ce_completion_state, list);
+				 struct ath10k_pci_compl, list);
 	list_del(&compl->list);
 exit:
 	spin_unlock_bh(&pipe_info->pipe_lock);
@@ -530,7 +530,7 @@ static void ath10k_pci_ce_send_done(struct ce_state *ce_state,
 	struct ath10k *ar = ce_state->ar;
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
 	struct hif_ce_pipe_info *pipe_info =  &ar_pci->pipe_info[ce_state->id];
-	struct hif_ce_completion_state *compl;
+	struct ath10k_pci_compl *compl;
 	bool process = false;
 
 	do {
@@ -592,7 +592,7 @@ static void ath10k_pci_ce_recv_data(struct ce_state *ce_state,
 	struct ath10k *ar = ce_state->ar;
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
 	struct hif_ce_pipe_info *pipe_info =  &ar_pci->pipe_info[ce_state->id];
-	struct hif_ce_completion_state *compl;
+	struct ath10k_pci_compl *compl;
 	struct sk_buff *skb;
 
 	do {
@@ -760,7 +760,7 @@ static void ath10k_pci_start_ce(struct ath10k *ar)
 	struct ce_state *ce_diag = ar_pci->ce_diag;
 	const struct ce_attr *attr;
 	struct hif_ce_pipe_info *pipe_info;
-	struct hif_ce_completion_state *compl;
+	struct ath10k_pci_compl *compl;
 	int i, pipe_num, completions;
 
 	spin_lock_init(&ar_pci->compl_lock);
@@ -797,7 +797,7 @@ static void ath10k_pci_start_ce(struct ath10k *ar)
 			continue;
 
 		for (i = 0; i < completions; i++) {
-			compl = kmalloc(sizeof(struct hif_ce_completion_state),
+			compl = kmalloc(sizeof(struct ath10k_pci_compl),
 					GFP_KERNEL);
 			if (!compl) {
 				ath10k_warn("No memory for completion state\n");
@@ -813,7 +813,7 @@ static void ath10k_pci_start_ce(struct ath10k *ar)
 static void ath10k_pci_stop_ce(struct ath10k *ar)
 {
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
-	struct hif_ce_completion_state *compl;
+	struct ath10k_pci_compl *compl;
 	struct sk_buff *skb;
 	int i;
 
@@ -838,7 +838,7 @@ static void ath10k_pci_stop_ce(struct ath10k *ar)
 static void ath10k_pci_cleanup_ce(struct ath10k *ar)
 {
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
-	struct hif_ce_completion_state *compl, *tmp;
+	struct ath10k_pci_compl *compl, *tmp;
 	struct hif_ce_pipe_info *pipe_info;
 	struct sk_buff *netbuf;
 	int pipe_num;
@@ -874,7 +874,7 @@ static void ath10k_pci_process_ce(struct ath10k *ar)
 {
 	struct ath10k_pci *ar_pci = ar->hif.priv;
 	struct ath10k_hif_cb *msg_callbacks = &ar_pci->msg_callbacks_current;
-	struct hif_ce_completion_state *compl;
+	struct ath10k_pci_compl *compl;
 	struct sk_buff *skb;
 	unsigned int nbytes;
 	int ret, send_done = 0;
@@ -886,7 +886,7 @@ static void ath10k_pci_process_ce(struct ath10k *ar)
 			break;
 		}
 		compl = list_first_entry(&ar_pci->compl_process,
-					 struct hif_ce_completion_state, list);
+					 struct ath10k_pci_compl, list);
 		list_del(&compl->list);
 		ar_pci->compl_processing = true;
 		spin_unlock_bh(&ar_pci->compl_lock);
drivers/net/wireless/ath/ath10k/pci.h +1 -1
index e78b861..e22f764 100644
@@ -43,7 +43,7 @@ struct bmi_xfer {
 	u32 resp_len;
 };
 
-struct hif_ce_completion_state {
+struct ath10k_pci_compl {
 	struct list_head list;
 	int send_or_recv;
 	struct ce_state *ce_state;
author
#17 lore raw

PATCH 17/27 ath10k: fix a long line in ath10k_pci_hif_dump_area()

In reply to Kalle Valo
---
 drivers/net/wireless/ath/ath10k/pci.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +5 -3
index c973f6f..f8ade52 100644
@@ -695,6 +695,7 @@ static void ath10k_pci_hif_dump_area(struct ath10k *ar)
 	u32 reg_dump_area = 0;
 	u32 reg_dump_values[REG_DUMP_COUNT_QCA988X];
 	u32 host_addr;
+	int ret;
 	u32 i;
 
 	host_addr = host_interest_item_address(HI_ITEM(hi_failure_state));
@@ -706,9 +707,10 @@ static void ath10k_pci_hif_dump_area(struct ath10k *ar)
 
 	ath10k_err("target register Dump Location: 0x%08X\n", reg_dump_area);
 
-	if (ath10k_pci_diag_read_mem(ar, reg_dump_area,
-				     &reg_dump_values[0],
-				     REG_DUMP_COUNT_QCA988X * sizeof(u32)) != 0) {
+	ret = ath10k_pci_diag_read_mem(ar, reg_dump_area,
+				       &reg_dump_values[0],
+				       REG_DUMP_COUNT_QCA988X * sizeof(u32));
+	if (ret != 0) {
 		ath10k_err("could not dump FW Dump Area\n");
 		return;
 	}
author
#18 lore raw

PATCH 18/27 ath10k: pci: rename pipe cleanup functions

In reply to Kalle Valo

Shorter lines that way.

---
 drivers/net/wireless/ath/ath10k/pci.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +4 -4
index f8ade52..76f44da 100644
@@ -1105,7 +1105,7 @@ static void ath10k_pci_hif_start(struct ath10k *ar)
 	ar_pci->started = 1;
 }
 
-static void ath10k_pci_recv_buffer_cleanup_on_pipe(struct hif_ce_pipe_info *pipe_info)
+static void ath10k_pci_rx_pipe_cleanup(struct hif_ce_pipe_info *pipe_info)
 {
 	struct ath10k *ar;
 	struct ath10k_pci *ar_pci;
@@ -1137,7 +1137,7 @@ static void ath10k_pci_recv_buffer_cleanup_on_pipe(struct hif_ce_pipe_info *pipe
 	}
 }
 
-static void ath10k_pci_send_buffer_cleanup_on_pipe(struct hif_ce_pipe_info *pipe_info)
+static void ath10k_pci_tx_pipe_cleanup(struct hif_ce_pipe_info *pipe_info)
 {
 	struct ath10k *ar;
 	struct ath10k_pci *ar_pci;
@@ -1192,8 +1192,8 @@ static void ath10k_pci_buffer_cleanup(struct ath10k *ar)
 		struct hif_ce_pipe_info *pipe_info;
 
 		pipe_info = &ar_pci->pipe_info[pipe_num];
-		ath10k_pci_recv_buffer_cleanup_on_pipe(pipe_info);
-		ath10k_pci_send_buffer_cleanup_on_pipe(pipe_info);
+		ath10k_pci_rx_pipe_cleanup(pipe_info);
+		ath10k_pci_tx_pipe_cleanup(pipe_info);
 	}
 }
 
author
#19 lore raw

PATCH 19/27 ath10k: pci: rename receive post buffer functions

In reply to Kalle Valo

To make lines shorter.

---
 drivers/net/wireless/ath/ath10k/pci.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +9 -9
index 76f44da..24ab76e 100644
@@ -49,8 +49,8 @@ static int ath10k_pci_diag_read_access(struct ath10k *ar, u32 address,
 				       u32 *data);
 
 static void ath10k_pci_process_ce(struct ath10k *ar);
-static int ath10k_pci_post_recv_buffers(struct ath10k *ar);
-static int ath10k_pci_post_recv_buffers_pipe(struct hif_ce_pipe_info *pipe_info,
+static int ath10k_pci_post_rx(struct ath10k *ar);
+static int ath10k_pci_post_rx_pipe(struct hif_ce_pipe_info *pipe_info,
 					     int num);
 
 static const struct ce_attr host_ce_config_wlan[] = {
@@ -899,7 +899,7 @@ static void ath10k_pci_process_ce(struct ath10k *ar)
 						     compl->transfer_id);
 			send_done = 1;
 		} else {
-			ret = ath10k_pci_post_recv_buffers_pipe(compl->pipe_info, 1);
+			ret = ath10k_pci_post_rx_pipe(compl->pipe_info, 1);
 			if (ret) {
 				ath10k_warn("Unable to post recv buffer for pipe: %d\n",
 					    compl->pipe_info->pipe_num);
@@ -1019,8 +1019,8 @@ static void ath10k_pci_hif_get_default_pipe(struct ath10k *ar,
 						 &dl_is_polled);
 }
 
-static int ath10k_pci_post_recv_buffers_pipe(struct hif_ce_pipe_info *pipe_info,
-					     int num)
+static int ath10k_pci_post_rx_pipe(struct hif_ce_pipe_info *pipe_info,
+				   int num)
 {
 	struct ath10k *ar = pipe_info->hif_ce_state;
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
@@ -1067,7 +1067,7 @@ static int ath10k_pci_post_recv_buffers_pipe(struct hif_ce_pipe_info *pipe_info,
 	return ret;
 }
 
-static int ath10k_pci_post_recv_buffers(struct ath10k *ar)
+static int ath10k_pci_post_rx(struct ath10k *ar)
 {
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
 	struct hif_ce_pipe_info *pipe_info;
@@ -1081,8 +1081,8 @@ static int ath10k_pci_post_recv_buffers(struct ath10k *ar)
 		if (attr->dest_nentries == 0)
 			continue;
 
-		ret = ath10k_pci_post_recv_buffers_pipe(pipe_info,
-							attr->dest_nentries - 1);
+		ret = ath10k_pci_post_rx_pipe(pipe_info,
+					      attr->dest_nentries - 1);
 		if (ret) {
 			ath10k_warn("Unable to replenish recv buffers for pipe: %d\n",
 				    pipe_num);
@@ -1101,7 +1101,7 @@ static void ath10k_pci_hif_start(struct ath10k *ar)
 	ath10k_pci_start_ce(ar);
 
 	/* Post buffers once to start things off. */
-	ret = ath10k_pci_post_recv_buffers(ar); /* FIXME: Handle error */
+	ret = ath10k_pci_post_rx(ar); /* FIXME: Handle error */
 	ar_pci->started = 1;
 }
 
author
#20 lore raw

PATCH 20/27 ath10k: rename msg_callbacks variable in ath10k_pci_process_ce()

In reply to Kalle Valo

Shorter lines that way.

---
 drivers/net/wireless/ath/ath10k/pci.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +6 -6
index 24ab76e..cb2e88e 100644
@@ -875,7 +875,7 @@ static void ath10k_pci_cleanup_ce(struct ath10k *ar)
 static void ath10k_pci_process_ce(struct ath10k *ar)
 {
 	struct ath10k_pci *ar_pci = ar->hif.priv;
-	struct ath10k_hif_cb *msg_callbacks = &ar_pci->msg_callbacks_current;
+	struct ath10k_hif_cb *cb = &ar_pci->msg_callbacks_current;
 	struct ath10k_pci_compl *compl;
 	struct sk_buff *skb;
 	unsigned int nbytes;
@@ -894,9 +894,9 @@ static void ath10k_pci_process_ce(struct ath10k *ar)
 		spin_unlock_bh(&ar_pci->compl_lock);
 
 		if (compl->send_or_recv == HIF_CE_COMPLETE_SEND) {
-			msg_callbacks->tx_completion_handler(ar,
-						     compl->transfer_context,
-						     compl->transfer_id);
+			cb->tx_completion_handler(ar,
+						  compl->transfer_context,
+						  compl->transfer_id);
 			send_done = 1;
 		} else {
 			ret = ath10k_pci_post_rx_pipe(compl->pipe_info, 1);
@@ -918,8 +918,8 @@ static void ath10k_pci_process_ce(struct ath10k *ar)
 			if (skb->len + skb_tailroom(skb) >= nbytes) {
 				skb_trim(skb, 0);
 				skb_put(skb, nbytes);
-				msg_callbacks->rx_completion_handler(ar, skb,
-								     compl->pipe_info->pipe_num);
+				cb->rx_completion_handler(ar, skb,
+							  compl->pipe_info->pipe_num);
 			} else {
 				ath10k_warn("%s: rxed more than expected (nbytes %d, max %d)",
 					   __func__, nbytes,
author
#21 lore raw

PATCH 21/27 ath10k: rename struct ath10k_hif_cb field names

In reply to Kalle Valo

Shorter lines that way.

---
 drivers/net/wireless/ath/ath10k/hif.h |   12 ++++++------
 drivers/net/wireless/ath/ath10k/htc.c |    4 ++--
 drivers/net/wireless/ath/ath10k/pci.c |   15 ++++++++-------
 3 files changed, 16 insertions(+), 15 deletions(-)
drivers/net/wireless/ath/ath10k/hif.h +6 -6
index a5e6422..6983a0c 100644
@@ -22,12 +22,12 @@
 #include "core.h"
 
 struct ath10k_hif_cb {
-	int (*tx_completion_handler)(struct ath10k *ar,
-				     struct sk_buff *wbuf,
-				      unsigned transfer_id);
-	int (*rx_completion_handler)(struct ath10k *ar,
-				     struct sk_buff *wbuf,
-				     u8 pipe_id);
+	int (*tx_completion)(struct ath10k *ar,
+			     struct sk_buff *wbuf,
+			     unsigned transfer_id);
+	int (*rx_completion)(struct ath10k *ar,
+			     struct sk_buff *wbuf,
+			     u8 pipe_id);
 };
 
 struct ath10k_hif_ops {
drivers/net/wireless/ath/ath10k/htc.c +2 -2
index 42106ef..666b1fb 100644
@@ -1023,8 +1023,8 @@ struct ath10k_htc *ath10k_htc_create(struct ath10k *ar,
 	ath10k_htc_reset_endpoint_states(htc);
 
 	/* setup HIF layer callbacks */
-	htc_callbacks.rx_completion_handler = ath10k_htc_rx_completion_handler;
-	htc_callbacks.tx_completion_handler = ath10k_htc_tx_completion_handler;
+	htc_callbacks.rx_completion = ath10k_htc_rx_completion_handler;
+	htc_callbacks.tx_completion = ath10k_htc_tx_completion_handler;
 	htc->ar = ar;
 
 	/* Get HIF default pipe for HTC message exchange */
drivers/net/wireless/ath/ath10k/pci.c +8 -7
index cb2e88e..a7315ca 100644
@@ -894,9 +894,9 @@ static void ath10k_pci_process_ce(struct ath10k *ar)
 		spin_unlock_bh(&ar_pci->compl_lock);
 
 		if (compl->send_or_recv == HIF_CE_COMPLETE_SEND) {
-			cb->tx_completion_handler(ar,
-						  compl->transfer_context,
-						  compl->transfer_id);
+			cb->tx_completion(ar,
+					  compl->transfer_context,
+					  compl->transfer_id);
 			send_done = 1;
 		} else {
 			ret = ath10k_pci_post_rx_pipe(compl->pipe_info, 1);
@@ -918,8 +918,8 @@ static void ath10k_pci_process_ce(struct ath10k *ar)
 			if (skb->len + skb_tailroom(skb) >= nbytes) {
 				skb_trim(skb, 0);
 				skb_put(skb, nbytes);
-				cb->rx_completion_handler(ar, skb,
-							  compl->pipe_info->pipe_num);
+				cb->rx_completion(ar, skb,
+						  compl->pipe_info->pipe_num);
 			} else {
 				ath10k_warn("%s: rxed more than expected (nbytes %d, max %d)",
 					   __func__, nbytes,
@@ -1170,8 +1170,9 @@ static void ath10k_pci_tx_pipe_cleanup(struct hif_ce_pipe_info *pipe_info)
 			 * the buffer
 			 */
 			ATH10K_SKB_CB(netbuf)->is_aborted = true;
-			ar_pci->msg_callbacks_current.tx_completion_handler(
-							ar, netbuf, id);
+			ar_pci->msg_callbacks_current.tx_completion(ar,
+								    netbuf,
+								    id);
 	}
 }
 
author
#22 lore raw

PATCH 22/27 ath10k: simplify arg variable initialisation in ath10k_vdev_start()

In reply to Kalle Valo

Shorter lines that way.

---
 drivers/net/wireless/ath/ath10k/mac.c |   36 ++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 16 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +20 -16
index 3192c33..de1bde6 100644
@@ -371,28 +371,32 @@ static int ath10k_vdev_start(struct ath10k_vif *arvif)
 	struct ath10k *ar = arvif->ar;
 	struct ieee80211_conf *conf = &ar->hw->conf;
 	struct ieee80211_channel *channel = conf->chandef.chan;
-	struct wmi_vdev_start_request_arg arg = {
-		.vdev_id = arvif->vdev_id,
-		.channel = {
-			.freq = channel->center_freq,
-			.band_center_freq1 = band_center_freq(channel,
-							      cfg80211_get_chandef_type(&conf->chandef)),
-			.mode = chan_to_phymode(channel,
-						cfg80211_get_chandef_type(&conf->chandef)),
-			.min_power = channel->max_power * 3,
-			.max_power = channel->max_power * 4,
-			.max_reg_power = channel->max_reg_power * 4,
-			.max_antenna_gain = channel->max_antenna_gain,
-		},
-		.bcn_intval = arvif->beacon_interval,
-		.dtim_period = arvif->dtim_period,
-	};
+	struct wmi_vdev_start_request_arg arg = {};
 	int ret = 0;
 
 	lockdep_assert_held(&ar->conf_mutex);
 
 	INIT_COMPLETION(ar->vdev_setup_done);
 
+	arg.vdev_id = arvif->vdev_id;
+	arg.dtim_period = arvif->dtim_period;
+	arg.bcn_intval = arvif->beacon_interval;
+
+	arg.channel.freq = channel->center_freq;
+
+	arg.channel.band_center_freq1 =
+		band_center_freq(channel,
+				 cfg80211_get_chandef_type(&conf->chandef));
+
+	arg.channel.mode =
+		chan_to_phymode(channel,
+				cfg80211_get_chandef_type(&conf->chandef));
+
+	arg.channel.min_power = channel->max_power * 3;
+	arg.channel.max_power = channel->max_power * 4;
+	arg.channel.max_reg_power = channel->max_reg_power * 4;
+	arg.channel.max_antenna_gain = channel->max_antenna_gain;
+
 	if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
 		arg.ssid = arvif->u.ap.ssid;
 		arg.ssid_len = arvif->u.ap.ssid_len;
author
#23 lore raw

PATCH 23/27 ath10k: simplify arg variable initialisation in ath10k_monitor_start()

In reply to Kalle Valo

Shorter lines that way.

---
 drivers/net/wireless/ath/ath10k/mac.c |   33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +17 -16
index de1bde6..bd74c84 100644
@@ -448,26 +448,27 @@ static int ath10k_vdev_stop(struct ath10k_vif *arvif)
 static int ath10k_monitor_start(struct ath10k *ar, int vdev_id)
 {
 	struct ieee80211_channel *channel = ar->hw->conf.chandef.chan;
-	struct wmi_vdev_start_request_arg arg = {
-		.vdev_id = vdev_id,
-		.channel = {
-			.freq = channel->center_freq,
-			.band_center_freq1 = band_center_freq(channel,
-							      cfg80211_get_chandef_type(&ar->hw->conf.chandef)),
-			/* TODO setup this dynamically, what in case we
-			   don't have any vifs? */
-			.mode = chan_to_phymode(channel,
-						cfg80211_get_chandef_type(&ar->hw->conf.chandef)),
-			.min_power = channel->max_power * 3,
-			.max_power = channel->max_power * 4,
-			.max_reg_power = channel->max_reg_power * 4,
-			.max_antenna_gain = channel->max_antenna_gain,
-		},
-	};
+	struct wmi_vdev_start_request_arg arg = {};
+	enum nl80211_channel_type type;
 	int ret = 0;
 
 	lockdep_assert_held(&ar->conf_mutex);
 
+	type = cfg80211_get_chandef_type(&ar->hw->conf.chandef);
+
+	arg.vdev_id = vdev_id;
+	arg.channel.freq = channel->center_freq;
+	arg.channel.band_center_freq1 = band_center_freq(channel, type);
+
+	/* TODO setup this dynamically, what in case we
+	   don't have any vifs? */
+	arg.channel.mode = chan_to_phymode(channel,type);
+
+	arg.channel.min_power = channel->max_power * 3;
+	arg.channel.max_power = channel->max_power * 4;
+	arg.channel.max_reg_power = channel->max_reg_power * 4;
+	arg.channel.max_antenna_gain = channel->max_antenna_gain;
+
 	ret = ath10k_wmi_vdev_start(ar, &arg);
 	if (ret) {
 		ath10k_warn("Monitor vdev start failed: ret %d\n", ret);
author
#24 lore raw

PATCH 24/27 ath10k: fix long lines in ath10k_config_ps_iter()

In reply to Kalle Valo

Makes checkpatch happy.

---
 drivers/net/wireless/ath/ath10k/mac.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +11 -5
index bd74c84..6d65511 100644
@@ -667,22 +667,28 @@ static void ath10k_config_ps_iter(void *data, u8 *mac,
 	struct ath10k_generic_iter *ar_iter = data;
 	struct ieee80211_conf *conf = &ar_iter->ar->hw->conf;
 	struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+	enum wmi_sta_powersave_param param;
 	enum wmi_sta_ps_mode psmode;
+	int ret;
 
 	if (vif->type != NL80211_IFTYPE_STATION)
 		return;
 
 	if (conf->flags & IEEE80211_CONF_PS) {
 		psmode = WMI_STA_PS_MODE_ENABLED;
-		ar_iter->ret = ath10k_wmi_set_sta_ps_param(ar_iter->ar,
-							   arvif->vdev_id,
-							   WMI_STA_PS_PARAM_INACTIVITY_TIME,
-							   conf->dynamic_ps_timeout);
-		if (ar_iter->ret) {
+		param = WMI_STA_PS_PARAM_INACTIVITY_TIME;
+
+		ret = ath10k_wmi_set_sta_ps_param(ar_iter->ar,
+						  arvif->vdev_id,
+						  param,
+						  conf->dynamic_ps_timeout);
+		if (ret) {
 			ath10k_warn("Failed to set inactivity time for VDEV: %d\n",
 				    arvif->vdev_id);
 			return;
 		}
+
+		ar_iter->ret = ret;
 	} else
 		psmode = WMI_STA_PS_MODE_DISABLED;
 
author
#25 lore raw

PATCH 25/27 ath10k: use min_t() instead of min()

In reply to Kalle Valo

Checkpatch warned about this.

---
 drivers/net/wireless/ath/ath10k/bmi.c    |    2 +-
 drivers/net/wireless/ath/ath10k/htc.c    |    4 +++-
 drivers/net/wireless/ath/ath10k/htt_tx.c |    2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/bmi.c +1 -1
index c524208..1a2ef51 100644
@@ -96,7 +96,7 @@ int ath10k_bmi_read_memory(struct ath10k *ar,
 		   __func__, ar, address, length);
 
 	while (length) {
-		rxlen = min(length, (u32)BMI_MAX_DATA_SIZE);
+		rxlen = min_t(u32, length, BMI_MAX_DATA_SIZE);
 
 		cmd.id            = __cpu_to_le32(BMI_READ_MEMORY);
 		cmd.read_mem.addr = __cpu_to_le32(address);
drivers/net/wireless/ath/ath10k/htc.c +3 -1
index 666b1fb..791d648 100644
@@ -578,7 +578,9 @@ static int ath10k_htc_rx_completion_handler(struct ath10k *ar,
 			}
 
 			htc->control_resp_len =
-			    min((int)skb->len, ATH10K_HTC_MAX_CTRL_MSG_LEN);
+				min_t(int, skb->len,
+				      ATH10K_HTC_MAX_CTRL_MSG_LEN);
+
 			memcpy(htc->control_resp_buffer, skb->data,
 			       htc->control_resp_len);
 
drivers/net/wireless/ath/ath10k/htt_tx.c +1 -1
index f94f979..c880705 100644
@@ -269,7 +269,7 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
 	cmd->mgmt_tx.desc_id    = __cpu_to_le32(msdu_id);
 	cmd->mgmt_tx.vdev_id    = __cpu_to_le32(vdev_id);
 	memcpy(cmd->mgmt_tx.hdr, msdu->data,
-	       min((int)msdu->len, HTT_MGMT_FRM_HDR_DOWNLOAD_LEN));
+	       min_t(int, msdu->len, HTT_MGMT_FRM_HDR_DOWNLOAD_LEN));
 
 	/* refcount is decremented by HTC and HTT completions until it reaches
 	 * zero and is freed */
author
#26 lore raw

PATCH 26/27 ath10k: whitespace fixes found by checkpatch

In reply to Kalle Valo
---
 drivers/net/wireless/ath/ath10k/ce.h  |    3 ++-
 drivers/net/wireless/ath/ath10k/htc.c |    2 +-
 drivers/net/wireless/ath/ath10k/mac.c |    2 +-
 drivers/net/wireless/ath/ath10k/pci.c |    4 ++--
 4 files changed, 6 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath10k/ce.h +2 -1
index 11948a6..a6c97ac 100644
@@ -473,7 +473,8 @@ struct ce_attr {
 #define DST_WATERMARK_ADDRESS			0x0050
 
 
-static inline u32 ath10k_ce_base_address(unsigned int ce_id) {
+static inline u32 ath10k_ce_base_address(unsigned int ce_id)
+{
 	return CE0_BASE_ADDRESS + (CE1_BASE_ADDRESS - CE0_BASE_ADDRESS) * ce_id;
 }
 
drivers/net/wireless/ath/ath10k/htc.c +1 -1
index 791d648..518e061 100644
@@ -618,7 +618,7 @@ static void ath10k_htc_control_rx_complete(struct ath10k *ar,
 
 static const char *htc_service_name(enum ath10k_htc_svc_id id)
 {
-	switch(id) {
+	switch (id) {
 	case ATH10K_HTC_SVC_ID_RESERVED:
 		return "Reserved";
 	case ATH10K_HTC_SVC_ID_RSVD_CTRL:
drivers/net/wireless/ath/ath10k/mac.c +1 -1
index 6d65511..a69d0dd 100644
@@ -462,7 +462,7 @@ static int ath10k_monitor_start(struct ath10k *ar, int vdev_id)
 
 	/* TODO setup this dynamically, what in case we
 	   don't have any vifs? */
-	arg.channel.mode = chan_to_phymode(channel,type);
+	arg.channel.mode = chan_to_phymode(channel, type);
 
 	arg.channel.min_power = channel->max_power * 3;
 	arg.channel.max_power = channel->max_power * 4;
drivers/net/wireless/ath/ath10k/pci.c +2 -2
index a7315ca..266570d 100644
@@ -922,8 +922,8 @@ static void ath10k_pci_process_ce(struct ath10k *ar)
 						  compl->pipe_info->pipe_num);
 			} else {
 				ath10k_warn("%s: rxed more than expected (nbytes %d, max %d)",
-					   __func__, nbytes,
-					   skb->len + skb_tailroom(skb));
+					    __func__, nbytes,
+					    skb->len + skb_tailroom(skb));
 			}
 		}
 
author
#27 lore raw

PATCH 27/27 ath10k: remove multiple assignments

In reply to Kalle Valo

checkpatch warns about these.

---
 drivers/net/wireless/ath/ath10k/ce.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath10k/ce.c +9 -4
index d439181..b9c1f21 100644
@@ -942,14 +942,17 @@ static int ath10k_ce_init_src_ring(struct ath10k *ar,
 	if (ptr == NULL)
 		return -ENOMEM;
 
-	src_ring = ce_state->src_ring =	(struct ce_ring_state *)ptr;
+	ce_state->src_ring = (struct ce_ring_state *)ptr;
+	src_ring = ce_state->src_ring;
+
 	ptr += sizeof(struct ce_ring_state);
 	src_ring->nentries = nentries;
 	src_ring->nentries_mask = nentries - 1;
 
 	ath10k_pci_wake(ar);
-	src_ring->hw_index = src_ring->sw_index =
-		ath10k_ce_src_ring_read_index_get(ar, ctrl_addr);
+	src_ring->sw_index = ath10k_ce_src_ring_read_index_get(ar, ctrl_addr);
+	src_ring->hw_index = src_ring->sw_index;
+
 	src_ring->write_index =
 		ath10k_ce_src_ring_write_index_get(ar, ctrl_addr);
 	ath10k_pci_sleep(ar);
@@ -1024,7 +1027,9 @@ static int ath10k_ce_init_dest_ring(struct ath10k *ar,
 	if (ptr == NULL)
 		return -ENOMEM;
 
-	dest_ring = ce_state->dest_ring = (struct ce_ring_state *)ptr;
+	ce_state->dest_ring = (struct ce_ring_state *)ptr;
+	dest_ring = ce_state->dest_ring;
+
 	ptr += sizeof(struct ce_ring_state);
 	dest_ring->nentries = nentries;
 	dest_ring->nentries_mask = nentries - 1;
author Applied
#28 lore raw

cover ath10k: checkpatch fixes 20130430

In reply to Kalle Valo
Quoted 33 lines · Kalle Valo

And here I'm breaking my own rule, sending over a double of the max 12 patches limit! :)

But I have a good excuse. I noticed that checkpatch warnings were rising again, even though I have been trying to tackle them. Now I was able to reduce them to 25 warnings and it's now easier for me to follow them. That's why I want to apply these ASAP.

Please review.

---

Kalle Valo (27):
ath10k: fix new warning in ath10k_push_board_ext_data()
ath10k: fix long line in ath10k_htt_htc_attach()
ath10k: fix long line in ath10k_read_wmi_services()
ath10k: simple long line fixes
ath10k: fix long lines related htd credit reporting
ath10k: fix long lines in htc.c
ath10k: get rid of unnecessary else branch
ath10k: fix long lines in htt_rx.c
ath10k: fix comment style in htt.h
ath10k: fix long lines in ce.c
ath10k: rename WMI_CMD_GRP_START_ID()
ath10k: rename struct wmi_p2p_noa_info::noa_descriptors
ath10k: shorten ath10k_wmi_pdev_set_wmm_params() declaration
ath10k: fix few long lines in wmi.c
ath10k: change config initialisation in ath10k_wmi_cmd_init()
ath10k: rename hif_ce_completion_state to ath10k_pci_compl
ath10k: fix a long line in ath10k_pci_hif_dump_area()
ath10k: pci: rename pipe cleanup functions
ath10k: pci: rename receive post buffer functions

Quoted 8 lines

ath10k: rename msg_callbacks variable in ath10k_pci_process_ce()
ath10k: rename struct ath10k_hif_cb field names
ath10k: simplify arg variable initialisation in ath10k_vdev_start()
ath10k: simplify arg variable initialisation in ath10k_monitor_start()
ath10k: fix long lines in ath10k_config_ps_iter()
ath10k: use min_t() instead of min()
ath10k: whitespace fixes found by checkpatch
ath10k: remove multiple assignments

Applied. If there are any issues with the patches please let me know and I'll send a followup patch.

Signature · 1 line
Kalle Valo