[PATCH] staging: rtl8723bs: split multiple assignments in rtw_xmit.c

Sajal Gupta posted 1 patch 1 week ago
drivers/staging/rtl8723bs/core/rtw_xmit.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
[PATCH] staging: rtl8723bs: split multiple assignments in rtw_xmit.c
Posted by Sajal Gupta 1 week ago
Split multiple assignments into separate statements to comply
with kernel coding style. Fixes the checkpatch warnings:
"multiple assignments should be avoided"

Signed-off-by: Sajal Gupta <sajal2005gupta@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index 458e471535ad..e30c99eeee89 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -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;
 
-- 
2.54.0
Re: [PATCH] staging: rtl8723bs: split multiple assignments in rtw_xmit.c
Posted by Dan Carpenter 1 week ago
On Sun, May 17, 2026 at 02:51:20PM +0530, Sajal Gupta wrote:
> Split multiple assignments into separate statements to comply
> with kernel coding style. Fixes the checkpatch warnings:
> "multiple assignments should be avoided"
> 
> Signed-off-by: Sajal Gupta <sajal2005gupta@gmail.com>
> ---
>  drivers/staging/rtl8723bs/core/rtw_xmit.c | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> index 458e471535ad..e30c99eeee89 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> @@ -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
Re: [PATCH] staging: rtl8723bs: split multiple assignments in rtw_xmit.c
Posted by Greg KH 6 days, 23 hours ago
On Mon, May 18, 2026 at 08:21:11AM +0300, Dan Carpenter wrote:
> On Sun, May 17, 2026 at 02:51:20PM +0530, Sajal Gupta wrote:
> > Split multiple assignments into separate statements to comply
> > with kernel coding style. Fixes the checkpatch warnings:
> > "multiple assignments should be avoided"
> > 
> > Signed-off-by: Sajal Gupta <sajal2005gupta@gmail.com>
> > ---
> >  drivers/staging/rtl8723bs/core/rtw_xmit.c | 15 ++++++++++-----
> >  1 file changed, 10 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> > index 458e471535ad..e30c99eeee89 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> > @@ -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.

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

thanks,

greg k-h