2022-10-24 09:50:36

by Kang Minchul

[permalink] [raw]
Subject: [PATCH v2 0/4] staging: r8188eu: cleaning up unused variables

This patch series cleans up unused variables in r8188eu
causing coccicheck warnings.

Difference between v1 and this patch is that this patch series
include making function amsdu_to_msdu in /r8188eu/core/rtw_recv.c
into void function.

Kang Minchul (4):
staging: r8188eu: remove unnecessary variable in ioctl_linux
staging: r8188eu: make amsdu_to_msdu void function
staging: r8188eu: remove unnecessary variable in rtl8188eu_xmit
staging: r8188eu: remove unnecessary variable in rtw_ap

drivers/staging/r8188eu/core/rtw_ap.c | 5 ++---
drivers/staging/r8188eu/core/rtw_recv.c | 5 +----
drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 3 +--
drivers/staging/r8188eu/os_dep/ioctl_linux.c | 4 +---
4 files changed, 5 insertions(+), 12 deletions(-)

--
2.34.1


2022-10-24 09:55:06

by Kang Minchul

[permalink] [raw]
Subject: [PATCH v2 3/4] staging: r8188eu: remove unnecessary variable in rtl8188eu_xmit

Return 0 directly instead of storing it in a variable.
This can prevent cocci warning as follows:

Unneeded variable: "pull". Return "0" on line 298

Signed-off-by: Kang Minchul <[email protected]>
---
drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
index 8e4a5acc0b18..6d1f56d1f9d7 100644
--- a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
+++ b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
@@ -149,7 +149,6 @@ static void fill_txdesc_phy(struct pkt_attrib *pattrib, __le32 *pdw)

static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bagg_pkt)
{
- int pull = 0;
uint qsel;
u8 data_rate, pwr_status, offset;
struct adapter *adapt = pxmitframe->padapter;
@@ -295,7 +294,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bag
ODM_SetTxAntByTxInfo_88E(&haldata->odmpriv, pmem, pattrib->mac_id);

rtl8188eu_cal_txdesc_chksum(ptxdesc);
- return pull;
+ return 0;
}

/* for non-agg data frame or management frame */
--
2.34.1

2022-10-24 11:33:13

by Kang Minchul

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] staging: r8188eu: cleaning up unused variables

2022년 10월 24일 (월) 오후 5:49, Kang Minchul <[email protected]>님이 작성:
>
> This patch series cleans up unused variables in r8188eu
> causing coccicheck warnings.
>
> Difference between v1 and this patch is that this patch series
> include making function amsdu_to_msdu in /r8188eu/core/rtw_recv.c
> into void function.
>
> Kang Minchul (4):
> staging: r8188eu: remove unnecessary variable in ioctl_linux
> staging: r8188eu: make amsdu_to_msdu void function
> staging: r8188eu: remove unnecessary variable in rtl8188eu_xmit
> staging: r8188eu: remove unnecessary variable in rtw_ap
>
> drivers/staging/r8188eu/core/rtw_ap.c | 5 ++---
> drivers/staging/r8188eu/core/rtw_recv.c | 5 +----
> drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 3 +--
> drivers/staging/r8188eu/os_dep/ioctl_linux.c | 4 +---
> 4 files changed, 5 insertions(+), 12 deletions(-)
>
> --
> 2.34.1
>
Oh, I guess patch 4/4 can be fixed as well.
I think the function rtw_sta_flush can be void as well.

I'll resend the patch later.

regards,
Kang Minchul

2022-10-25 17:32:07

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] staging: r8188eu: cleaning up unused variables

On Mon, Oct 24, 2022 at 08:23:08PM +0900, Kang Minchul wrote:
> 2022년 10월 24일 (월) 오후 5:49, Kang Minchul <[email protected]>님이 작성:
> >
> > This patch series cleans up unused variables in r8188eu
> > causing coccicheck warnings.
> >
> > Difference between v1 and this patch is that this patch series
> > include making function amsdu_to_msdu in /r8188eu/core/rtw_recv.c
> > into void function.
> >
> > Kang Minchul (4):
> > staging: r8188eu: remove unnecessary variable in ioctl_linux
> > staging: r8188eu: make amsdu_to_msdu void function
> > staging: r8188eu: remove unnecessary variable in rtl8188eu_xmit
> > staging: r8188eu: remove unnecessary variable in rtw_ap
> >
> > drivers/staging/r8188eu/core/rtw_ap.c | 5 ++---
> > drivers/staging/r8188eu/core/rtw_recv.c | 5 +----
> > drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 3 +--
> > drivers/staging/r8188eu/os_dep/ioctl_linux.c | 4 +---
> > 4 files changed, 5 insertions(+), 12 deletions(-)
> >
> > --
> > 2.34.1
> >
> Oh, I guess patch 4/4 can be fixed as well.
> I think the function rtw_sta_flush can be void as well.
>
> I'll resend the patch later.

You broke the build in this series, please fix up and send a v3.

thanks,

greg k-h

2022-10-25 18:36:15

by Kang Minchul

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] staging: r8188eu: cleaning up unused variables

2022년 10월 26일 (수) 오전 2:22, Greg Kroah-Hartman <[email protected]>님이 작성:
>
> On Mon, Oct 24, 2022 at 08:23:08PM +0900, Kang Minchul wrote:
> > 2022년 10월 24일 (월) 오후 5:49, Kang Minchul <[email protected]>님이 작성:
> > >
> > > This patch series cleans up unused variables in r8188eu
> > > causing coccicheck warnings.
> > >
> > > Difference between v1 and this patch is that this patch series
> > > include making function amsdu_to_msdu in /r8188eu/core/rtw_recv.c
> > > into void function.
> > >
> > > Kang Minchul (4):
> > > staging: r8188eu: remove unnecessary variable in ioctl_linux
> > > staging: r8188eu: make amsdu_to_msdu void function
> > > staging: r8188eu: remove unnecessary variable in rtl8188eu_xmit
> > > staging: r8188eu: remove unnecessary variable in rtw_ap
> > >
> > > drivers/staging/r8188eu/core/rtw_ap.c | 5 ++---
> > > drivers/staging/r8188eu/core/rtw_recv.c | 5 +----
> > > drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 3 +--
> > > drivers/staging/r8188eu/os_dep/ioctl_linux.c | 4 +---
> > > 4 files changed, 5 insertions(+), 12 deletions(-)
> > >
> > > --
> > > 2.34.1
> > >
> > Oh, I guess patch 4/4 can be fixed as well.
> > I think the function rtw_sta_flush can be void as well.
> >
> > I'll resend the patch later.
>
> You broke the build in this series, please fix up and send a v3.
>
> thanks,
>
> greg k-h

I just fixed and sent v3,
thank you for your reply.

regards,
Kang Minchul