aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8712/rtl871x_xmit.c
diff options
context:
space:
mode:
authorVitaly Osipov <vitaly.osipov@gmail.com>2014-05-24 18:19:27 +1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-25 11:04:44 -0700
commit91d435fe368ab30702d7bcd50f680e7185899295 (patch)
tree2415c6d2ad015124be711c82499e0affd6ef89fb /drivers/staging/rtl8712/rtl871x_xmit.c
parentstaging: slicoss: clean up use of dev_err (diff)
downloadlinux-dev-91d435fe368ab30702d7bcd50f680e7185899295.tar.xz
linux-dev-91d435fe368ab30702d7bcd50f680e7185899295.zip
staging: rtl8712: remove _malloc()
This patch removes all usage of _malloc() and the function itself. Most uses are straightforward replacements by kmalloc(..., GFP_ATOMIC), because this was the definition of _malloc(). In a few places it was possible to use kzalloc() or memdup_user. A further improvement would be to replace GFP_ATOMIC with GFP_KERNEL where possible. Verified by compilation only. Initial replacement done by running a Coccinelle script along the lines of: @@ type T; expression E; identifier V; @@ - V = (T) _malloc(E); + V = kmalloc(E, GFP_ATOMIC); @@ expression E, E1; @@ - E1 = _malloc(E); + E1 = kmalloc(E, GFP_ATOMIC); Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712/rtl871x_xmit.c')
-rw-r--r--drivers/staging/rtl8712/rtl871x_xmit.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_xmit.c b/drivers/staging/rtl8712/rtl871x_xmit.c
index 78f570b571a7..230681a8042f 100644
--- a/drivers/staging/rtl8712/rtl871x_xmit.c
+++ b/drivers/staging/rtl8712/rtl871x_xmit.c
@@ -87,8 +87,8 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
and initialize free_xmit_frame below.
Please also apply free_txobj to link_up all the xmit_frames...
*/
- pxmitpriv->pallocated_frame_buf = _malloc(NR_XMITFRAME *
- sizeof(struct xmit_frame) + 4);
+ pxmitpriv->pallocated_frame_buf = kmalloc(NR_XMITFRAME * sizeof(struct xmit_frame) + 4,
+ GFP_ATOMIC);
if (pxmitpriv->pallocated_frame_buf == NULL) {
pxmitpriv->pxmit_frame_buf = NULL;
return _FAIL;
@@ -126,8 +126,8 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
/*init xmit_buf*/
_init_queue(&pxmitpriv->free_xmitbuf_queue);
_init_queue(&pxmitpriv->pending_xmitbuf_queue);
- pxmitpriv->pallocated_xmitbuf = _malloc(NR_XMITBUFF *
- sizeof(struct xmit_buf) + 4);
+ pxmitpriv->pallocated_xmitbuf = kmalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4,
+ GFP_ATOMIC);
if (pxmitpriv->pallocated_xmitbuf == NULL)
return _FAIL;
pxmitpriv->pxmitbuf = pxmitpriv->pallocated_xmitbuf + 4 -
@@ -135,8 +135,8 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmitbuf;
for (i = 0; i < NR_XMITBUFF; i++) {
_init_listhead(&pxmitbuf->list);
- pxmitbuf->pallocated_buf = _malloc(MAX_XMITBUF_SZ +
- XMITBUF_ALIGN_SZ);
+ pxmitbuf->pallocated_buf = kmalloc(MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ,
+ GFP_ATOMIC);
if (pxmitbuf->pallocated_buf == NULL)
return _FAIL;
pxmitbuf->pbuf = pxmitbuf->pallocated_buf + XMITBUF_ALIGN_SZ -
@@ -955,8 +955,8 @@ static void alloc_hwxmits(struct _adapter *padapter)
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
pxmitpriv->hwxmit_entry = HWXMIT_ENTRY;
- pxmitpriv->hwxmits = (struct hw_xmit *)_malloc(sizeof(struct hw_xmit) *
- pxmitpriv->hwxmit_entry);
+ pxmitpriv->hwxmits = kmalloc(sizeof(struct hw_xmit) * pxmitpriv->hwxmit_entry,
+ GFP_ATOMIC);
if (pxmitpriv->hwxmits == NULL)
return;
hwxmits = pxmitpriv->hwxmits;