* [PATCH] staging: rtl8723bs: simplify xmit_frame initialization @ 2026-04-03 0:13 Hungyu Lin 2026-04-03 17:22 ` Greg KH 0 siblings, 1 reply; 5+ messages in thread From: Hungyu Lin @ 2026-04-03 0:13 UTC (permalink / raw) To: gregkh Cc: linux-staging, linux-kernel, straube.linux, dan.carpenter, Hungyu Lin Simplify initialization of pframe by combining declaration and assignment, improving readability. No functional change. Signed-off-by: Hungyu Lin <dennylin0707@gmail.com> --- drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c index a1f2cbf2cf55..84e58e53d708 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c @@ -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); -- 2.34.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: rtl8723bs: simplify xmit_frame initialization 2026-04-03 0:13 [PATCH] staging: rtl8723bs: simplify xmit_frame initialization Hungyu Lin @ 2026-04-03 17:22 ` Greg KH 2026-04-03 17:54 ` [PATCH v2] staging: rtl8723bs: use single-line initialization for pframe Hungyu Lin 0 siblings, 1 reply; 5+ messages in thread From: Greg KH @ 2026-04-03 17:22 UTC (permalink / raw) To: Hungyu Lin; +Cc: linux-staging, linux-kernel, straube.linux, dan.carpenter On Fri, Apr 03, 2026 at 12:13:07AM +0000, Hungyu Lin wrote: > Simplify initialization of pframe by combining declaration and > assignment, improving readability. > > No functional change. > > Signed-off-by: Hungyu Lin <dennylin0707@gmail.com> > --- > drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c > index a1f2cbf2cf55..84e58e53d708 100644 > --- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c > +++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c > @@ -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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] staging: rtl8723bs: use single-line initialization for pframe 2026-04-03 17:22 ` Greg KH @ 2026-04-03 17:54 ` Hungyu Lin 2026-04-03 18:00 ` Greg KH 0 siblings, 1 reply; 5+ messages in thread From: Hungyu Lin @ 2026-04-03 17:54 UTC (permalink / raw) To: gregkh Cc: linux-staging, linux-kernel, straube.linux, dan.carpenter, Hungyu Lin 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 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] staging: rtl8723bs: use single-line initialization for pframe 2026-04-03 17:54 ` [PATCH v2] staging: rtl8723bs: use single-line initialization for pframe Hungyu Lin @ 2026-04-03 18:00 ` Greg KH 2026-04-03 18:20 ` Denny Lin 0 siblings, 1 reply; 5+ messages in thread From: Greg KH @ 2026-04-03 18:00 UTC (permalink / raw) To: Hungyu Lin; +Cc: linux-staging, linux-kernel, straube.linux, dan.carpenter 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] staging: rtl8723bs: use single-line initialization for pframe 2026-04-03 18:00 ` Greg KH @ 2026-04-03 18:20 ` Denny Lin 0 siblings, 0 replies; 5+ messages in thread From: Denny Lin @ 2026-04-03 18:20 UTC (permalink / raw) To: Greg KH; +Cc: linux-staging, linux-kernel, straube.linux, dan.carpenter 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-04-03 18:21 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-04-03 0:13 [PATCH] staging: rtl8723bs: simplify xmit_frame initialization Hungyu Lin 2026-04-03 17:22 ` Greg KH 2026-04-03 17:54 ` [PATCH v2] staging: rtl8723bs: use single-line initialization for pframe Hungyu Lin 2026-04-03 18:00 ` Greg KH 2026-04-03 18:20 ` Denny Lin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox