From patchwork Mon Dec 21 05:18:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glen Lee X-Patchwork-Id: 7893451 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 EFAB7BEEE5 for ; Mon, 21 Dec 2015 05:19:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 20FAF202E9 for ; Mon, 21 Dec 2015 05:19:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28803202B8 for ; Mon, 21 Dec 2015 05:19:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751460AbbLUFTT (ORCPT ); Mon, 21 Dec 2015 00:19:19 -0500 Received: from eusmtp01.atmel.com ([212.144.249.243]:11843 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751439AbbLUFTS (ORCPT ); Mon, 21 Dec 2015 00:19:18 -0500 Received: from glen-ubuntu.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.31) with Microsoft SMTP Server id 14.3.235.1; Mon, 21 Dec 2015 06:19:15 +0100 From: Glen Lee To: CC: , , , , , , , , Subject: [PATCH RESEND 42/46] staging: wilc1000: remove used functions Date: Mon, 21 Dec 2015 14:18:46 +0900 Message-ID: <1450675130-17866-43-git-send-email-glen.lee@atmel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450675130-17866-1-git-send-email-glen.lee@atmel.com> References: <1450675130-17866-1-git-send-email-glen.lee@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, 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 This patch remove unused functions add_handler_in_list and remove_handler_in_list, and it's related global variable wfidrv_list and codes. label fail_timer_2 and it's codes are removed since label is not used anymore. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/host_interface.c | 44 ------------------------------- 1 file changed, 44 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index e9a206c..46e009e 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -226,7 +226,6 @@ struct join_bss_param { u8 start_time[4]; }; -static struct host_if_drv *wfidrv_list[NUM_CONCURRENT_IFC + 1]; struct host_if_drv *terminated_handle; bool wilc_optaining_ip; static u8 P2P_LISTEN_STATE; @@ -266,34 +265,6 @@ static struct wilc_vif *join_req_vif; static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo); -static int add_handler_in_list(struct host_if_drv *handler) -{ - int i; - - for (i = 1; i < ARRAY_SIZE(wfidrv_list); i++) { - if (!wfidrv_list[i]) { - wfidrv_list[i] = handler; - return 0; - } - } - - return -ENOBUFS; -} - -static int remove_handler_in_list(struct host_if_drv *handler) -{ - int i; - - for (i = 1; i < ARRAY_SIZE(wfidrv_list); i++) { - if (wfidrv_list[i] == handler) { - wfidrv_list[i] = NULL; - return 0; - } - } - - return -EINVAL; -} - /* The u8IfIdx starts from 0 to NUM_CONCURRENT_IFC -1, but 0 index used as * special purpose in wilc device, so we add 1 to the index to starts from 1. * As a result, the returned index will be 1 to NUM_CONCURRENT_IFC. @@ -3852,7 +3823,6 @@ s32 wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) { s32 result = 0; struct host_if_drv *hif_drv; - int err; struct wilc_vif *vif; struct wilc *wilc; @@ -3872,11 +3842,6 @@ s32 wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) } hif_drv->wilc = wilc; *hif_drv_handler = hif_drv; - err = add_handler_in_list(hif_drv); - if (err) { - result = -EFAULT; - goto _fail_timer_2; - } wilc_optaining_ip = false; @@ -3946,10 +3911,6 @@ s32 wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) return result; -_fail_timer_2: - del_timer_sync(&hif_drv->connect_timer); - del_timer_sync(&hif_drv->scan_timer); - kthread_stop(hif_thread_handler); _fail_mq_: wilc_mq_destroy(&hif_msg_q); _fail_: @@ -3961,7 +3922,6 @@ s32 wilc_deinit(struct wilc_vif *vif) s32 result = 0; struct host_if_msg msg; struct host_if_drv *hif_drv = vif->hif_drv; - int ret; if (!hif_drv) { PRINT_ER("hif_drv = NULL\n"); @@ -4016,10 +3976,6 @@ s32 wilc_deinit(struct wilc_vif *vif) wilc_mq_destroy(&hif_msg_q); } - ret = remove_handler_in_list(hif_drv); - if (ret) - result = -ENOENT; - kfree(hif_drv); clients_count--;