staging: rtl8723bs: simplify xmit_frame initialization
PATCH 1/1 staging: rtl8723bs: simplify xmit_frame initialization
Simplify initialization of pframe by combining declaration and assignment, improving readability.
No functional change.
--- drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +3 -2
@@ -239,8 +239,9 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv/* pxmitbuf->priv_data will be NULL, and will crash here */ if (pxmitbuf->len >0 && pxmitbuf->priv_data) { -struct xmit_frame *pframe; - pframe = (struct xmit_frame *)pxmitbuf->priv_data; +struct xmit_frame *pframe = + pxmitbuf->priv_data; + pframe->agg_num = k; pxmitbuf->agg_num = k;rtl8723b_update_txdesc (pframe, pframe->buf_addr);
Signature · 1 line
2.34.1
Greg KH
maintainerQuoted 15 lines · Hungyu Lin
Simplify initialization of pframe by combining declaration and assignment, improving readability.
No functional change.
Signed-off-by Hungyu Lin <[email protected]>--- drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +0
-0
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv · line 244
Quoted 8 lines
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +3
-2@@ -239,8 +239,9 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv/* pxmitbuf->priv_data will be NULL, and will crash here */ if (pxmitbuf->len >0 && pxmitbuf->priv_data) { -struct xmit_frame *pframe; - pframe = (struct xmit_frame *)pxmitbuf->priv_data; +struct xmit_frame *pframe = + pxmitbuf->priv_data; +
This is now 3 lines, not 2, which didn't really help anything out in looking better.
What tool told you to make this change? It needs to be fixed.
thanks,
greg k-h
PATCH v2 1/1 staging: rtl8723bs: use single-line initialization for pframe
Combine declaration and assignment of pframe into a single line.
No functional change.
v2: adjust formatting based on review feedback.
--- drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +2 -2
@@ -239,8 +239,8 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv/* pxmitbuf->priv_data will be NULL, and will crash here */ if (pxmitbuf->len >0 && pxmitbuf->priv_data) { -struct xmit_frame *pframe; - pframe = (struct xmit_frame *)pxmitbuf->priv_data; +struct xmit_frame *pframe = pxmitbuf->priv_data; + pframe->agg_num = k; pxmitbuf->agg_num = k;rtl8723b_update_txdesc (pframe, pframe->buf_addr);
Signature · 1 line
2.34.1
Greg KH
maintainerRe: [PATCH v2] staging: rtl8723bs: use single-line initialization for pframe
Quoted 1 line · Hungyu Lin
Combine declaration and assignment of pframe into a single line.
But why?
Quoted 4 lines
No functional change.
v2: adjust formatting based on review feedback.
This goes below the --- line.
Quoted 10 lines
Signed-off-by Hungyu Lin <[email protected]>--- drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +0
-0
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv · line 243
Quoted 7 lines
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +2
-2@@ -239,8 +239,8 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv/* pxmitbuf->priv_data will be NULL, and will crash here */ if (pxmitbuf->len >0 && pxmitbuf->priv_data) { -struct xmit_frame *pframe; - pframe = (struct xmit_frame *)pxmitbuf->priv_data; +struct xmit_frame *pframe = pxmitbuf->priv_data; +
If the cast is not needed, that can be dropped, but really, I don't see what is wrong with the original code, do you?
What tool is asking you to make this change?
thanks,
greg k-h
Re: [PATCH v2] staging: rtl8723bs: use single-line initialization for pframe
Quoted 3 lines · Greg Kroah-Hartman
But why?
...
I don't see what is wrong with the original code, do you?
You are right, there is no real improvement over the original code.
I will drop this patch.
Thanks,
Hungyu
Quoted 39 lines · Greg KH
Quoted 1 line · Hungyu Lin
Combine declaration and assignment of pframe into a single line.
But why?
Quoted 4 lines
No functional change.
v2: adjust formatting based on review feedback.
This goes below the --- line.
Quoted 10 lines
Signed-off-by Hungyu Lin <[email protected]>--- drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +0
-0drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv · line 243
Quoted 7 lines
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +2
-2@@ -239,8 +239,8 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv/* pxmitbuf->priv_data will be NULL, and will crash here */ if (pxmitbuf->len >0 && pxmitbuf->priv_data) { -struct xmit_frame *pframe; - pframe = (struct xmit_frame *)pxmitbuf->priv_data; +struct xmit_frame *pframe = pxmitbuf->priv_data; +If the cast is not needed, that can be dropped, but really, I don't see what is wrong with the original code, do you?
What tool is asking you to make this change?
thanks,
greg k-h