staging: wilc1000: remove pointer variables of txq_add_to_head_cs
authorGlen Lee <glen.lee@atmel.com>
Thu, 24 Sep 2015 09:15:00 +0000 (18:15 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 00:39:58 +0000 (02:39 +0200)
This patch removes txq_add_to_head_critical_section and txq_add_to_head_lock
which are pointer of g_linux_wlan->txq_add_to_head_cs.
Just use g_linux_wlan->txq_add_to_head_cs as argument of function.

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 28937766c29b01e14f7ddb4e0b841d0327da867f..61161b9825412f576b7e0286954190e1f9d79d45 100644 (file)
@@ -1059,9 +1059,6 @@ void linux_to_wlan(wilc_wlan_inp_t *nwi, linux_wlan_t *nic)
        nwi->os_context.os_private = (void *)nic;
        nwi->os_context.tx_buffer_size = LINUX_TX_SIZE;
        nwi->os_context.txq_critical_section = (void *)&g_linux_wlan->txq_cs;
-
-       nwi->os_context.txq_add_to_head_critical_section = (void *)&g_linux_wlan->txq_add_to_head_cs;
-
 #if defined(MEMORY_STATIC)
        nwi->os_context.rx_buffer_size = LINUX_RX_SIZE;
 #endif
index fe7382e65ff9799ecdb4041342ac09f1d0955f71..bfeb9768aac6bb39fad081eaa413feb9703741a0 100644 (file)
@@ -68,7 +68,6 @@ typedef struct {
         **/
        void *txq_lock;
 
-       struct semaphore *txq_add_to_head_lock;
        unsigned long txq_spinlock_flags;
 
        struct txq_entry_t *txq_head;
@@ -228,7 +227,8 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe)
 {
        wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
        unsigned long flags;
-       if (p->os_func.os_wait(p->txq_add_to_head_lock, CFG_PKTS_TIMEOUT))
+       if (p->os_func.os_wait(&g_linux_wlan->txq_add_to_head_cs,
+                              CFG_PKTS_TIMEOUT))
                return -1;
 
        spin_lock_irqsave(&g_linux_wlan->txq_spinlock, flags);
@@ -248,7 +248,7 @@ static int wilc_wlan_txq_add_to_head(struct txq_entry_t *tqe)
        PRINT_D(TX_DBG, "Number of entries in TxQ = %d\n", p->txq_entries);
 
        spin_unlock_irqrestore(&g_linux_wlan->txq_spinlock, flags);
-       up(p->txq_add_to_head_lock);
+       up(&g_linux_wlan->txq_add_to_head_cs);
 
 
        /**
@@ -843,7 +843,8 @@ static int wilc_wlan_handle_txq(u32 *pu32TxqCount)
                if (p->quit)
                        break;
 
-               p->os_func.os_wait(p->txq_add_to_head_lock, CFG_PKTS_TIMEOUT);
+               p->os_func.os_wait(&g_linux_wlan->txq_add_to_head_cs,
+                                  CFG_PKTS_TIMEOUT);
 #ifdef TCP_ACK_FILTER
                wilc_wlan_txq_filter_dup_tcp_ack();
 #endif
@@ -1112,7 +1113,7 @@ _end_:
                if (ret != 1)
                        break;
        } while (0);
-       up(p->txq_add_to_head_lock);
+       up(&g_linux_wlan->txq_add_to_head_cs);
 
        p->txq_exit = 1;
        PRINT_D(TX_DBG, "THREAD: Exiting txq\n");
@@ -1971,8 +1972,6 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup)
        g_wlan.hif_lock = inp->os_context.hif_critical_section;
        g_wlan.txq_lock = inp->os_context.txq_critical_section;
 
-       g_wlan.txq_add_to_head_lock = inp->os_context.txq_add_to_head_critical_section;
-
        g_wlan.tx_buffer_size = inp->os_context.tx_buffer_size;
 #if defined (MEMORY_STATIC)
        g_wlan.rx_buffer_size = inp->os_context.rx_buffer_size;
index b1de65bbc80d173aac84854438628179a9dbb33c..93e9fbdf08822397239346ceadccdc662e52e5ab 100644 (file)
@@ -112,9 +112,6 @@ typedef struct {
 
        u32 tx_buffer_size;
        void *txq_critical_section;
-
-       void *txq_add_to_head_critical_section;
-
 #if defined(MEMORY_STATIC)
        u32 rx_buffer_size;
 #endif