staging: wilc1000: remove another pointless kmalloc wrapper

Call kmalloc directly, don't make a special "atomic" function pointer to
call it instead.

Cc: Johnny Kim <johnny.kim@atmel.com>
Cc: Rachel Kim <rachel.kim@atmel.com>
Cc: Dean Lee <dean.lee@atmel.com>
Cc: Chris Park <chris.park@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Greg Kroah-Hartman 2015-09-03 18:55:43 -07:00
commit 47c632d829
3 changed files with 4 additions and 15 deletions

View file

@ -550,15 +550,6 @@ static void linux_wlan_dbg(uint8_t *buff)
PRINT_D(INIT_DBG, "%d\n", *buff);
}
static void *linux_wlan_malloc_atomic(uint32_t sz)
{
char *pntr = NULL;
pntr = kmalloc(sz, GFP_ATOMIC);
PRINT_D(MEM_DBG, "Allocating %d bytes at address %p\n", sz, pntr);
return (void *)pntr;
}
void linux_wlan_free(void *vp)
{
if (vp != NULL) {
@ -1489,7 +1480,6 @@ void linux_to_wlan(wilc_wlan_inp_t *nwi, linux_wlan_t *nic)
nwi->os_func.os_sleep = linux_wlan_msleep;
nwi->os_func.os_atomic_sleep = linux_wlan_atomic_msleep;
nwi->os_func.os_debug = linux_wlan_dbg;
nwi->os_func.os_malloc_atomic = linux_wlan_malloc_atomic;
nwi->os_func.os_free = linux_wlan_free;
nwi->os_func.os_lock = linux_wlan_lock;
nwi->os_func.os_unlock = linux_wlan_unlock;

View file

@ -511,7 +511,7 @@ static int wilc_wlan_txq_add_cfg_pkt(uint8_t *buffer, uint32_t buffer_size)
return 0;
}
tqe = (struct txq_entry_t *)p->os_func.os_malloc_atomic(sizeof(struct txq_entry_t));
tqe = kmalloc(sizeof(struct txq_entry_t), GFP_ATOMIC);
if (tqe == NULL) {
PRINT_ER("Failed to allocate memory\n");
return 0;
@ -544,7 +544,7 @@ static int wilc_wlan_txq_add_net_pkt(void *priv, uint8_t *buffer, uint32_t buffe
if (p->quit)
return 0;
tqe = (struct txq_entry_t *)p->os_func.os_malloc_atomic(sizeof(struct txq_entry_t));
tqe = kmalloc(sizeof(struct txq_entry_t), GFP_ATOMIC);
if (tqe == NULL)
return 0;
@ -577,7 +577,7 @@ int wilc_wlan_txq_add_mgmt_pkt(void *priv, uint8_t *buffer, uint32_t buffer_size
if (p->quit)
return 0;
tqe = (struct txq_entry_t *)p->os_func.os_malloc_atomic(sizeof(struct txq_entry_t));
tqe = kmalloc(sizeof(struct txq_entry_t), GFP_KERNEL);
if (tqe == NULL)
return 0;
@ -603,7 +603,7 @@ int wilc_FH_wlan_txq_add_net_pkt(void *priv, uint8_t *buffer, uint32_t buffer_si
if (p->quit)
return 0;
tqe = (struct txq_entry_t *)p->os_func.os_malloc_atomic(sizeof(struct txq_entry_t));
tqe = kmalloc(sizeof(struct txq_entry_t), GFP_ATOMIC);
if (tqe == NULL)
return 0;

View file

@ -87,7 +87,6 @@ typedef struct {
void (*os_sleep)(uint32_t);
void (*os_atomic_sleep)(uint32_t);
void (*os_debug)(uint8_t *);
void *(*os_malloc_atomic)(uint32_t);
void (*os_free)(void *);
void (*os_lock)(void *);
void (*os_unlock)(void *);