mirror of
https://github.com/Mange/rtl8192eu-linux-driver
synced 2026-02-12 16:04:39 +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
@@ -2396,7 +2396,7 @@ u8 rtw_init_drv_sw(_adapter *padapter)
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
_rtw_spinlock_init(&padapter->security_key_mutex);
|
||||
|
||||
/* 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 *)&padapter->securitypriv, 0, sizeof (struct security_priv)); */
|
||||
|
||||
if (_rtw_init_sta_priv(&padapter->stapriv) == _FAIL) {
|
||||
@@ -2805,7 +2805,7 @@ _adapter *rtw_drv_add_vir_if(_adapter *primary_padapter,
|
||||
u8 mac[ETH_ALEN];
|
||||
|
||||
/****** init adapter ******/
|
||||
padapter = (_adapter *)rtw_zvmalloc(sizeof(*padapter));
|
||||
padapter = (_adapter *)vzalloc(sizeof(*padapter));
|
||||
if (padapter == NULL)
|
||||
goto exit;
|
||||
|
||||
|
||||
@@ -1270,7 +1270,7 @@ _adapter *rtw_usb_primary_adapter_init(struct dvobj_priv *dvobj,
|
||||
_adapter *padapter = NULL;
|
||||
int status = _FAIL;
|
||||
|
||||
padapter = (_adapter *)rtw_zvmalloc(sizeof(*padapter));
|
||||
padapter = (_adapter *)vzalloc(sizeof(*padapter));
|
||||
if (padapter == NULL)
|
||||
goto exit;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user