From: Hungyu Lin Date: Wed, 8 Apr 2026 11:13:12 +0000 (+0000) Subject: staging: rtl8723bs: move rtw_os_xmit_resource_alloc to rtw_xmit.c X-Git-Tag: v7.2-rc1~66^2~178 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=e7c3d33739e1e0d3159916bd30826d1ee9bb9477;p=thirdparty%2Flinux.git staging: rtl8723bs: move rtw_os_xmit_resource_alloc to rtw_xmit.c Move rtw_os_xmit_resource_alloc() into core/rtw_xmit.c and make it static so the xmit init helpers live together. Signed-off-by: Hungyu Lin Reviewed-by: Dan Carpenter Link: https://patch.msgid.link/20260408111314.19329-5-dennylin0707@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c index befe74a1bc4ca..249947a7d9105 100644 --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c @@ -73,6 +73,19 @@ static s32 rtw_alloc_hwxmits(struct adapter *padapter) return 0; } +static int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz, u8 flag) +{ + if (alloc_sz > 0) { + pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL); + if (!pxmitbuf->pallocated_buf) + return _FAIL; + + pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ); + } + + return _SUCCESS; +} + s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) { int i; diff --git a/drivers/staging/rtl8723bs/include/xmit_osdep.h b/drivers/staging/rtl8723bs/include/xmit_osdep.h index 880344bffe2f0..5b351652e31bd 100644 --- a/drivers/staging/rtl8723bs/include/xmit_osdep.h +++ b/drivers/staging/rtl8723bs/include/xmit_osdep.h @@ -30,7 +30,6 @@ extern netdev_tx_t rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetde void rtw_os_xmit_schedule(struct adapter *padapter); -int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz, u8 flag); void rtw_os_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 free_sz, u8 flag); extern uint rtw_remainder_len(struct pkt_file *pfile); diff --git a/drivers/staging/rtl8723bs/os_dep/xmit_linux.c b/drivers/staging/rtl8723bs/os_dep/xmit_linux.c index dc0b77f38b1ae..54a6d54400e27 100644 --- a/drivers/staging/rtl8723bs/os_dep/xmit_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/xmit_linux.c @@ -46,19 +46,6 @@ signed int rtw_endofpktfile(struct pkt_file *pfile) return false; } -int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz, u8 flag) -{ - if (alloc_sz > 0) { - pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL); - if (!pxmitbuf->pallocated_buf) - return _FAIL; - - pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ); - } - - return _SUCCESS; -} - void rtw_os_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 free_sz, u8 flag) { if (free_sz > 0)