diff options
author | Vitaly Osipov <vitaly.osipov@gmail.com> | 2014-05-24 18:19:27 +1000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-25 11:04:44 -0700 |
commit | 91d435fe368ab30702d7bcd50f680e7185899295 (patch) | |
tree | 2415c6d2ad015124be711c82499e0affd6ef89fb /drivers/staging/rtl8712/hal_init.c | |
parent | staging: slicoss: clean up use of dev_err (diff) | |
download | linux-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/hal_init.c')
-rw-r--r-- | drivers/staging/rtl8712/hal_init.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8712/hal_init.c b/drivers/staging/rtl8712/hal_init.c index d801c5af006a..36de7e478f32 100644 --- a/drivers/staging/rtl8712/hal_init.c +++ b/drivers/staging/rtl8712/hal_init.c @@ -183,7 +183,7 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) maxlen = (fwhdr.img_IMEM_size > fwhdr.img_SRAM_size) ? fwhdr.img_IMEM_size : fwhdr.img_SRAM_size; maxlen += txdscp_sz; - ptmpchar = _malloc(maxlen + FWBUFF_ALIGN_SZ); + ptmpchar = kmalloc(maxlen + FWBUFF_ALIGN_SZ, GFP_ATOMIC); if (ptmpchar == NULL) return ret; |