[PATCH v2] staging: rtl8723bs: use single-line initialization for pframe

Hungyu Lin posted 1 patch 3 days, 16 hours ago
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH v2] staging: rtl8723bs: use single-line initialization for pframe
Posted by Hungyu Lin 3 days, 16 hours ago
Combine declaration and assignment of pframe into a single line.

No functional change.

v2: adjust formatting based on review feedback.
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
 drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
index a1f2cbf2cf55..c79df13b67a8 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
@@ -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);
-- 
2.34.1
Re: [PATCH v2] staging: rtl8723bs: use single-line initialization for pframe
Posted by Greg KH 3 days, 16 hours ago
On Fri, Apr 03, 2026 at 05:54:27PM +0000, Hungyu Lin wrote:
> Combine declaration and assignment of pframe into a single line.

But why?

> 
> No functional change.
> 
> v2: adjust formatting based on review feedback.

This goes below the --- line.

> Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
> ---
>  drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
> index a1f2cbf2cf55..c79df13b67a8 100644
> --- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
> +++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
> @@ -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
Posted by Denny Lin 3 days, 16 hours ago
On Fri, Apr 03, 2026 at 11:00:00AM +0000, Greg Kroah-Hartman wrote:
> 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

On Fri, Apr 3, 2026 at 11:00 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Fri, Apr 03, 2026 at 05:54:27PM +0000, Hungyu Lin wrote:
> > Combine declaration and assignment of pframe into a single line.
>
> But why?
>
> >
> > No functional change.
> >
> > v2: adjust formatting based on review feedback.
>
> This goes below the --- line.
>
> > Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
> > ---
> >  drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
> > index a1f2cbf2cf55..c79df13b67a8 100644
> > --- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
> > +++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
> > @@ -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