Skip to contentSkip to conversation

staging: rtl8723bs: split multiple assignments in rtw_xmit.c

PATCH In review Sajal Gupta 3 participants 3 messages May 17 – May 18 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: split multiple assignments in rtw_xmit.c

Split multiple assignments into separate statements to comply with kernel coding style. Fixes the checkpatch warnings:
"multiple assignments should be avoided"

---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +10 -5
index 458e471535ad..e30c99eeee89 100644
@@ -185,7 +185,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
 		pxmitbuf->phead = pxmitbuf->pbuf;
 		pxmitbuf->pend = pxmitbuf->pbuf + MAX_XMITBUF_SZ;
 		pxmitbuf->len = 0;
-		pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead;
+		pxmitbuf->ptail = pxmitbuf->phead;
+		pxmitbuf->pdata = pxmitbuf->ptail;
 
 		pxmitbuf->flags = XMIT_VO_QUEUE;
 
@@ -260,7 +261,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
 		pxmitbuf->phead = pxmitbuf->pbuf;
 		pxmitbuf->pend = pxmitbuf->pbuf + MAX_XMIT_EXTBUF_SZ;
 		pxmitbuf->len = 0;
-		pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead;
+		pxmitbuf->ptail = pxmitbuf->phead;
+		pxmitbuf->pdata = pxmitbuf->ptail;
 
 		list_add_tail(&pxmitbuf->list,
 			      &pxmitpriv->free_xmit_extbuf_queue.queue);
@@ -290,7 +292,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
 			pxmitbuf->phead = pxmitbuf->pbuf;
 			pxmitbuf->pend = pxmitbuf->pbuf + MAX_CMDBUF_SZ;
 			pxmitbuf->len = 0;
-			pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead;
+			pxmitbuf->ptail = pxmitbuf->phead;
+			pxmitbuf->pdata = pxmitbuf->ptail;
 			pxmitbuf->alloc_sz = MAX_CMDBUF_SZ + XMITBUF_ALIGN_SZ;
 		}
 	}
@@ -1231,7 +1234,8 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s
 	u8 MME[_MME_IE_LENGTH_];
 	u32 ori_len;
 
-	mem_start = pframe = (u8 *)(pxmitframe->buf_addr) + TXDESC_OFFSET;
+	pframe = (u8 *)(pxmitframe->buf_addr) + TXDESC_OFFSET;
+	mem_start = pframe;
 	pwlanhdr = (struct ieee80211_hdr *)pframe;
 
 	ori_len = BIP_AAD_SIZE + pattrib->pktlen;
@@ -1483,7 +1487,8 @@ static struct xmit_buf *__rtw_alloc_cmd_xmitbuf(struct xmit_priv *pxmitpriv,
 		pxmitbuf->priv_data = NULL;
 
 		pxmitbuf->len = 0;
-		pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead;
+		pxmitbuf->ptail = pxmitbuf->phead;
+		pxmitbuf->pdata = pxmitbuf->ptail;
 		pxmitbuf->agg_num = 0;
 		pxmitbuf->pg_num = 0;
 
Signature · 1 line
2.54.0
#1 lore raw
Quoted 14 lines · Sajal Gupta

Split multiple assignments into separate statements to comply with kernel coding style. Fixes the checkpatch warnings:
"multiple assignments should be avoided"

---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +0 -0
index 458e471535ad..e30c99eeee89 100644

drivers/staging/rtl8723bs/core/rtw_xmit.c s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · line 189

Quoted 6 lines
drivers/staging/rtl8723bs/core/rtw_xmit.c +2 -1
@@ -185,7 +185,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
 		pxmitbuf->phead = pxmitbuf->pbuf;
 		pxmitbuf->pend = pxmitbuf->pbuf + MAX_XMITBUF_SZ;
 		pxmitbuf->len = 0;
-		pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead;
+		pxmitbuf->ptail = pxmitbuf->phead;
+		pxmitbuf->pdata = pxmitbuf->ptail;

I find this harder to read.

To be honest, I don't really have a problem with the original code. Another option might be to say:

	pxmitbuf->ptail = pxmitbuf->phead;
	pxmitbuf->pdata = pxmitbuf->phead;

But honestly, I'm not sure it's a very big improvement. We'd probably allow it to just stop people from sending more patches and having another discussion about this.

regards,
dan carpenter

maintainer
#2 lore raw
Quoted 24 lines · Dan Carpenter
Quoted 14 lines · Sajal Gupta

Split multiple assignments into separate statements to comply with kernel coding style. Fixes the checkpatch warnings:
"multiple assignments should be avoided"

---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +0 -0
index 458e471535ad..e30c99eeee89 100644

drivers/staging/rtl8723bs/core/rtw_xmit.c s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · line 189

Quoted 6 lines
drivers/staging/rtl8723bs/core/rtw_xmit.c +2 -1
@@ -185,7 +185,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
 		pxmitbuf->phead = pxmitbuf->pbuf;
 		pxmitbuf->pend = pxmitbuf->pbuf + MAX_XMITBUF_SZ;
 		pxmitbuf->len = 0;
-		pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead;
+		pxmitbuf->ptail = pxmitbuf->phead;
+		pxmitbuf->pdata = pxmitbuf->ptail;

I find this harder to read.

Quoted 1 line

To be honest, I don't really have a problem with the original code.

I agree, let's leave it as-is.

thanks,

greg k-h