staging: wilc1000: use g_linux_wlan->rxq_cs for function arguemnt
authorGlen Lee <glen.lee@atmel.com>
Thu, 24 Sep 2015 09:14:57 +0000 (18:14 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 00:39:58 +0000 (02:39 +0200)
Use mutex variable g_linux_wlan->rxq_cs instead of pointer varialbe.
No need to make extra pointer variable for the mutex. Remove
rxq_critical_section, rxq_lock and it's related codes.

Signed-off-by: Glen Lee <glen.lee@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 d953ffe56ca6488728dc6c6f4802738a91c80188..71f996ca91dc927f3d8a34bcc84e2a2d4080f0c4 100644 (file)
@@ -1067,7 +1067,6 @@ void linux_to_wlan(wilc_wlan_inp_t *nwi, linux_wlan_t *nic)
 #if defined(MEMORY_STATIC)
        nwi->os_context.rx_buffer_size = LINUX_RX_SIZE;
 #endif
-       nwi->os_context.rxq_critical_section = (void *)&g_linux_wlan->rxq_cs;
        nwi->os_context.cfg_wait_event = (void *)&g_linux_wlan->cfg_event;
 
        nwi->os_func.os_wait = linux_wlan_lock_timeout;
index d908fc8e05ce757ddf356660b322f10bfd019df5..911c922d17cd57fb9b1acbe2714dec14592c2bf0 100644 (file)
@@ -81,7 +81,6 @@ typedef struct {
        /**
         *      RX queue
         **/
-       struct mutex *rxq_lock;
        struct rxq_entry_t *rxq_head;
        struct rxq_entry_t *rxq_tail;
        int rxq_entries;
@@ -605,7 +604,7 @@ static int wilc_wlan_rxq_add(struct rxq_entry_t *rqe)
        if (p->quit)
                return 0;
 
-       mutex_lock(p->rxq_lock);
+       mutex_lock(&g_linux_wlan->rxq_cs);
        if (p->rxq_head == NULL) {
                PRINT_D(RX_DBG, "Add to Queue head\n");
                rqe->next = NULL;
@@ -619,7 +618,7 @@ static int wilc_wlan_rxq_add(struct rxq_entry_t *rqe)
        }
        p->rxq_entries += 1;
        PRINT_D(RX_DBG, "Number of queue entries: %d\n", p->rxq_entries);
-       mutex_unlock(p->rxq_lock);
+       mutex_unlock(&g_linux_wlan->rxq_cs);
        return p->rxq_entries;
 }
 
@@ -631,12 +630,12 @@ static struct rxq_entry_t *wilc_wlan_rxq_remove(void)
        if (p->rxq_head) {
                struct rxq_entry_t *rqe;
 
-               mutex_lock(p->rxq_lock);
+               mutex_lock(&g_linux_wlan->rxq_cs);
                rqe = p->rxq_head;
                p->rxq_head = p->rxq_head->next;
                p->rxq_entries -= 1;
                PRINT_D(RX_DBG, "RXQ entries decreased\n");
-               mutex_unlock(p->rxq_lock);
+               mutex_unlock(&g_linux_wlan->rxq_cs);
                return rqe;
        }
        PRINT_D(RX_DBG, "Nothing to get from Q\n");
@@ -1974,7 +1973,6 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup)
 
        g_wlan.txq_add_to_head_lock = inp->os_context.txq_add_to_head_critical_section;
 
-       g_wlan.rxq_lock = inp->os_context.rxq_critical_section;
        g_wlan.txq_wait = inp->os_context.txq_wait_event;
        g_wlan.cfg_wait = inp->os_context.cfg_wait_event;
        g_wlan.tx_buffer_size = inp->os_context.tx_buffer_size;
index db87811fa30f0278452285267946e0c424f156f2..60943059d37a0393674b5dbdd0d7353f6f0e3eda 100644 (file)
@@ -120,7 +120,6 @@ typedef struct {
 #if defined(MEMORY_STATIC)
        u32 rx_buffer_size;
 #endif
-       void *rxq_critical_section;
 
        struct semaphore *cfg_wait_event;
 } wilc_wlan_os_context_t;
This page took 0.027526 seconds and 5 git commands to generate.