staging: r8188eu: remove rtw_endofpktfile()
authorMichael Straube <straube.linux@gmail.com>
Wed, 17 Aug 2022 06:32:23 +0000 (08:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Aug 2022 13:37:09 +0000 (15:37 +0200)
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.

Reviewed-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220817063223.8140-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_xmit.c
drivers/staging/r8188eu/include/xmit_osdep.h
drivers/staging/r8188eu/os_dep/xmit_linux.c

index 24401f3ae2a050e23ee0a5692e589147fddd4702..48631ef561149690e408c89ca8219f8cb6868923 100644 (file)
@@ -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) +
index 00658681fef9d0d8a171216fdfc0f41075cbfb2d..130dc06efe73aa4fda3b1d6e1a853d0c9eaab974 100644 (file)
@@ -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,
index 91a1e4e3219ac60120eb9bada2fe19bd3843b15f..85ef27735b88c99ca1e34206c9f65680d9daa495 100644 (file)
@@ -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);