Staging: rtl8188eu: Removed unneeded code.
This patch removes some unneeded code. 1) kzalloc() allocates 4 extra bytes so that we can align the return value. But actually the return value is already aligned so we can remove the + 4 and the call to N_BYTE_ALIGMENT(). 2) The memset() isn't needed because kzalloc() zeroes the allocation. Suggested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Adrian Remonda <adrianremonda@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
66ed681a30
commit
4246e490b5
@ -42,18 +42,15 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter)
|
||||
_rtw_init_queue(&precvpriv->free_recv_buf_queue);
|
||||
|
||||
precvpriv->pallocated_recv_buf =
|
||||
kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_KERNEL);
|
||||
kzalloc(NR_RECVBUFF * sizeof(struct recv_buf), GFP_KERNEL);
|
||||
if (precvpriv->pallocated_recv_buf == NULL) {
|
||||
res = _FAIL;
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_,
|
||||
("alloc recv_buf fail!\n"));
|
||||
goto exit;
|
||||
}
|
||||
memset(precvpriv->pallocated_recv_buf, 0,
|
||||
NR_RECVBUFF * sizeof(struct recv_buf) + 4);
|
||||
|
||||
precvpriv->precv_buf = (u8 *)N_BYTE_ALIGMENT((size_t)
|
||||
(precvpriv->pallocated_recv_buf), 4);
|
||||
precvpriv->precv_buf = precvpriv->pallocated_recv_buf;
|
||||
|
||||
|
||||
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
|
||||
|
Loading…
x
Reference in New Issue
Block a user