From patchwork Wed Sep 16 09:53:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Cho X-Patchwork-Id: 7193471 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A18E7BEEC1 for ; Wed, 16 Sep 2015 09:54:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ABC4620462 for ; Wed, 16 Sep 2015 09:54:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9B30420439 for ; Wed, 16 Sep 2015 09:54:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753642AbbIPJyI (ORCPT ); Wed, 16 Sep 2015 05:54:08 -0400 Received: from eusmtp01.atmel.com ([212.144.249.243]:40253 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753512AbbIPJyH (ORCPT ); Wed, 16 Sep 2015 05:54:07 -0400 Received: from tony-itx.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.31) with Microsoft SMTP Server id 14.3.235.1; Wed, 16 Sep 2015 11:54:02 +0200 From: Tony Cho To: CC: , , , , , , , , , , , Subject: [PATCH 6/8] staging: wilc1000: remove unused semaphore and it's related codes Date: Wed, 16 Sep 2015 18:53:25 +0900 Message-ID: <1442397207-20491-6-git-send-email-tony.cho@atmel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442397207-20491-1-git-send-email-tony.cho@atmel.com> References: <1442397207-20491-1-git-send-email-tony.cho@atmel.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Glen Lee Variable rxq_event, rxq_wait_event and rxq_wait have the same pointer. nwi->os_context.rxq_wait_event = (void *)&g_linux_wlan->rxq_event; g_wlan.rxq_wait = inp->os_context.rxq_wait_event; They are never aquired(down) since down function was only called in linux_wlan_rxq_task which was deleted in a previous patch. So delete variable rxq_event, rxq_wait_event, rxq_wait and it's related codes. Signed-off-by: Glen Lee Signed-off-by: Tony Cho --- drivers/staging/wilc1000/linux_wlan.c | 9 --------- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 - drivers/staging/wilc1000/wilc_wlan.c | 3 --- drivers/staging/wilc1000/wilc_wlan_if.h | 1 - 4 files changed, 14 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index f104a23..186e42e 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1088,10 +1088,6 @@ void wilc1000_wlan_deinit(linux_wlan_t *nic) #endif #endif - /* not sure if the following unlocks are needed or not*/ - if (&g_linux_wlan->rxq_event != NULL) - up(&g_linux_wlan->rxq_event); - if (&g_linux_wlan->txq_event != NULL) up(&g_linux_wlan->txq_event); @@ -1156,7 +1152,6 @@ int wlan_init_locks(linux_wlan_t *p_nic) sema_init(&g_linux_wlan->txq_add_to_head_cs, 1); sema_init(&g_linux_wlan->txq_event, 0); - sema_init(&g_linux_wlan->rxq_event, 0); sema_init(&g_linux_wlan->cfg_event, 0); sema_init(&g_linux_wlan->sync_event, 0); @@ -1207,7 +1202,6 @@ void linux_to_wlan(wilc_wlan_inp_t *nwi, linux_wlan_t *nic) 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.rxq_wait_event = (void *)&g_linux_wlan->rxq_event; nwi->os_context.cfg_wait_event = (void *)&g_linux_wlan->cfg_event; nwi->os_func.os_debug = linux_wlan_dbg; @@ -1282,7 +1276,6 @@ int wlan_initialize_threads(perInterface_wlan_t *nic) _fail_2: /*De-Initialize 2nd thread*/ g_linux_wlan->close = 1; - up(&g_linux_wlan->rxq_event); kthread_stop(g_linux_wlan->rxq_thread); #if (RX_BH_TYPE == RX_BH_KTHREAD) @@ -1301,8 +1294,6 @@ static void wlan_deinitialize_threads(linux_wlan_t *nic) g_linux_wlan->close = 1; PRINT_D(INIT_DBG, "Deinitializing Threads\n"); - if (&g_linux_wlan->rxq_event != NULL) - up(&g_linux_wlan->rxq_event); if (g_linux_wlan->rxq_thread != NULL) { kthread_stop(g_linux_wlan->rxq_thread); diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index c68df360..c98eab6 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -187,7 +187,6 @@ typedef struct { struct mutex rxq_cs; struct mutex hif_cs; - struct semaphore rxq_event; struct semaphore cfg_event; struct semaphore sync_event; struct semaphore txq_event; diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 1db4cc8..22310cc 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -90,7 +90,6 @@ typedef struct { struct rxq_entry_t *rxq_head; struct rxq_entry_t *rxq_tail; int rxq_entries; - void *rxq_wait; int rxq_exit; @@ -1398,7 +1397,6 @@ _end_: rqe->buffer_size = size; PRINT_D(RX_DBG, "rxq entery Size= %d - Address = %p\n", rqe->buffer_size, rqe->buffer); wilc_wlan_rxq_add(rqe); - up(p->rxq_wait); } } else { #ifndef MEMORY_STATIC @@ -2049,7 +2047,6 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup) g_wlan.rxq_lock = inp->os_context.rxq_critical_section; g_wlan.txq_wait = inp->os_context.txq_wait_event; - g_wlan.rxq_wait = inp->os_context.rxq_wait_event; g_wlan.cfg_wait = inp->os_context.cfg_wait_event; g_wlan.tx_buffer_size = inp->os_context.tx_buffer_size; #if defined (MEMORY_STATIC) diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index 3f5aa44..bccfcf9 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -137,7 +137,6 @@ typedef struct { u32 rx_buffer_size; #endif void *rxq_critical_section; - void *rxq_wait_event; struct semaphore *cfg_wait_event; } wilc_wlan_os_context_t;