]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
staging: wilc1000: remove another pointless kmalloc wrapper
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Sep 2015 01:55:43 +0000 (18:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 01:24:40 +0000 (18:24 -0700)
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>
drivers/staging/wilc1000/linux_wlan.c
drivers/staging/wilc1000/wilc_wlan.c
drivers/staging/wilc1000/wilc_wlan_if.h

index 903fc7c9fd4df409269ab46ec43e4c1f799cc4de..a9aefa50e59b77d4dbedba24ce68d4de63b14ac2 100644 (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;
index c5fd55a4989c714bfe68407dacdd14d2604d4e2c..970f6a9cc0434dea785905baf6ba13a93b7f0e57 100644 (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;
index b5aa83c61e1a5af56ad970080e520fbb5febafd3..ed1ed00dd5811b349316cc951b286077c2b132e1 100644 (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 *);