staging: wilc1000: remove pointless kfree wrapper
It isn't needed, and we were checking if a buffer was not NULL multiple
times, no one had ever looked at the code :(
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>
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 970f6a9..95897bf 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -459,7 +459,7 @@
tqe->status = 1; /* mark the packet send */
if (tqe->tx_complete_func)
tqe->tx_complete_func(tqe->priv, tqe->status);
- p->os_func.os_free(tqe);
+ kfree(tqe);
Dropped++;
}
}
@@ -1160,7 +1160,7 @@
Pending_Acks_info[tqe->tcp_PendingAck_index].txqe = NULL;
}
#endif
- p->os_func.os_free(tqe);
+ kfree(tqe);
} else {
break;
}
@@ -1321,11 +1321,9 @@
#ifndef MEMORY_STATIC
- if (buffer != NULL)
- p->os_func.os_free((void *)buffer);
+ kfree(buffer);
#endif
- if (rqe != NULL)
- p->os_func.os_free((void *)rqe);
+ kfree(rqe);
if (has_packet) {
if (p->net_func.rx_complete)
@@ -1458,8 +1456,7 @@
}
} else {
#ifndef MEMORY_STATIC
- if (buffer != NULL)
- p->os_func.os_free(buffer);
+ kfree(buffer);
#endif
}
}
@@ -1567,8 +1564,7 @@
_fail_:
- if (dma_buffer)
- g_wlan.os_func.os_free(dma_buffer);
+ kfree(dma_buffer);
_fail_1:
@@ -1800,7 +1796,7 @@
break;
if (tqe->tx_complete_func)
tqe->tx_complete_func(tqe->priv, 0);
- p->os_func.os_free((void *)tqe);
+ kfree(tqe);
} while (1);
do {
@@ -1808,9 +1804,9 @@
if (rqe == NULL)
break;
#ifdef MEMORY_DYNAMIC
- p->os_func.os_free((void *)tqe->buffer);
+ kfree(tqe->buffer);
#endif
- p->os_func.os_free((void *)rqe);
+ kfree(rqe);
} while (1);
/**
@@ -1818,15 +1814,10 @@
**/
#ifdef MEMORY_STATIC
- if (p->rx_buffer) {
- p->os_func.os_free(p->rx_buffer);
- p->rx_buffer = NULL;
- }
+ kfree(p->rx_buffer);
+ p->rx_buffer = NULL;
#endif
- if (p->tx_buffer) {
- p->os_func.os_free(p->tx_buffer);
- p->tx_buffer = NULL;
- }
+ kfree(p->tx_buffer);
acquire_bus(ACQUIRE_AND_WAKEUP);
@@ -2240,15 +2231,11 @@
_fail_:
#ifdef MEMORY_STATIC
- if (g_wlan.rx_buffer) {
- g_wlan.os_func.os_free(g_wlan.rx_buffer);
- g_wlan.rx_buffer = NULL;
- }
+ kfree(g_wlan.rx_buffer);
+ g_wlan.rx_buffer = NULL;
#endif
- if (g_wlan.tx_buffer) {
- g_wlan.os_func.os_free(g_wlan.tx_buffer);
- g_wlan.tx_buffer = NULL;
- }
+ kfree(g_wlan.tx_buffer);
+ g_wlan.tx_buffer = NULL;
#if defined(PLAT_RK3026_TCHIP) /* AMR : 0422 RK3026 Crash issue */
if (!g_wilc_initialized)