Commit a18dd630 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d5df3797
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -549,14 +549,6 @@ static void linux_wlan_dbg(uint8_t *buff)
	PRINT_D(INIT_DBG, "%d\n", *buff);
}

void linux_wlan_free(void *vp)
{
	if (vp != NULL) {
		PRINT_D(MEM_DBG, "Freeing %p\n", vp);
		kfree(vp);
	}
}

static void linux_wlan_init_lock(char *lockName, void *plock, int count)
{
	sema_init((struct semaphore *)plock, count);
@@ -1470,7 +1462,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_free = linux_wlan_free;
	nwi->os_func.os_lock = linux_wlan_lock;
	nwi->os_func.os_unlock = linux_wlan_unlock;
	nwi->os_func.os_wait = linux_wlan_lock_timeout;
@@ -2112,7 +2103,7 @@ static void linux_wlan_tx_complete(void *priv, int status)
		PRINT_D(TX_DBG, "Couldn't send packet - Size = %d - Address = %p - SKB = %p\n", pv_data->size, pv_data->buff, pv_data->skb);
	/* Free the SK Buffer, its work is done */
	dev_kfree_skb(pv_data->skb);
	linux_wlan_free(pv_data);
	kfree(pv_data);
}

int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
+16 −29
Original line number Diff line number Diff line
@@ -459,7 +459,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(void)
				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 @@ static int wilc_wlan_handle_txq(uint32_t *pu32TxqCount)
					Pending_Acks_info[tqe->tcp_PendingAck_index].txqe = NULL;
				}
				#endif
				p->os_func.os_free(tqe);
				kfree(tqe);
			} else {
				break;
			}
@@ -1321,11 +1321,9 @@ static void wilc_wlan_handle_rxq(void)


#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 @@ static void wilc_wlan_handle_isr_ext(uint32_t int_status)
			}
		} else {
#ifndef MEMORY_STATIC
			if (buffer != NULL)
				p->os_func.os_free(buffer);
			kfree(buffer);
#endif
		}
	}
@@ -1567,8 +1564,7 @@ static int wilc_wlan_firmware_download(const uint8_t *buffer, uint32_t buffer_si

_fail_:

	if (dma_buffer)
		g_wlan.os_func.os_free(dma_buffer);
	kfree(dma_buffer);

_fail_1:

@@ -1800,7 +1796,7 @@ static void wilc_wlan_cleanup(void)
			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 @@ static void wilc_wlan_cleanup(void)
		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 @@ static void wilc_wlan_cleanup(void)
	 **/

	#ifdef MEMORY_STATIC
	if (p->rx_buffer) {
		p->os_func.os_free(p->rx_buffer);
	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 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup)
_fail_:

  #ifdef MEMORY_STATIC
	if (g_wlan.rx_buffer) {
		g_wlan.os_func.os_free(g_wlan.rx_buffer);
	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);
	kfree(g_wlan.tx_buffer);
	g_wlan.tx_buffer = NULL;
	}

#if defined(PLAT_RK3026_TCHIP) /* AMR : 0422 RK3026 Crash issue */
	if (!g_wilc_initialized)
+0 −1
Original line number Diff line number Diff line
@@ -87,7 +87,6 @@ typedef struct {
	void (*os_sleep)(uint32_t);
	void (*os_atomic_sleep)(uint32_t);
	void (*os_debug)(uint8_t *);
	void (*os_free)(void *);
	void (*os_lock)(void *);
	void (*os_unlock)(void *);
	int (*os_wait)(void *, u32);