From patchwork Fri Mar 2 14:22:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10254771 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6CBBB602B5 for ; Fri, 2 Mar 2018 14:23:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B1B6289A7 for ; Fri, 2 Mar 2018 14:23:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F1C2289B1; Fri, 2 Mar 2018 14:23:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51E6B289A7 for ; Fri, 2 Mar 2018 14:23:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425584AbeCBOXa (ORCPT ); Fri, 2 Mar 2018 09:23:30 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:14194 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425508AbeCBOX2 (ORCPT ); Fri, 2 Mar 2018 09:23:28 -0500 X-IronPort-AV: E=Sophos;i="5.47,412,1515481200"; d="scan'208";a="9321480" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Mar 2018 07:23:28 -0700 Received: from ajaysk-VirtualBox.mchp-main.com (10.10.76.4) by chn-sv-exch05.mchp-main.com (10.10.76.106) with Microsoft SMTP Server id 14.3.352.0; Fri, 2 Mar 2018 07:23:27 -0700 From: Ajay Singh To: CC: , , , , , , , Ajay Singh Subject: [PATCH 03/13] staging: wilc1000: fix line over 80 char in handle_cfg_param() Date: Fri, 2 Mar 2018 19:52:39 +0530 Message-ID: <1520000569-27738-4-git-send-email-ajay.kathat@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520000569-27738-1-git-send-email-ajay.kathat@microchip.com> References: <1520000569-27738-1-git-send-email-ajay.kathat@microchip.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-Virus-Scanned: ClamAV using ClamSMTP Fix 'line over 80 char' issues found by checkpatch.pl script in handle_cfg_param(). Rename variables and used temporary variables to fix the line over 80 characters issue. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/host_interface.c | 175 +++++++++++++++++------------- 1 file changed, 98 insertions(+), 77 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index f992e5d..cabee47 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -469,8 +469,7 @@ static void handle_get_mac_address(struct wilc_vif *vif, complete(&hif_wait_response); } -static void handle_cfg_param(struct wilc_vif *vif, - struct cfg_param_attr *cfg_param_attr) +static void handle_cfg_param(struct wilc_vif *vif, struct cfg_param_attr *param) { int ret = 0; struct wid wid_list[32]; @@ -479,12 +478,12 @@ static void handle_cfg_param(struct wilc_vif *vif, mutex_lock(&hif_drv->cfg_values_lock); - if (cfg_param_attr->flag & BSS_TYPE) { - u8 bss_type = cfg_param_attr->bss_type; + if (param->flag & BSS_TYPE) { + u8 bss_type = param->bss_type; if (bss_type < 6) { wid_list[i].id = WID_BSS_TYPE; - wid_list[i].val = (s8 *)&bss_type; + wid_list[i].val = (s8 *)¶m->bss_type; wid_list[i].type = WID_CHAR; wid_list[i].size = sizeof(char); hif_drv->cfg_values.bss_type = bss_type; @@ -494,222 +493,244 @@ static void handle_cfg_param(struct wilc_vif *vif, } i++; } - if (cfg_param_attr->flag & AUTH_TYPE) { - if (cfg_param_attr->auth_type == 1 || - cfg_param_attr->auth_type == 2 || - cfg_param_attr->auth_type == 5) { + if (param->flag & AUTH_TYPE) { + u8 auth_type = param->auth_type; + + if (auth_type == 1 || auth_type == 2 || auth_type == 5) { wid_list[i].id = WID_AUTH_TYPE; - wid_list[i].val = (s8 *)&cfg_param_attr->auth_type; + wid_list[i].val = (s8 *)¶m->auth_type; wid_list[i].type = WID_CHAR; wid_list[i].size = sizeof(char); - hif_drv->cfg_values.auth_type = (u8)cfg_param_attr->auth_type; + hif_drv->cfg_values.auth_type = auth_type; } else { netdev_err(vif->ndev, "Impossible value\n"); goto unlock; } i++; } - if (cfg_param_attr->flag & AUTHEN_TIMEOUT) { - if (cfg_param_attr->auth_timeout > 0) { + if (param->flag & AUTHEN_TIMEOUT) { + if (param->auth_timeout > 0) { wid_list[i].id = WID_AUTH_TIMEOUT; - wid_list[i].val = (s8 *)&cfg_param_attr->auth_timeout; + wid_list[i].val = (s8 *)¶m->auth_timeout; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.auth_timeout = cfg_param_attr->auth_timeout; + hif_drv->cfg_values.auth_timeout = param->auth_timeout; } else { netdev_err(vif->ndev, "Range(1 ~ 65535) over\n"); goto unlock; } i++; } - if (cfg_param_attr->flag & POWER_MANAGEMENT) { - if (cfg_param_attr->power_mgmt_mode < 5) { + if (param->flag & POWER_MANAGEMENT) { + u8 pm_mode = param->power_mgmt_mode; + + if (pm_mode < 5) { wid_list[i].id = WID_POWER_MANAGEMENT; - wid_list[i].val = (s8 *)&cfg_param_attr->power_mgmt_mode; + wid_list[i].val = (s8 *)¶m->power_mgmt_mode; wid_list[i].type = WID_CHAR; wid_list[i].size = sizeof(char); - hif_drv->cfg_values.power_mgmt_mode = (u8)cfg_param_attr->power_mgmt_mode; + hif_drv->cfg_values.power_mgmt_mode = pm_mode; } else { netdev_err(vif->ndev, "Invalid power mode\n"); goto unlock; } i++; } - if (cfg_param_attr->flag & RETRY_SHORT) { - if (cfg_param_attr->short_retry_limit > 0 && - cfg_param_attr->short_retry_limit < 256) { + if (param->flag & RETRY_SHORT) { + u16 retry_limit = param->short_retry_limit; + + if (retry_limit > 0 && retry_limit < 256) { wid_list[i].id = WID_SHORT_RETRY_LIMIT; - wid_list[i].val = (s8 *)&cfg_param_attr->short_retry_limit; + wid_list[i].val = (s8 *)¶m->short_retry_limit; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.short_retry_limit = cfg_param_attr->short_retry_limit; + hif_drv->cfg_values.short_retry_limit = retry_limit; } else { netdev_err(vif->ndev, "Range(1~256) over\n"); goto unlock; } i++; } - if (cfg_param_attr->flag & RETRY_LONG) { - if (cfg_param_attr->long_retry_limit > 0 && - cfg_param_attr->long_retry_limit < 256) { + if (param->flag & RETRY_LONG) { + u16 limit = param->long_retry_limit; + + if (limit > 0 && limit < 256) { wid_list[i].id = WID_LONG_RETRY_LIMIT; - wid_list[i].val = (s8 *)&cfg_param_attr->long_retry_limit; + wid_list[i].val = (s8 *)¶m->long_retry_limit; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.long_retry_limit = cfg_param_attr->long_retry_limit; + hif_drv->cfg_values.long_retry_limit = limit; } else { netdev_err(vif->ndev, "Range(1~256) over\n"); goto unlock; } i++; } - if (cfg_param_attr->flag & FRAG_THRESHOLD) { - if (cfg_param_attr->frag_threshold > 255 && - cfg_param_attr->frag_threshold < 7937) { + if (param->flag & FRAG_THRESHOLD) { + u16 frag_th = param->frag_threshold; + + if (frag_th > 255 && frag_th < 7937) { wid_list[i].id = WID_FRAG_THRESHOLD; - wid_list[i].val = (s8 *)&cfg_param_attr->frag_threshold; + wid_list[i].val = (s8 *)¶m->frag_threshold; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.frag_threshold = cfg_param_attr->frag_threshold; + hif_drv->cfg_values.frag_threshold = frag_th; } else { netdev_err(vif->ndev, "Threshold Range fail\n"); goto unlock; } i++; } - if (cfg_param_attr->flag & RTS_THRESHOLD) { - if (cfg_param_attr->rts_threshold > 255) { + if (param->flag & RTS_THRESHOLD) { + u16 rts_th = param->rts_threshold; + + if (rts_th > 255) { wid_list[i].id = WID_RTS_THRESHOLD; - wid_list[i].val = (s8 *)&cfg_param_attr->rts_threshold; + wid_list[i].val = (s8 *)¶m->rts_threshold; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.rts_threshold = cfg_param_attr->rts_threshold; + hif_drv->cfg_values.rts_threshold = rts_th; } else { netdev_err(vif->ndev, "Threshold Range fail\n"); goto unlock; } i++; } - if (cfg_param_attr->flag & PREAMBLE) { - if (cfg_param_attr->preamble_type < 3) { + if (param->flag & PREAMBLE) { + u16 preamble_type = param->preamble_type; + + if (param->preamble_type < 3) { wid_list[i].id = WID_PREAMBLE; - wid_list[i].val = (s8 *)&cfg_param_attr->preamble_type; + wid_list[i].val = (s8 *)¶m->preamble_type; wid_list[i].type = WID_CHAR; wid_list[i].size = sizeof(char); - hif_drv->cfg_values.preamble_type = cfg_param_attr->preamble_type; + hif_drv->cfg_values.preamble_type = preamble_type; } else { netdev_err(vif->ndev, "Preamle Range(0~2) over\n"); goto unlock; } i++; } - if (cfg_param_attr->flag & SHORT_SLOT_ALLOWED) { - if (cfg_param_attr->short_slot_allowed < 2) { + if (param->flag & SHORT_SLOT_ALLOWED) { + u8 slot_allowed = param->short_slot_allowed; + + if (slot_allowed < 2) { wid_list[i].id = WID_SHORT_SLOT_ALLOWED; - wid_list[i].val = (s8 *)&cfg_param_attr->short_slot_allowed; + wid_list[i].val = (s8 *)¶m->short_slot_allowed; wid_list[i].type = WID_CHAR; wid_list[i].size = sizeof(char); - hif_drv->cfg_values.short_slot_allowed = (u8)cfg_param_attr->short_slot_allowed; + hif_drv->cfg_values.short_slot_allowed = slot_allowed; } else { netdev_err(vif->ndev, "Short slot(2) over\n"); goto unlock; } i++; } - if (cfg_param_attr->flag & TXOP_PROT_DISABLE) { - if (cfg_param_attr->txop_prot_disabled < 2) { + if (param->flag & TXOP_PROT_DISABLE) { + u8 prot_disabled = param->txop_prot_disabled; + + if (param->txop_prot_disabled < 2) { wid_list[i].id = WID_11N_TXOP_PROT_DISABLE; - wid_list[i].val = (s8 *)&cfg_param_attr->txop_prot_disabled; + wid_list[i].val = (s8 *)¶m->txop_prot_disabled; wid_list[i].type = WID_CHAR; wid_list[i].size = sizeof(char); - hif_drv->cfg_values.txop_prot_disabled = (u8)cfg_param_attr->txop_prot_disabled; + hif_drv->cfg_values.txop_prot_disabled = prot_disabled; } else { netdev_err(vif->ndev, "TXOP prot disable\n"); goto unlock; } i++; } - if (cfg_param_attr->flag & BEACON_INTERVAL) { - if (cfg_param_attr->beacon_interval > 0) { + if (param->flag & BEACON_INTERVAL) { + u16 beacon_interval = param->beacon_interval; + + if (beacon_interval > 0) { wid_list[i].id = WID_BEACON_INTERVAL; - wid_list[i].val = (s8 *)&cfg_param_attr->beacon_interval; + wid_list[i].val = (s8 *)¶m->beacon_interval; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.beacon_interval = cfg_param_attr->beacon_interval; + hif_drv->cfg_values.beacon_interval = beacon_interval; } else { netdev_err(vif->ndev, "Beacon interval(1~65535)fail\n"); goto unlock; } i++; } - if (cfg_param_attr->flag & DTIM_PERIOD) { - if (cfg_param_attr->dtim_period > 0 && - cfg_param_attr->dtim_period < 256) { + if (param->flag & DTIM_PERIOD) { + if (param->dtim_period > 0 && param->dtim_period < 256) { wid_list[i].id = WID_DTIM_PERIOD; - wid_list[i].val = (s8 *)&cfg_param_attr->dtim_period; + wid_list[i].val = (s8 *)¶m->dtim_period; wid_list[i].type = WID_CHAR; wid_list[i].size = sizeof(char); - hif_drv->cfg_values.dtim_period = cfg_param_attr->dtim_period; + hif_drv->cfg_values.dtim_period = param->dtim_period; } else { netdev_err(vif->ndev, "DTIM range(1~255) fail\n"); goto unlock; } i++; } - if (cfg_param_attr->flag & SITE_SURVEY) { - if (cfg_param_attr->site_survey_enabled < 3) { + if (param->flag & SITE_SURVEY) { + enum SITESURVEY enabled = param->site_survey_enabled; + + if (enabled < 3) { wid_list[i].id = WID_SITE_SURVEY; - wid_list[i].val = (s8 *)&cfg_param_attr->site_survey_enabled; + wid_list[i].val = (s8 *)¶m->site_survey_enabled; wid_list[i].type = WID_CHAR; wid_list[i].size = sizeof(char); - hif_drv->cfg_values.site_survey_enabled = (u8)cfg_param_attr->site_survey_enabled; + hif_drv->cfg_values.site_survey_enabled = enabled; } else { netdev_err(vif->ndev, "Site survey disable\n"); goto unlock; } i++; } - if (cfg_param_attr->flag & SITE_SURVEY_SCAN_TIME) { - if (cfg_param_attr->site_survey_scan_time > 0) { + if (param->flag & SITE_SURVEY_SCAN_TIME) { + u16 scan_time = param->site_survey_scan_time; + + if (scan_time > 0) { wid_list[i].id = WID_SITE_SURVEY_SCAN_TIME; - wid_list[i].val = (s8 *)&cfg_param_attr->site_survey_scan_time; + wid_list[i].val = (s8 *)¶m->site_survey_scan_time; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.site_survey_scan_time = cfg_param_attr->site_survey_scan_time; + hif_drv->cfg_values.site_survey_scan_time = scan_time; } else { netdev_err(vif->ndev, "Site scan time(1~65535) over\n"); goto unlock; } i++; } - if (cfg_param_attr->flag & ACTIVE_SCANTIME) { - if (cfg_param_attr->active_scan_time > 0) { + if (param->flag & ACTIVE_SCANTIME) { + u16 active_scan_time = param->active_scan_time; + + if (active_scan_time > 0) { wid_list[i].id = WID_ACTIVE_SCAN_TIME; - wid_list[i].val = (s8 *)&cfg_param_attr->active_scan_time; + wid_list[i].val = (s8 *)¶m->active_scan_time; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.active_scan_time = cfg_param_attr->active_scan_time; + hif_drv->cfg_values.active_scan_time = active_scan_time; } else { netdev_err(vif->ndev, "Active time(1~65535) over\n"); goto unlock; } i++; } - if (cfg_param_attr->flag & PASSIVE_SCANTIME) { - if (cfg_param_attr->passive_scan_time > 0) { + if (param->flag & PASSIVE_SCANTIME) { + u16 time = param->passive_scan_time; + + if (time > 0) { wid_list[i].id = WID_PASSIVE_SCAN_TIME; - wid_list[i].val = (s8 *)&cfg_param_attr->passive_scan_time; + wid_list[i].val = (s8 *)¶m->passive_scan_time; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.passive_scan_time = cfg_param_attr->passive_scan_time; + hif_drv->cfg_values.passive_scan_time = time; } else { netdev_err(vif->ndev, "Passive time(1~65535) over\n"); goto unlock; } i++; } - if (cfg_param_attr->flag & CURRENT_TX_RATE) { - enum CURRENT_TXRATE curr_tx_rate = cfg_param_attr->curr_tx_rate; + if (param->flag & CURRENT_TX_RATE) { + enum CURRENT_TXRATE curr_tx_rate = param->curr_tx_rate; if (curr_tx_rate == AUTORATE || curr_tx_rate == MBPS_1 || curr_tx_rate == MBPS_2 || curr_tx_rate == MBPS_5_5 ||