From patchwork Tue Feb 23 06:38:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaehyun Lim X-Patchwork-Id: 8387721 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6BEDA9F52D for ; Tue, 23 Feb 2016 06:38:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 082BE20546 for ; Tue, 23 Feb 2016 06:38:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C9B92052A for ; Tue, 23 Feb 2016 06:38:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932566AbcBWGiW (ORCPT ); Tue, 23 Feb 2016 01:38:22 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:33244 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932438AbcBWGiV (ORCPT ); Tue, 23 Feb 2016 01:38:21 -0500 Received: by mail-pa0-f53.google.com with SMTP id fl4so105056015pad.0 for ; Mon, 22 Feb 2016 22:38:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iZL43RgyYozsSuzGlMU84WkdJyet1sOFsLms1bur9fM=; b=xY2LmcacRRxWGOrsO0PCrqPe49mUi0iAHVX1gZVcH4tztBm2a3kPCviPadV/lqI96L OC8dOB0Yc0wLuCLlUGK51wj/+KVpCdUuLxcDXE7Z0JH+VvrWkLINh94YXB4F8vUkmKvB kLnc2n4Y159/0V/0AjFes09Jlg/H0Mhfy54gWzlF795aUzwFXkA0te7IPg22yOkn1xbZ xTInXssnsdMvE2ZEarozL6LtAlV6u4LLc1NQa38UitNEck9kLKpJPHjK7J8COLEI3ebF zmv7FV9GOsLXz8/6Gipzadupe/WllUeS7G0am88jEjLWvP5V/uzXeY0s5FwoAHIFJlJp k+TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iZL43RgyYozsSuzGlMU84WkdJyet1sOFsLms1bur9fM=; b=au7sGOSl+kcYDZKwrstWaxy2o5qbfadRry2xQZ0IburUa0Mrk+RMMupnxXZU/D6mYu kgh9/C8G7UL95OjiIKCWWezws0glR6/QzUKy4v+IudrojbxQzAzzZvD6lwYnd57WRtst s5yglXf1pVEQUeqI0Ye3zKgZGPqdq0cFQ+by57H4s9RRjZYWps9Ghfwy8SNy+9TLJaHy vfYoDn43EgxPhz7l3Ip7dbQrRDBwESyRjFXu90xl8/RxpHQVSI6SS1PCD4qDj8s7gkGC 4TL0Im57qPLk0qQ3GrbdtnWuvbYPoitl0iAqi4hXt9Xlgj5LzMhjpGd3iUqZslJCoH7H rRFw== X-Gm-Message-State: AG10YOQnM07zpt9mIfo78mjAzMTeadwj+ogG+M37lK5/9MSpbG3lcPupk7Y8RTcuveiZ9Q== X-Received: by 10.66.150.170 with SMTP id uj10mr43574599pab.91.1456209501339; Mon, 22 Feb 2016 22:38:21 -0800 (PST) Received: from localhost.localdomain ([218.233.16.2]) by smtp.gmail.com with ESMTPSA id r68sm41187788pfb.51.2016.02.22.22.38.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Feb 2016 22:38:20 -0800 (PST) From: Chaehyun Lim To: gregkh@linuxfoundation.org Cc: johnny.kim@atmel.com, austin.shin@atmel.com, chris.park@atmel.com, tony.cho@atmel.com, glen.lee@atmel.com, leo.kim@atmel.com, linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, Chaehyun Lim Subject: [PATCH 4/7] staging: wilc1000: handle_cfg_param: rename wid_cnt Date: Tue, 23 Feb 2016 15:38:00 +0900 Message-Id: <1456209483-20345-4-git-send-email-chaehyun.lim@gmail.com> X-Mailer: git-send-email 2.7.1 In-Reply-To: <1456209483-20345-1-git-send-email-chaehyun.lim@gmail.com> References: <1456209483-20345-1-git-send-email-chaehyun.lim@gmail.com> 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 wid_cnt variable is used as indicating array index of struct wid_list. This patch renames wid_cnt to i that makes more readability. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/host_interface.c | 184 +++++++++++++++--------------- 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 382f946..d207c5c 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -473,259 +473,259 @@ static s32 handle_cfg_param(struct wilc_vif *vif, s32 result = 0; struct wid wid_list[32]; struct host_if_drv *hif_drv = vif->hif_drv; - int wid_cnt = 0; + int i = 0; down(&hif_drv->sem_cfg_values); if (cfg_param_attr->flag & BSS_TYPE) { if (cfg_param_attr->bss_type < 6) { - wid_list[wid_cnt].id = WID_BSS_TYPE; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->bss_type; - wid_list[wid_cnt].type = WID_CHAR; - wid_list[wid_cnt].size = sizeof(char); + wid_list[i].id = WID_BSS_TYPE; + wid_list[i].val = (s8 *)&cfg_param_attr->bss_type; + wid_list[i].type = WID_CHAR; + wid_list[i].size = sizeof(char); hif_drv->cfg_values.bss_type = (u8)cfg_param_attr->bss_type; } else { netdev_err(vif->ndev, "check value 6 over\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + 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) { - wid_list[wid_cnt].id = WID_AUTH_TYPE; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->auth_type; - wid_list[wid_cnt].type = WID_CHAR; - wid_list[wid_cnt].size = sizeof(char); + wid_list[i].id = WID_AUTH_TYPE; + wid_list[i].val = (s8 *)&cfg_param_attr->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; } else { netdev_err(vif->ndev, "Impossible value \n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } if (cfg_param_attr->flag & AUTHEN_TIMEOUT) { if (cfg_param_attr->auth_timeout > 0 && cfg_param_attr->auth_timeout < 65536) { - wid_list[wid_cnt].id = WID_AUTH_TIMEOUT; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->auth_timeout; - wid_list[wid_cnt].type = WID_SHORT; - wid_list[wid_cnt].size = sizeof(u16); + wid_list[i].id = WID_AUTH_TIMEOUT; + wid_list[i].val = (s8 *)&cfg_param_attr->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; } else { netdev_err(vif->ndev, "Range(1 ~ 65535) over\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } if (cfg_param_attr->flag & POWER_MANAGEMENT) { if (cfg_param_attr->power_mgmt_mode < 5) { - wid_list[wid_cnt].id = WID_POWER_MANAGEMENT; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->power_mgmt_mode; - wid_list[wid_cnt].type = WID_CHAR; - wid_list[wid_cnt].size = sizeof(char); + wid_list[i].id = WID_POWER_MANAGEMENT; + wid_list[i].val = (s8 *)&cfg_param_attr->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; } else { netdev_err(vif->ndev, "Invalid power mode\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } if (cfg_param_attr->flag & RETRY_SHORT) { if (cfg_param_attr->short_retry_limit > 0 && cfg_param_attr->short_retry_limit < 256) { - wid_list[wid_cnt].id = WID_SHORT_RETRY_LIMIT; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->short_retry_limit; - wid_list[wid_cnt].type = WID_SHORT; - wid_list[wid_cnt].size = sizeof(u16); + wid_list[i].id = WID_SHORT_RETRY_LIMIT; + wid_list[i].val = (s8 *)&cfg_param_attr->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; } else { netdev_err(vif->ndev, "Range(1~256) over\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } if (cfg_param_attr->flag & RETRY_LONG) { if (cfg_param_attr->long_retry_limit > 0 && cfg_param_attr->long_retry_limit < 256) { - wid_list[wid_cnt].id = WID_LONG_RETRY_LIMIT; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->long_retry_limit; - wid_list[wid_cnt].type = WID_SHORT; - wid_list[wid_cnt].size = sizeof(u16); + wid_list[i].id = WID_LONG_RETRY_LIMIT; + wid_list[i].val = (s8 *)&cfg_param_attr->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; } else { netdev_err(vif->ndev, "Range(1~256) over\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } if (cfg_param_attr->flag & FRAG_THRESHOLD) { if (cfg_param_attr->frag_threshold > 255 && cfg_param_attr->frag_threshold < 7937) { - wid_list[wid_cnt].id = WID_FRAG_THRESHOLD; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->frag_threshold; - wid_list[wid_cnt].type = WID_SHORT; - wid_list[wid_cnt].size = sizeof(u16); + wid_list[i].id = WID_FRAG_THRESHOLD; + wid_list[i].val = (s8 *)&cfg_param_attr->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; } else { netdev_err(vif->ndev, "Threshold Range fail\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } if (cfg_param_attr->flag & RTS_THRESHOLD) { if (cfg_param_attr->rts_threshold > 255 && cfg_param_attr->rts_threshold < 65536) { - wid_list[wid_cnt].id = WID_RTS_THRESHOLD; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->rts_threshold; - wid_list[wid_cnt].type = WID_SHORT; - wid_list[wid_cnt].size = sizeof(u16); + wid_list[i].id = WID_RTS_THRESHOLD; + wid_list[i].val = (s8 *)&cfg_param_attr->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; } else { netdev_err(vif->ndev, "Threshold Range fail\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } if (cfg_param_attr->flag & PREAMBLE) { if (cfg_param_attr->preamble_type < 3) { - wid_list[wid_cnt].id = WID_PREAMBLE; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->preamble_type; - wid_list[wid_cnt].type = WID_CHAR; - wid_list[wid_cnt].size = sizeof(char); + wid_list[i].id = WID_PREAMBLE; + wid_list[i].val = (s8 *)&cfg_param_attr->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; } else { netdev_err(vif->ndev, "Preamle Range(0~2) over\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } if (cfg_param_attr->flag & SHORT_SLOT_ALLOWED) { if (cfg_param_attr->short_slot_allowed < 2) { - wid_list[wid_cnt].id = WID_SHORT_SLOT_ALLOWED; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->short_slot_allowed; - wid_list[wid_cnt].type = WID_CHAR; - wid_list[wid_cnt].size = sizeof(char); + wid_list[i].id = WID_SHORT_SLOT_ALLOWED; + wid_list[i].val = (s8 *)&cfg_param_attr->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; } else { netdev_err(vif->ndev, "Short slot(2) over\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } if (cfg_param_attr->flag & TXOP_PROT_DISABLE) { if (cfg_param_attr->txop_prot_disabled < 2) { - wid_list[wid_cnt].id = WID_11N_TXOP_PROT_DISABLE; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->txop_prot_disabled; - wid_list[wid_cnt].type = WID_CHAR; - wid_list[wid_cnt].size = sizeof(char); + wid_list[i].id = WID_11N_TXOP_PROT_DISABLE; + wid_list[i].val = (s8 *)&cfg_param_attr->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; } else { netdev_err(vif->ndev, "TXOP prot disable\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } if (cfg_param_attr->flag & BEACON_INTERVAL) { if (cfg_param_attr->beacon_interval > 0 && cfg_param_attr->beacon_interval < 65536) { - wid_list[wid_cnt].id = WID_BEACON_INTERVAL; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->beacon_interval; - wid_list[wid_cnt].type = WID_SHORT; - wid_list[wid_cnt].size = sizeof(u16); + wid_list[i].id = WID_BEACON_INTERVAL; + wid_list[i].val = (s8 *)&cfg_param_attr->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; } else { netdev_err(vif->ndev, "Beacon interval(1~65535)fail\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } if (cfg_param_attr->flag & DTIM_PERIOD) { if (cfg_param_attr->dtim_period > 0 && cfg_param_attr->dtim_period < 256) { - wid_list[wid_cnt].id = WID_DTIM_PERIOD; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->dtim_period; - wid_list[wid_cnt].type = WID_CHAR; - wid_list[wid_cnt].size = sizeof(char); + wid_list[i].id = WID_DTIM_PERIOD; + wid_list[i].val = (s8 *)&cfg_param_attr->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; } else { netdev_err(vif->ndev, "DTIM range(1~255) fail\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } if (cfg_param_attr->flag & SITE_SURVEY) { if (cfg_param_attr->site_survey_enabled < 3) { - wid_list[wid_cnt].id = WID_SITE_SURVEY; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->site_survey_enabled; - wid_list[wid_cnt].type = WID_CHAR; - wid_list[wid_cnt].size = sizeof(char); + wid_list[i].id = WID_SITE_SURVEY; + wid_list[i].val = (s8 *)&cfg_param_attr->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; } else { netdev_err(vif->ndev, "Site survey disable\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } if (cfg_param_attr->flag & SITE_SURVEY_SCAN_TIME) { if (cfg_param_attr->site_survey_scan_time > 0 && cfg_param_attr->site_survey_scan_time < 65536) { - wid_list[wid_cnt].id = WID_SITE_SURVEY_SCAN_TIME; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->site_survey_scan_time; - wid_list[wid_cnt].type = WID_SHORT; - wid_list[wid_cnt].size = sizeof(u16); + wid_list[i].id = WID_SITE_SURVEY_SCAN_TIME; + wid_list[i].val = (s8 *)&cfg_param_attr->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; } else { netdev_err(vif->ndev, "Site scan time(1~65535) over\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } if (cfg_param_attr->flag & ACTIVE_SCANTIME) { if (cfg_param_attr->active_scan_time > 0 && cfg_param_attr->active_scan_time < 65536) { - wid_list[wid_cnt].id = WID_ACTIVE_SCAN_TIME; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->active_scan_time; - wid_list[wid_cnt].type = WID_SHORT; - wid_list[wid_cnt].size = sizeof(u16); + wid_list[i].id = WID_ACTIVE_SCAN_TIME; + wid_list[i].val = (s8 *)&cfg_param_attr->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; } else { netdev_err(vif->ndev, "Active time(1~65535) over\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } if (cfg_param_attr->flag & PASSIVE_SCANTIME) { if (cfg_param_attr->passive_scan_time > 0 && cfg_param_attr->passive_scan_time < 65536) { - wid_list[wid_cnt].id = WID_PASSIVE_SCAN_TIME; - wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->passive_scan_time; - wid_list[wid_cnt].type = WID_SHORT; - wid_list[wid_cnt].size = sizeof(u16); + wid_list[i].id = WID_PASSIVE_SCAN_TIME; + wid_list[i].val = (s8 *)&cfg_param_attr->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; } else { netdev_err(vif->ndev, "Passive time(1~65535) over\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } if (cfg_param_attr->flag & CURRENT_TX_RATE) { enum CURRENT_TXRATE curr_tx_rate = cfg_param_attr->curr_tx_rate; @@ -736,21 +736,21 @@ static s32 handle_cfg_param(struct wilc_vif *vif, || curr_tx_rate == MBPS_9 || curr_tx_rate == MBPS_12 || curr_tx_rate == MBPS_18 || curr_tx_rate == MBPS_24 || curr_tx_rate == MBPS_36 || curr_tx_rate == MBPS_48 || curr_tx_rate == MBPS_54) { - wid_list[wid_cnt].id = WID_CURRENT_TX_RATE; - wid_list[wid_cnt].val = (s8 *)&curr_tx_rate; - wid_list[wid_cnt].type = WID_SHORT; - wid_list[wid_cnt].size = sizeof(u16); + wid_list[i].id = WID_CURRENT_TX_RATE; + wid_list[i].val = (s8 *)&curr_tx_rate; + wid_list[i].type = WID_SHORT; + wid_list[i].size = sizeof(u16); hif_drv->cfg_values.curr_tx_rate = (u8)curr_tx_rate; } else { netdev_err(vif->ndev, "out of TX rate\n"); result = -EINVAL; goto ERRORHANDLER; } - wid_cnt++; + i++; } result = wilc_send_config_pkt(vif, SET_CFG, wid_list, - wid_cnt, wilc_get_vif_idx(vif)); + i, wilc_get_vif_idx(vif)); if (result) netdev_err(vif->ndev, "Error in setting CFG params\n");