mirror of
https://github.com/Mange/rtl8192eu-linux-driver
synced 2025-12-10 00:04:17 +00:00
convert all rtw_zvmalloc calls to vzalloc calls
Convert all rtw_zvmalloc calls within the driver to use the existing kernel vzalloc function, which has the same semantics. Also rewrite the two places where it is mentioned in comments to say vzalloc, and remove the redundant cast to struct adapter * in ./os_dep/usb_intf.c as vzalloc returns void *. The reason for the conversion is that rtw_zvmalloc is just a preprocessor definition for _rtw_zvmalloc which itself is just an inline wrapper around vmalloc which then zeroes the memory out. As vzalloc does the same thing via usage of __GFP_ZERO, this code is redundant and can subsequently be removed. Link: https://lore.kernel.org/r/20210818234853.208448-5-phil@philpotter.co.uk
This commit is contained in:
committed by
Carlos Garcés
parent
1f0cf855dc
commit
2a467a7923
@@ -71,7 +71,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter)
|
||||
sint res = _SUCCESS;
|
||||
|
||||
|
||||
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */
|
||||
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
|
||||
/* memset((unsigned char *)pxmitpriv, 0, sizeof(struct xmit_priv)); */
|
||||
|
||||
_rtw_spinlock_init(&pxmitpriv->lock);
|
||||
@@ -104,7 +104,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter)
|
||||
Please also apply free_txobj to link_up all the xmit_frames...
|
||||
*/
|
||||
|
||||
pxmitpriv->pallocated_frame_buf = rtw_zvmalloc(NR_XMITFRAME * sizeof(struct xmit_frame) + 4);
|
||||
pxmitpriv->pallocated_frame_buf = vzalloc(NR_XMITFRAME * sizeof(struct xmit_frame) + 4);
|
||||
|
||||
if (pxmitpriv->pallocated_frame_buf == NULL) {
|
||||
pxmitpriv->pxmit_frame_buf = NULL;
|
||||
@@ -142,7 +142,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter)
|
||||
_rtw_init_queue(&pxmitpriv->free_xmitbuf_queue);
|
||||
_rtw_init_queue(&pxmitpriv->pending_xmitbuf_queue);
|
||||
|
||||
pxmitpriv->pallocated_xmitbuf = rtw_zvmalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4);
|
||||
pxmitpriv->pallocated_xmitbuf = vzalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4);
|
||||
|
||||
if (pxmitpriv->pallocated_xmitbuf == NULL) {
|
||||
res = _FAIL;
|
||||
@@ -194,7 +194,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter)
|
||||
/* init xframe_ext queue, the same count as extbuf */
|
||||
_rtw_init_queue(&pxmitpriv->free_xframe_ext_queue);
|
||||
|
||||
pxmitpriv->xframe_ext_alloc_addr = rtw_zvmalloc(NR_XMIT_EXTBUFF * sizeof(struct xmit_frame) + 4);
|
||||
pxmitpriv->xframe_ext_alloc_addr = vzalloc(NR_XMIT_EXTBUFF * sizeof(struct xmit_frame) + 4);
|
||||
|
||||
if (pxmitpriv->xframe_ext_alloc_addr == NULL) {
|
||||
pxmitpriv->xframe_ext = NULL;
|
||||
@@ -226,7 +226,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter)
|
||||
/* Init xmit extension buff */
|
||||
_rtw_init_queue(&pxmitpriv->free_xmit_extbuf_queue);
|
||||
|
||||
pxmitpriv->pallocated_xmit_extbuf = rtw_zvmalloc(NR_XMIT_EXTBUFF * sizeof(struct xmit_buf) + 4);
|
||||
pxmitpriv->pallocated_xmit_extbuf = vzalloc(NR_XMIT_EXTBUFF * sizeof(struct xmit_buf) + 4);
|
||||
|
||||
if (pxmitpriv->pallocated_xmit_extbuf == NULL) {
|
||||
res = _FAIL;
|
||||
|
||||
Reference in New Issue
Block a user