From: Jim C. <jim...@gm...> - 2012-05-21 19:45:50
|
Replace ACX_FREE_QUEUE, ACX_FREE_QUEUES macros with acx_free_desc_queue, called 4 times from acx_free_desc_queues(). Drop stub ACX_FREE_QUEUES from merge.h, and 1 other commented fn-proto. Signed-off-by: Jim Cromie <jim...@gm...> --- merge.c | 39 ++++++++++++++++++--------------------- merge.h | 5 ----- 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/merge.c b/merge.c index 5b4eea6..83e4904 100644 --- a/merge.c +++ b/merge.c @@ -698,6 +698,20 @@ out: /* ########################################## */ /* free desc_queue stuff */ +static inline void acx_free_desc_queue(acx_device_t *adev, + struct desc_info *dinfo) +{ + if (dinfo->start) { + if (IS_PCI(adev)) + acxpci_free_coherent(NULL, dinfo->size, dinfo->start, + dinfo->phy); + else + kfree(dinfo->start); + dinfo->start = NULL; + dinfo->size = 0; + } +} + /* * acx_free_desc_queues * @@ -707,31 +721,14 @@ out: */ void acx_free_desc_queues(acx_device_t *adev) { - -#define ACX_FREE_QUEUE(adev, size, ptr, phyaddr) \ - if (ptr) { \ - if (IS_PCI(adev)) \ - acxpci_free_coherent(NULL, size, ptr, phyaddr); \ - else \ - kfree(ptr); \ - ptr = NULL; \ - size = 0; \ - } - -#ifndef ACX_FREE_QUEUES -#define ACX_FREE_QUEUES(adev, _dir_) \ - ACX_FREE_QUEUE(adev, adev->_dir_.host.size, \ - adev->_dir_.host.start, adev->_dir_.host.phy); \ - ACX_FREE_QUEUE(adev, adev->_dir_.buf.size, \ - adev->_dir_.buf.start, adev->_dir_.buf.phy) -#endif // ACX_FREE_QUEUES - FN_ENTER; - ACX_FREE_QUEUES(adev, tx); + acx_free_desc_queue(adev, &adev->tx.host); + acx_free_desc_queue(adev, &adev->tx.buf); adev->tx.desc_start = NULL; - ACX_FREE_QUEUES(adev, rx); + acx_free_desc_queue(adev, &adev->rx.host); + acx_free_desc_queue(adev, &adev->rx.buf); adev->rx.desc_start = NULL; FN_EXIT0; diff --git a/merge.h b/merge.h index 6fdac68..0fbc4a4 100644 --- a/merge.h +++ b/merge.h @@ -165,11 +165,9 @@ DECL_OR_STUB ( PCI_OR_MEM, void *_acx_get_txbuf(acx_device_t * adev, tx_t * tx_opaque), { return (void*) NULL; } ) -//void acx_process_rxdesc(acx_device_t *adev); #if (defined CONFIG_ACX_MAC80211_PCI || defined CONFIG_ACX_MAC80211_MEM) -void acxmem_update_queue_indicator(acx_device_t *adev, int txqueue); static inline txdesc_t* acx_get_txdesc(acx_device_t *adev, int index) { @@ -193,9 +191,6 @@ static inline txdesc_t* acx_advance_txdesc(acx_device_t *adev, txdesc_t* txdesc, int inc) { return (txdesc_t*) NULL; } -/* empty stub here, real one in merge.c */ -#define ACX_FREE_QUEUES(adev, _dir_) - #endif /* !(CONFIG_ACX_MAC80211_PCI || CONFIG_ACX_MAC80211_MEM) */ #endif /* _MERGE_H_ */ -- 1.7.10.1.487.ga3935e6 |