Skip to contentSkip to conversation

staging: rtl8723bs: fix line length checks in rtw_cmd.c

PATCH In review Noah Techoueyres 2 participants 2 messages May 12 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: rtl8723bs: fix line length checks in rtw_cmd.c

Fix both block comments and assignment statements that exceed the 100-column limit to follow Linux guidelines for readability. Used intermediate pointers to fix assignment statements.

---
Changes in v2:
- Replaced repeated struct access paths with an intermediate pointer to traffic_stat to resolve the 100-column limit.

 drivers/staging/rtl8723bs/core/rtw_cmd.c | 38 ++++++++++++++----------
 1 file changed, 23 insertions(+), 15 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +23 -15
index c1185c25ed36..5c6999ac17f6 100644
@@ -1106,24 +1106,25 @@ static void collect_traffic_statistics(struct adapter *padapter)
 {
 	struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
 
+	struct rtw_traffic_statistics *stat = &pdvobjpriv->traffic_stat;
+
 	/*  Tx */
-	pdvobjpriv->traffic_stat.tx_bytes = padapter->xmitpriv.tx_bytes;
-	pdvobjpriv->traffic_stat.tx_pkts = padapter->xmitpriv.tx_pkts;
-	pdvobjpriv->traffic_stat.tx_drop = padapter->xmitpriv.tx_drop;
+	stat->tx_bytes = padapter->xmitpriv.tx_bytes;
+	stat->tx_pkts = padapter->xmitpriv.tx_pkts;
+	stat->tx_drop = padapter->xmitpriv.tx_drop;
 
 	/*  Rx */
-	pdvobjpriv->traffic_stat.rx_bytes = padapter->recvpriv.rx_bytes;
-	pdvobjpriv->traffic_stat.rx_pkts = padapter->recvpriv.rx_pkts;
-	pdvobjpriv->traffic_stat.rx_drop = padapter->recvpriv.rx_drop;
+	stat->rx_bytes = padapter->recvpriv.rx_bytes;
+	stat->rx_pkts = padapter->recvpriv.rx_pkts;
+	stat->rx_drop = padapter->recvpriv.rx_drop;
 
 	/*  Calculate throughput in last interval */
-	pdvobjpriv->traffic_stat.cur_tx_bytes = pdvobjpriv->traffic_stat.tx_bytes - pdvobjpriv->traffic_stat.last_tx_bytes;
-	pdvobjpriv->traffic_stat.cur_rx_bytes = pdvobjpriv->traffic_stat.rx_bytes - pdvobjpriv->traffic_stat.last_rx_bytes;
-	pdvobjpriv->traffic_stat.last_tx_bytes = pdvobjpriv->traffic_stat.tx_bytes;
-	pdvobjpriv->traffic_stat.last_rx_bytes = pdvobjpriv->traffic_stat.rx_bytes;
-
-	pdvobjpriv->traffic_stat.cur_tx_tp = (u32)(pdvobjpriv->traffic_stat.cur_tx_bytes * 8 / 2 / 1024 / 1024);
-	pdvobjpriv->traffic_stat.cur_rx_tp = (u32)(pdvobjpriv->traffic_stat.cur_rx_bytes * 8 / 2 / 1024 / 1024);
+	stat->cur_tx_bytes = stat->tx_bytes - stat->last_tx_bytes;
+	stat->cur_rx_bytes = stat->rx_bytes - stat->last_rx_bytes;
+	stat->last_tx_bytes = stat->tx_bytes;
+	stat->last_rx_bytes = stat->rx_bytes;
+	stat->cur_tx_tp = (u32)(stat->cur_tx_bytes * 8 / 2 / 1024 / 1024);
+	stat->cur_rx_tp = (u32)(stat->cur_rx_bytes * 8 / 2 / 1024 / 1024);
 }
 
 bool traffic_status_watchdog(struct adapter *padapter, bool from_timer)
@@ -1743,7 +1744,11 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf)
 	pdrvextra_cmd = (struct drvextra_cmd_parm *)pbuf;
 
 	switch (pdrvextra_cmd->ec_id) {
-	case DYNAMIC_CHK_WK_CID:/* only  primary padapter go to this cmd, but execute dynamic_chk_wk_hdl() for two interfaces */
+	case DYNAMIC_CHK_WK_CID:
+		/*
+		 * only primary padapter go to this cmd, but execute
+		 * dynamic_chk_wk_hdl() for two interfaces
+		 */
 		dynamic_chk_wk_hdl(padapter);
 		break;
 	case POWER_SAVING_CTRL_WK_CID:
@@ -1881,7 +1886,10 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
 		_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
 
 		spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
-		/*  we will set _FW_LINKED when there is one more sat to join us (rtw_stassoc_event_callback) */
+		/*
+		 * we will set _FW_LINKED when there is one more sta
+		 * to join us (rtw_stassoc_event_callback)
+		 */
 	}
 
 createbss_cmd_fail:
Signature · 1 line
2.53.0
#1 lore raw
Quoted 4 lines · Noah Techoueyres

Fix both block comments and assignment statements that exceed the 100-column limit to follow Linux guidelines for readability. Used intermediate pointers to fix assignment statements.

These are unrelated. Do it in two patches.

Quoted 14 lines

---
Changes in v2:
- Replaced repeated struct access paths with an intermediate pointer to traffic_stat to resolve the 100-column limit.

 drivers/staging/rtl8723bs/core/rtw_cmd.c | 38 ++++++++++++++----------
 1 file changed, 23 insertions(+), 15 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +0 -0
index c1185c25ed36..5c6999ac17f6 100644

drivers/staging/rtl8723bs/core/rtw_cmd.c static void collect_traffic_statistics(struct adapter *padapter) · line 1109

Quoted 4 lines
drivers/staging/rtl8723bs/core/rtw_cmd.c +1 -0
@@ -1106,24 +1106,25 @@ static void collect_traffic_statistics(struct adapter *padapter)
 {
 	struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
 
+	struct rtw_traffic_statistics *stat = &pdvobjpriv->traffic_stat;

Don't put a blank line in the middle of the declaration block.

regards,
dan carpenter