From: Greg Kroah-Hartman Date: Fri, 4 Sep 2015 01:55:43 +0000 (-0700) Subject: staging: wilc1000: remove another pointless kmalloc wrapper X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=47c632d829c6aea524cb57114ceef5c07bcf8d2c;p=openwrt%2Fstaging%2Fblogic.git 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 Cc: Rachel Kim Cc: Dean Lee Cc: Chris Park Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 903fc7c9fd4d..a9aefa50e59b 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -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; diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index c5fd55a4989c..970f6a9cc043 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -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; diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index b5aa83c61e1a..ed1ed00dd581 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -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 *);