* [PATCH] staging: r8188eu: remove rtw_endofpktfile()
@ 2022-08-17 6:32 Michael Straube
2022-08-17 19:58 ` Philipp Hortmann
0 siblings, 1 reply; 2+ messages in thread
From: Michael Straube @ 2022-08-17 6:32 UTC (permalink / raw)
To: gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel, Michael Straube
The function rtw_endofpktfile() just checks for pkt_len == 0.
Remove rtw_endofpktfile() and merge the check into the caller to
improve readability and simplify the driver code.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
drivers/staging/r8188eu/core/rtw_xmit.c | 2 +-
drivers/staging/r8188eu/include/xmit_osdep.h | 1 -
drivers/staging/r8188eu/os_dep/xmit_linux.c | 11 -----------
3 files changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index 24401f3ae2a0..48631ef56114 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -970,7 +970,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
frg_inx++;
- if (bmcst || rtw_endofpktfile(&pktfile)) {
+ if (bmcst || pktfile.pkt_len == 0) {
pattrib->nr_frags = frg_inx;
pattrib->last_txcmdsz = pattrib->hdrlen + pattrib->iv_len + ((pattrib->nr_frags == 1) ? llc_sz : 0) +
diff --git a/drivers/staging/r8188eu/include/xmit_osdep.h b/drivers/staging/r8188eu/include/xmit_osdep.h
index 00658681fef9..130dc06efe73 100644
--- a/drivers/staging/r8188eu/include/xmit_osdep.h
+++ b/drivers/staging/r8188eu/include/xmit_osdep.h
@@ -40,7 +40,6 @@ void rtw_os_xmit_resource_free(struct adapter *padapter,
uint rtw_remainder_len(struct pkt_file *pfile);
void _rtw_open_pktfile(struct sk_buff *pkt, struct pkt_file *pfile);
uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen);
-bool rtw_endofpktfile(struct pkt_file *pfile);
void rtw_os_pkt_complete(struct adapter *padapter, struct sk_buff *pkt);
void rtw_os_xmit_complete(struct adapter *padapter,
diff --git a/drivers/staging/r8188eu/os_dep/xmit_linux.c b/drivers/staging/r8188eu/os_dep/xmit_linux.c
index 91a1e4e3219a..85ef27735b88 100644
--- a/drivers/staging/r8188eu/os_dep/xmit_linux.c
+++ b/drivers/staging/r8188eu/os_dep/xmit_linux.c
@@ -54,17 +54,6 @@ uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen)
return len;
}
-bool rtw_endofpktfile(struct pkt_file *pfile)
-{
-
- if (pfile->pkt_len == 0) {
-
- return true;
- }
-
- return false;
-}
-
int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz)
{
pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL);
--
2.37.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: r8188eu: remove rtw_endofpktfile()
2022-08-17 6:32 [PATCH] staging: r8188eu: remove rtw_endofpktfile() Michael Straube
@ 2022-08-17 19:58 ` Philipp Hortmann
0 siblings, 0 replies; 2+ messages in thread
From: Philipp Hortmann @ 2022-08-17 19:58 UTC (permalink / raw)
To: Michael Straube, gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel
On 8/17/22 08:32, Michael Straube wrote:
> The function rtw_endofpktfile() just checks for pkt_len == 0.
> Remove rtw_endofpktfile() and merge the check into the caller to
> improve readability and simplify the driver code.
>
> Signed-off-by: Michael Straube <straube.linux@gmail.com>
> ---
> drivers/staging/r8188eu/core/rtw_xmit.c | 2 +-
> drivers/staging/r8188eu/include/xmit_osdep.h | 1 -
> drivers/staging/r8188eu/os_dep/xmit_linux.c | 11 -----------
> 3 files changed, 1 insertion(+), 13 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
> index 24401f3ae2a0..48631ef56114 100644
> --- a/drivers/staging/r8188eu/core/rtw_xmit.c
> +++ b/drivers/staging/r8188eu/core/rtw_xmit.c
> @@ -970,7 +970,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
>
> frg_inx++;
>
> - if (bmcst || rtw_endofpktfile(&pktfile)) {
> + if (bmcst || pktfile.pkt_len == 0) {
> pattrib->nr_frags = frg_inx;
>
> pattrib->last_txcmdsz = pattrib->hdrlen + pattrib->iv_len + ((pattrib->nr_frags == 1) ? llc_sz : 0) +
> diff --git a/drivers/staging/r8188eu/include/xmit_osdep.h b/drivers/staging/r8188eu/include/xmit_osdep.h
> index 00658681fef9..130dc06efe73 100644
> --- a/drivers/staging/r8188eu/include/xmit_osdep.h
> +++ b/drivers/staging/r8188eu/include/xmit_osdep.h
> @@ -40,7 +40,6 @@ void rtw_os_xmit_resource_free(struct adapter *padapter,
> uint rtw_remainder_len(struct pkt_file *pfile);
> void _rtw_open_pktfile(struct sk_buff *pkt, struct pkt_file *pfile);
> uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen);
> -bool rtw_endofpktfile(struct pkt_file *pfile);
>
> void rtw_os_pkt_complete(struct adapter *padapter, struct sk_buff *pkt);
> void rtw_os_xmit_complete(struct adapter *padapter,
> diff --git a/drivers/staging/r8188eu/os_dep/xmit_linux.c b/drivers/staging/r8188eu/os_dep/xmit_linux.c
> index 91a1e4e3219a..85ef27735b88 100644
> --- a/drivers/staging/r8188eu/os_dep/xmit_linux.c
> +++ b/drivers/staging/r8188eu/os_dep/xmit_linux.c
> @@ -54,17 +54,6 @@ uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen)
> return len;
> }
>
> -bool rtw_endofpktfile(struct pkt_file *pfile)
> -{
> -
> - if (pfile->pkt_len == 0) {
> -
> - return true;
> - }
> -
> - return false;
> -}
> -
> int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz)
> {
> pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL);
Tested with Edimax N150 and
Reviewed-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-17 19:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-17 6:32 [PATCH] staging: r8188eu: remove rtw_endofpktfile() Michael Straube
2022-08-17 19:58 ` Philipp Hortmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.