Commit 22d8eeb3 authored by Bhaskar Singh's avatar Bhaskar Singh Committed by Greg Kroah-Hartman

staging: rtl8188eu: Removed a function and coded inline

This patch removed function named rtw_malloc2d.

I removed this function because this function is used exactly once and
function call have some overhead also.

Maybe this will improve code runtime slightly.
Signed-off-by: default avatarBhaskar Singh <bhaskar.kernel@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6c352cfd
...@@ -86,16 +86,20 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8 *pbuf) ...@@ -86,16 +86,20 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8 *pbuf)
u16 **eFuseWord = NULL; u16 **eFuseWord = NULL;
u16 efuse_utilized = 0; u16 efuse_utilized = 0;
u8 u1temp = 0; u8 u1temp = 0;
void **tmp = NULL;
efuseTbl = kzalloc(EFUSE_MAP_LEN_88E, GFP_KERNEL); efuseTbl = kzalloc(EFUSE_MAP_LEN_88E, GFP_KERNEL);
if (!efuseTbl) if (!efuseTbl)
return; return;
eFuseWord = (u16 **)rtw_malloc2d(EFUSE_MAX_SECTION_88E, EFUSE_MAX_WORD_UNIT, sizeof(u16)); tmp = kzalloc(EFUSE_MAX_SECTION_88E * (sizeof(void *) + EFUSE_MAX_WORD_UNIT * sizeof(u16)), GFP_KERNEL);
if (!eFuseWord) { if (!tmp) {
DBG_88E("%s: alloc eFuseWord fail!\n", __func__); DBG_88E("%s: alloc eFuseWord fail!\n", __func__);
goto eFuseWord_failed; goto eFuseWord_failed;
} }
for (i = 0; i < EFUSE_MAX_SECTION_88E; i++)
tmp[i] = ((char *)(tmp + EFUSE_MAX_SECTION_88E)) + i * EFUSE_MAX_WORD_UNIT * sizeof(u16);
eFuseWord = (u16 **)tmp;
/* 0. Refresh efuse init map as all oxFF. */ /* 0. Refresh efuse init map as all oxFF. */
for (i = 0; i < EFUSE_MAX_SECTION_88E; i++) for (i = 0; i < EFUSE_MAX_SECTION_88E; i++)
......
...@@ -64,8 +64,6 @@ static inline int rtw_netif_queue_stopped(struct net_device *pnetdev) ...@@ -64,8 +64,6 @@ static inline int rtw_netif_queue_stopped(struct net_device *pnetdev)
u8 *_rtw_malloc(u32 sz); u8 *_rtw_malloc(u32 sz);
#define rtw_malloc(sz) _rtw_malloc((sz)) #define rtw_malloc(sz) _rtw_malloc((sz))
void *rtw_malloc2d(int h, int w, int size);
void _rtw_init_queue(struct __queue *pqueue); void _rtw_init_queue(struct __queue *pqueue);
struct rtw_netdev_priv_indicator { struct rtw_netdev_priv_indicator {
......
...@@ -18,20 +18,6 @@ u8 *_rtw_malloc(u32 sz) ...@@ -18,20 +18,6 @@ u8 *_rtw_malloc(u32 sz)
return kmalloc(sz, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); return kmalloc(sz, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
} }
void *rtw_malloc2d(int h, int w, int size)
{
int j;
void **a = kzalloc(h * sizeof(void *) + h * w * size, GFP_KERNEL);
if (!a)
goto out;
for (j = 0; j < h; j++)
a[j] = ((char *)(a + h)) + j * w * size;
out:
return a;
}
void _rtw_init_queue(struct __queue *pqueue) void _rtw_init_queue(struct __queue *pqueue)
{ {
INIT_LIST_HEAD(&pqueue->queue); INIT_LIST_HEAD(&pqueue->queue);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment