Skip to contentSkip to conversation

staging: wilc1000: Fix line over 80 characters long

PATCH In review Anchal Jain 2 participants 4 messages Feb 17, 2016 1 message not in the archive Staging

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/2 staging: wilc1000: Fix line over 80 characters long

Break lines so that they do not exceed 80
characters. Problem found using checkpatch.

---
 drivers/staging/wilc1000/wilc_wlan.c | 45 +++++++++++++++++++++++++-----------
 1 file changed, 31 insertions(+), 14 deletions(-)
drivers/staging/wilc1000/wilc_wlan.c +31 -14
index 98b21d4..a611cba 100644
@@ -200,7 +200,8 @@ static inline int add_tcp_pending_ack(u32 ack, u32 session_index,
 	if (pending_base + pending_acks < MAX_PENDING_ACKS) {
 		pending_acks_info[pending_base + pending_acks].ack_num = ack;
 		pending_acks_info[pending_base + pending_acks].txqe = txqe;
-		pending_acks_info[pending_base + pending_acks].session_index = session_index;
+		pending_acks_info[pending_base + pending_acks].session_index =
+			session_index;
 		txqe->tcp_pending_ack_idx = pending_base + pending_acks;
 		pending_acks++;
 	}
@@ -256,7 +257,8 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
 
 				for (i = 0; i < tcp_session; i++) {
 					if (i < 2 * MAX_TCP_SESSION &&
-					    ack_session_info[i].seq_num == seq_no) {
+					    ack_session_info[i].seq_num ==
+						seq_no) {
 						update_tcp_session(i, ack_no);
 						break;
 					}
@@ -513,7 +515,8 @@ void chip_wakeup(struct wilc *wilc)
 				if ((wilc_get_chipid(wilc, true) == 0))
 					wilc_debug(N_ERR, "Couldn't read chip id. Wake up failed\n");
 
-			} while ((wilc_get_chipid(wilc, true) == 0) && ((++trials % 3) == 0));
+			} while ((wilc_get_chipid(wilc, true) == 0) &&
+				 ((++trials % 3) == 0));
 
 		} while (wilc_get_chipid(wilc, true) == 0);
 	} else if ((wilc->io_type & 0x1) == HIF_SDIO)	 {
@@ -526,7 +529,8 @@ void chip_wakeup(struct wilc *wilc)
 			wilc->hif_func->hif_read_reg(wilc, 0xf1,
 						     &clk_status_reg);
 
-			while (((clk_status_reg & 0x1) == 0) && (((++trials) % 3) == 0)) {
+			while (((clk_status_reg & 0x1) == 0) &&
+				(((++trials) % 3) == 0)) {
 				usleep_range(2 * 1000, 2 * 1000);
 
 				wilc->hif_func->hif_read_reg(wilc, 0xf1,
@@ -672,7 +676,8 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				counter++;
 				if (counter > 200) {
 					counter = 0;
-					ret = wilc->hif_func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, 0);
+					ret = wilc->hif_func->hif_write_reg(
+						wilc, WILC_HOST_TX_CTRL, 0);
 					break;
 				}
 			}
@@ -683,7 +688,9 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 
 		timeout = 200;
 		do {
-			ret = wilc->hif_func->hif_block_tx(wilc, WILC_VMM_TBL_RX_SHADOW_BASE, (u8 *)vmm_table, ((i + 1) * 4));
+			ret = wilc->hif_func->hif_block_tx(wilc,
+					WILC_VMM_TBL_RX_SHADOW_BASE,
+					(u8 *)vmm_table, ((i + 1) * 4));
 			if (!ret)
 				break;
 
@@ -694,7 +701,8 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				break;
 
 			do {
-				ret = wilc->hif_func->hif_read_reg(wilc, WILC_HOST_VMM_CTL, &reg);
+				ret = wilc->hif_func->hif_read_reg(wilc,
+						WILC_HOST_VMM_CTL, &reg);
 				if (!ret)
 					break;
 				if ((reg >> 2) & 0x1) {
@@ -705,7 +713,8 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				}
 			} while (--timeout);
 			if (timeout <= 0) {
-				ret = wilc->hif_func->hif_write_reg(wilc, WILC_HOST_VMM_CTL, 0x0);
+				ret = wilc->hif_func->hif_write_reg(wilc,
+						WILC_HOST_VMM_CTL, 0x0);
 				break;
 			}
 
@@ -713,11 +722,13 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				break;
 
 			if (entries == 0) {
-				ret = wilc->hif_func->hif_read_reg(wilc, WILC_HOST_TX_CTRL, &reg);
+				ret = wilc->hif_func->hif_read_reg(wilc,
+						WILC_HOST_TX_CTRL, &reg);
 				if (!ret)
 					break;
 				reg &= ~BIT(0);
-				ret = wilc->hif_func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, reg);
+				ret = wilc->hif_func->hif_write_reg(wilc,
+						WILC_HOST_TX_CTRL, reg);
 				if (!ret)
 					break;
 				break;
@@ -757,9 +768,12 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				header = cpu_to_le32(header);
 				memcpy(&txb[offset], &header, 4);
 				if (tqe->type == WILC_CFG_PKT) {
-					buffer_offset = ETH_CONFIG_PKT_HDR_OFFSET;
+					buffer_offset =
+						ETH_CONFIG_PKT_HDR_OFFSET;
 				} else if (tqe->type == WILC_NET_PKT) {
-					char *bssid = ((struct tx_complete_data *)(tqe->priv))->bssid;
+					char *bssid =
+						((struct tx_complete_data *)
+						 (tqe->priv))->bssid;
 
 					buffer_offset = ETH_ETHERNET_HDR_OFFSET;
 					memcpy(&txb[offset + 4], bssid, 6);
@@ -853,7 +867,8 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
 						IS_MANAGMEMENT_CALLBACK |
 						IS_MGMT_STATUS_SUCCES);
 
-				WILC_WFI_mgmt_rx(wilc, &buffer[offset + HOST_HDR_OFFSET], pkt_len);
+				WILC_WFI_mgmt_rx(wilc,
+				&buffer[offset + HOST_HDR_OFFSET], pkt_len);
 			} else {
 				if (!is_cfg_packet) {
 					if (pkt_len > 0) {
@@ -865,7 +880,9 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
 				} else {
 					struct wilc_cfg_rsp rsp;
 
-					wilc_wlan_cfg_indicate_rx(wilc, &buffer[pkt_offset + offset], pkt_len, &rsp);
+					wilc_wlan_cfg_indicate_rx(wilc,
+					&buffer[pkt_offset + offset],
+							pkt_len, &rsp);
 					if (rsp.type == WILC_CFG_RSP) {
 						if (wilc->cfg_seq_no == rsp.seq_no)
 							up(&wilc->cfg_event);
Signature · 1 line
1.9.1
#2 lore raw
Quoted 125 lines · Anchal Jain

Break lines so that they do not exceed 80
characters. Problem found using checkpatch.

---
 drivers/staging/wilc1000/wilc_wlan.c | 45 +++++++++++++++++++++++++-----------
 1 file changed, 31 insertions(+), 14 deletions(-)
drivers/staging/wilc1000/wilc_wlan.c +26 -12
index 98b21d4..a611cba 100644
@@ -200,7 +200,8 @@ static inline int add_tcp_pending_ack(u32 ack, u32 session_index,
 	if (pending_base + pending_acks < MAX_PENDING_ACKS) {
 		pending_acks_info[pending_base + pending_acks].ack_num = ack;
 		pending_acks_info[pending_base + pending_acks].txqe = txqe;
-		pending_acks_info[pending_base + pending_acks].session_index = session_index;
+		pending_acks_info[pending_base + pending_acks].session_index =
+			session_index;
 		txqe->tcp_pending_ack_idx = pending_base + pending_acks;
 		pending_acks++;
 	}
@@ -256,7 +257,8 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
 
 				for (i = 0; i < tcp_session; i++) {
 					if (i < 2 * MAX_TCP_SESSION &&
-					    ack_session_info[i].seq_num == seq_no) {
+					    ack_session_info[i].seq_num ==
+						seq_no) {
 						update_tcp_session(i, ack_no);
 						break;
 					}
@@ -513,7 +515,8 @@ void chip_wakeup(struct wilc *wilc)
 				if ((wilc_get_chipid(wilc, true) == 0))
 					wilc_debug(N_ERR, "Couldn't read chip id. Wake up failed\n");
 
-			} while ((wilc_get_chipid(wilc, true) == 0) && ((++trials % 3) == 0));
+			} while ((wilc_get_chipid(wilc, true) == 0) &&
+				 ((++trials % 3) == 0));
 
 		} while (wilc_get_chipid(wilc, true) == 0);
 	} else if ((wilc->io_type & 0x1) == HIF_SDIO)	 {
@@ -526,7 +529,8 @@ void chip_wakeup(struct wilc *wilc)
 			wilc->hif_func->hif_read_reg(wilc, 0xf1,
 						     &clk_status_reg);
 
-			while (((clk_status_reg & 0x1) == 0) && (((++trials) % 3) == 0)) {
+			while (((clk_status_reg & 0x1) == 0) &&
+				(((++trials) % 3) == 0)) {
 				usleep_range(2 * 1000, 2 * 1000);
 
 				wilc->hif_func->hif_read_reg(wilc, 0xf1,
@@ -672,7 +676,8 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				counter++;
 				if (counter > 200) {
 					counter = 0;
-					ret = wilc->hif_func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, 0);
+					ret = wilc->hif_func->hif_write_reg(
+						wilc, WILC_HOST_TX_CTRL, 0);
 					break;
 				}
 			}
@@ -683,7 +688,9 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 
 		timeout = 200;
 		do {
-			ret = wilc->hif_func->hif_block_tx(wilc, WILC_VMM_TBL_RX_SHADOW_BASE, (u8 *)vmm_table, ((i + 1) * 4));
+			ret = wilc->hif_func->hif_block_tx(wilc,
+					WILC_VMM_TBL_RX_SHADOW_BASE,
+					(u8 *)vmm_table, ((i + 1) * 4));
 			if (!ret)
 				break;
 
@@ -694,7 +701,8 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				break;
 
 			do {
-				ret = wilc->hif_func->hif_read_reg(wilc, WILC_HOST_VMM_CTL, &reg);
+				ret = wilc->hif_func->hif_read_reg(wilc,
+						WILC_HOST_VMM_CTL, &reg);
 				if (!ret)
 					break;
 				if ((reg >> 2) & 0x1) {
@@ -705,7 +713,8 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				}
 			} while (--timeout);
 			if (timeout <= 0) {
-				ret = wilc->hif_func->hif_write_reg(wilc, WILC_HOST_VMM_CTL, 0x0);
+				ret = wilc->hif_func->hif_write_reg(wilc,
+						WILC_HOST_VMM_CTL, 0x0);
 				break;
 			}
 
@@ -713,11 +722,13 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				break;
 
 			if (entries == 0) {
-				ret = wilc->hif_func->hif_read_reg(wilc, WILC_HOST_TX_CTRL, &reg);
+				ret = wilc->hif_func->hif_read_reg(wilc,
+						WILC_HOST_TX_CTRL, &reg);
 				if (!ret)
 					break;
 				reg &= ~BIT(0);
-				ret = wilc->hif_func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, reg);
+				ret = wilc->hif_func->hif_write_reg(wilc,
+						WILC_HOST_TX_CTRL, reg);
 				if (!ret)
 					break;
 				break;
@@ -757,9 +768,12 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				header = cpu_to_le32(header);
 				memcpy(&txb[offset], &header, 4);
 				if (tqe->type == WILC_CFG_PKT) {
-					buffer_offset = ETH_CONFIG_PKT_HDR_OFFSET;
+					buffer_offset =
+						ETH_CONFIG_PKT_HDR_OFFSET;
 				} else if (tqe->type == WILC_NET_PKT) {
-					char *bssid = ((struct tx_complete_data *)(tqe->priv))->bssid;
+					char *bssid =
+						((struct tx_complete_data *)
+						 (tqe->priv))->bssid;
 
 					buffer_offset = ETH_ETHERNET_HDR_OFFSET;
 					memcpy(&txb[offset + 4], bssid, 6);

drivers/staging/wilc1000/wilc_wlan.c static void wilc_wlan_handle_rxq(struct wilc *wilc) · line 871

Quoted 6 lines
drivers/staging/wilc1000/wilc_wlan.c +2 -1
@@ -853,7 +867,8 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
 						IS_MANAGMEMENT_CALLBACK |
 						IS_MGMT_STATUS_SUCCES);
 
-				WILC_WFI_mgmt_rx(wilc, &buffer[offset + HOST_HDR_OFFSET], pkt_len);
+				WILC_WFI_mgmt_rx(wilc,
+				&buffer[offset + HOST_HDR_OFFSET], pkt_len);

The argument list needs to be indented as compared o the function name.

drivers/staging/wilc1000/wilc_wlan.c static void wilc_wlan_handle_rxq(struct wilc *wilc) · line 885

Quoted 11 lines
drivers/staging/wilc1000/wilc_wlan.c +3 -1
 			} else {
 				if (!is_cfg_packet) {
 					if (pkt_len > 0) {
@@ -865,7 +880,9 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc)
 				} else {
 					struct wilc_cfg_rsp rsp;
 
-					wilc_wlan_cfg_indicate_rx(wilc, &buffer[pkt_offset + offset], pkt_len, &rsp);
+					wilc_wlan_cfg_indicate_rx(wilc,
+					&buffer[pkt_offset + offset],
+							pkt_len, &rsp);

All argument lines need to be indented the same amount.

julia

Quoted 7 lines
drivers/staging/wilc1000/wilc_wlan.c +0 -1
 					if (rsp.type == WILC_CFG_RSP) {
 						if (wilc->cfg_seq_no == rsp.seq_no)
 							up(&wilc->cfg_event);
--

1.9.1

#3 lore raw

PATCH 2/2 staging: wilc1000: Fix line over 80 characters

In reply to a message not in the archive

Add local variables so that they do not exceed 80
characters. Problem found using checkpatch.

---
 drivers/staging/wilc1000/wilc_wlan.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/staging/wilc1000/wilc_wlan.c +7 -4
index a611cba..a272199 100644
@@ -285,6 +285,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
 	struct wilc *wilc;
 	u32 i = 0;
 	u32 dropped = 0;
+	u32 session = pending_acks_info[MAX_PENDING_ACKS].session_index;
 
 	vif = netdev_priv(dev);
 	wilc = vif->wilc;
@@ -294,7 +295,8 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
 		if (i >= MAX_PENDING_ACKS ||
 		    pending_acks_info[i].session_index >= 2 * MAX_TCP_SESSION)
 			break;
-		if (pending_acks_info[i].ack_num < ack_session_info[pending_acks_info[i].session_index].bigger_ack_num) {
+		if (pending_acks_info[i].ack_num <
+			Ack_session_info[session].bigger_ack_num) {
 			struct txq_entry_t *tqe;
 
 			tqe = pending_acks_info[i].txqe;
@@ -608,6 +610,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 	u32 vmm_table[WILC_VMM_TBL_SIZE];
 	struct wilc_vif *vif;
 	struct wilc *wilc;
+	struct txq_entry_t index = tqe->tcp_pending_ack_idx;
 
 	vif = netdev_priv(dev);
 	wilc = vif->wilc;
@@ -789,9 +792,9 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				if (tqe->tx_complete_func)
 					tqe->tx_complete_func(tqe->priv,
 							      tqe->status);
-				if (tqe->tcp_pending_ack_idx != NOT_TCP_ACK &&
-				    tqe->tcp_pending_ack_idx < MAX_PENDING_ACKS)
-					pending_acks_info[tqe->tcp_pending_ack_idx].txqe = NULL;
+				if (index != NOT_TCP_ACK &&
+				    index < MAX_PENDING_ACKS)
+					pending_acks_info[index].txqe = NULL;
 				kfree(tqe);
 			} else {
 				break;
Signature · 1 line
1.9.1
#4 lore raw

Re: [PATCH 2/2] staging: wilc1000: Fix line over 80 characters

Quoted 1 line · Anchal Jain

Add local variables so that they do not exceed 80

What does "they" refer to?

Quoted 12 lines

characters. Problem found using checkpatch.

---
 drivers/staging/wilc1000/wilc_wlan.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/staging/wilc1000/wilc_wlan.c +0 -0
index a611cba..a272199 100644

drivers/staging/wilc1000/wilc_wlan.c static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) · line 288

Quoted 4 lines
drivers/staging/wilc1000/wilc_wlan.c +1 -0
@@ -285,6 +285,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
 	struct wilc *wilc;
 	u32 i = 0;
 	u32 dropped = 0;
+	u32 session = pending_acks_info[MAX_PENDING_ACKS].session_index;

This is not correct. You need the value of the session_index field on each iteration. You can't initialize the variable here.

drivers/staging/wilc1000/wilc_wlan.c static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) · line 299

Quoted 9 lines
drivers/staging/wilc1000/wilc_wlan.c +2 -1
 	vif = netdev_priv(dev);
 	wilc = vif->wilc;
@@ -294,7 +295,8 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
 		if (i >= MAX_PENDING_ACKS ||
 		    pending_acks_info[i].session_index >= 2 * MAX_TCP_SESSION)
 			break;
-		if (pending_acks_info[i].ack_num < ack_session_info[pending_acks_info[i].session_index].bigger_ack_num) {
+		if (pending_acks_info[i].ack_num <
+			Ack_session_info[session].bigger_ack_num) {

The name of the array is ack_session_info, not Ack_session_info. The compiler should have given an error here.

drivers/staging/wilc1000/wilc_wlan.c int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) · line 613

Quoted 8 lines
drivers/staging/wilc1000/wilc_wlan.c +1 -0
 			struct txq_entry_t *tqe;
 
 			tqe = pending_acks_info[i].txqe;
@@ -608,6 +610,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 	u32 vmm_table[WILC_VMM_TBL_SIZE];
 	struct wilc_vif *vif;
 	struct wilc *wilc;
+	struct txq_entry_t index = tqe->tcp_pending_ack_idx;

The changes are complicated enough that this should be in a separate patch.

julia

Quoted 19 lines
drivers/staging/wilc1000/wilc_wlan.c +3 -4
 	vif = netdev_priv(dev);
 	wilc = vif->wilc;
@@ -789,9 +792,9 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 				if (tqe->tx_complete_func)
 					tqe->tx_complete_func(tqe->priv,
 							      tqe->status);
-				if (tqe->tcp_pending_ack_idx != NOT_TCP_ACK &&
-				    tqe->tcp_pending_ack_idx < MAX_PENDING_ACKS)
-					pending_acks_info[tqe->tcp_pending_ack_idx].txqe = NULL;
+				if (index != NOT_TCP_ACK &&
+				    index < MAX_PENDING_ACKS)
+					pending_acks_info[index].txqe = NULL;
 				kfree(tqe);
 			} else {
 				break;
--

1.9.1