From patchwork Thu Sep 24 09:15:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glen Lee X-Patchwork-Id: 7254651 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 B29F8BEEC1 for ; Thu, 24 Sep 2015 09:14:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DC2BE208EB for ; Thu, 24 Sep 2015 09:14:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E88ED206E4 for ; Thu, 24 Sep 2015 09:14:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753209AbbIXJOZ (ORCPT ); Thu, 24 Sep 2015 05:14:25 -0400 Received: from eusmtp01.atmel.com ([212.144.249.242]:25662 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752234AbbIXJOY (ORCPT ); Thu, 24 Sep 2015 05:14:24 -0400 Received: from glen-ubuntu.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.30) with Microsoft SMTP Server id 14.3.235.1; Thu, 24 Sep 2015 11:14:18 +0200 From: Glen Lee To: CC: , , , , , , , , , , , Subject: [PATCH 15/15] staging: wilc1000: remove variable cif_func Date: Thu, 24 Sep 2015 18:15:06 +0900 Message-ID: <1443086106-20482-15-git-send-email-glen.lee@atmel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1443086106-20482-1-git-send-email-glen.lee@atmel.com> References: <1443086106-20482-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 removes variable cif_func and use mac_cfg directly. No need to have another pointer variable. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_wlan.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 24a3aa1..1937d7d 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -40,7 +40,6 @@ typedef struct { /** * configuration interface functions **/ - wilc_cfg_func_t cif_func; int cfg_frame_in_use; wilc_cfg_frame_t cfg_frame; u32 cfg_frame_offset; @@ -1199,7 +1198,7 @@ static void wilc_wlan_handle_rxq(void) - p->cif_func.rx_indicate(&buffer[pkt_offset + offset], pkt_len, &rsp); + mac_cfg.rx_indicate(&buffer[pkt_offset + offset], pkt_len, &rsp); if (rsp.type == WILC_CFG_RSP) { /** * wake up the waiting task... @@ -1764,7 +1763,8 @@ static int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size, in p->cfg_frame_offset = 0; offset = p->cfg_frame_offset; - ret_size = p->cif_func.cfg_wid_set(p->cfg_frame.frame, offset, (u16)wid, buffer, buffer_size); + ret_size = mac_cfg.cfg_wid_set(p->cfg_frame.frame, offset, (u16)wid, + buffer, buffer_size); offset += ret_size; p->cfg_frame_offset = offset; @@ -1803,7 +1803,7 @@ static int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler) p->cfg_frame_offset = 0; offset = p->cfg_frame_offset; - ret_size = p->cif_func.cfg_wid_get(p->cfg_frame.frame, offset, (u16)wid); + ret_size = mac_cfg.cfg_wid_get(p->cfg_frame.frame, offset, (u16)wid); offset += ret_size; p->cfg_frame_offset = offset; @@ -1830,10 +1830,9 @@ static int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drvHandler) static int wilc_wlan_cfg_get_val(u32 wid, u8 *buffer, u32 buffer_size) { - wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan; int ret; - ret = p->cif_func.cfg_wid_get_val((u16)wid, buffer, buffer_size); + ret = mac_cfg.cfg_wid_get_val((u16)wid, buffer, buffer_size); return ret; } @@ -1999,8 +1998,6 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup) ret = -105; goto _fail_; } - memcpy((void *)&g_wlan.cif_func, &mac_cfg, sizeof(wilc_cfg_func_t)); - /** * alloc tx, rx buffer