From patchwork Sat Aug 29 03:38:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 248672 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp1602440ilg; Fri, 28 Aug 2020 20:38:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwABwyE/XboNDsu3DdgSBSsTO3IEnU2UGkzdaxkJXu2Hr3W6rmKVFBVCTohIGRm2j5KaNCs X-Received: by 2002:a02:cce8:: with SMTP id l8mr3842252jaq.67.1598672300603; Fri, 28 Aug 2020 20:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598672300; cv=none; d=google.com; s=arc-20160816; b=ku1dAiYXl/6KUwD6KhseGcM9vAME8Dh7dsnJj6kS4go+Vq7bMmGC6dTsDLjk3XV6co E0s3O+XOVMf6i0Rt2t8O7O1p+WX2SlG/n+OUEi9MieC3raFZxML/ackmxv1utoxI95xe Z65VKWsuANHLwJIUs3SuxyrPhjk85YD675vrLWDaCZsdTIXPgjP6fojWy7oC0ktmIEoz B5f5HKXtiSAlyoNxf5NDPxmC2o0L16AiV1SquXG/JfiIRNHM/pVkxDdz4ZwL/K2keYib EbQ1xPY4kVcWiyqhbt0OsWBeYiCDAcY8KmBs2azmbpTIVTaZWpPPSiPRawc2oueh6XbV Gl2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:dkim-signature; bh=wh4cZwzxv24hO1ZSjhp7anYP/B5vN6EmH2Yza/kvDU4=; b=tBJ/BQS8UUoC3RhLMlXilo3qQcIlswJsq0GY2YlOgrvHnrpXgxoovBNyISsxBMD64o H8LDnhYq39jLdjGDcDrOHVNeFBdPeOQpagcrE0QlEOCI6K1BJVM8TmDdPDEx88AYf2VJ ooBHwgUy9B09qSSUHlHaudVRKRXjXjCseaOZ/Sm7HvWw/i0P9ryQfUcpDUk42W1lv0bS JJj+ywqxUmHP6ChkUfxn3NZuID3d/5zEF5oG9KLIsTTDMB+p9S33+m4lF6hPAvRKuoYa wzqCQC2eQfYnU1B0FFcjVRSuw8fN+KKZFr4vio/zhFY++YfYiKsh1TaeoMN7NBqzA8b8 sqhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=hB54bS10; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VXGiSsso; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from merlin.infradead.org (merlin.infradead.org. [2001:8b0:10b:1231::1]) by mx.google.com with ESMTPS id g12si1596320ilq.1.2020.08.28.20.38.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) client-ip=2001:8b0:10b:1231::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=hB54bS10; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VXGiSsso; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wh4cZwzxv24hO1ZSjhp7anYP/B5vN6EmH2Yza/kvDU4=; b=hB54bS101BNbcNid4nzSmWYEi qJkhnUA1MSQn6ntrphlBkZHvPJ88OUMnYynU1I0Nw2eHeO2THnlF9Zj43ZglwFoHXN/psp88EI6bc pJ8KZR6vH334yFXDPCEmG6XAh2OiaP/jDkboQLY3rxrdK8zODHPEVkVdpHUK4heJgwF/xwDGsCmLc d2aUzEMHEESDI0tljFM2yCvXkC6rVIuc79jsqCkrtnnMHfnrPk8mi1DF0GX2aEGw9fUPaUussunpJ d8lzl90w+MFeJ1ljR/U9c4KgRV1kICoefAGKx9QQfnQ8ToWgm+mIWvwFIAOgkFhrNlJOd8RU22jWk JJhj934wg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrh2-0002Bn-IP; Sat, 29 Aug 2020 03:38:16 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrgz-000298-Cj for wcn36xx@lists.infradead.org; Sat, 29 Aug 2020 03:38:14 +0000 Received: by mail-wm1-x343.google.com with SMTP id w2so887119wmi.1 for ; Fri, 28 Aug 2020 20:38:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=snHNh5lKS2G0FTSISsFMGrkG2Oau7dqOyX8GcYHpHKE=; b=VXGiSssovhD85ZzX6cPZxqcb3woNczAD5mY0J+oiwZoAuDoFrqkaE/gWoQrtHpfTbY uY5tM+HqU58dWR523VrERY6qBdNRYW1oumhl4CwU3zdYj5pEn7Zj9zHj6UMLQA4jywgb ivl5GAEt1VrzfNN/nXTiT3ycxgD9AvsurXuB13mVqnWVhnOtTWRYzrJTweX3cblx6Grb LsHBeemlhHXc4xIZm1R1BPIJq5irfnKJyNpAwbQKdVJ/aFeqMDyidh0JsARITMbCohdD X6mZ7nYsCfeFs+atK7YFPeOKrLn3/j3AmbdC4md9tRwa/XlL2RWxCt+zP/Ckza2fk6TF 2fgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=snHNh5lKS2G0FTSISsFMGrkG2Oau7dqOyX8GcYHpHKE=; b=anYQ5vzgaqDn1vVdmh7Fa/h27To6m/Zb4kpFTJQMZYBzHk/bzL5FC2aLDre8MFoWlm wyCuHz9l/akYQ//KLJRxHfUCPHs5dkgs869g98THHVZhklLSpIEhYI+QO6MOfDF+flci U3cU1Q7TCUiA/e4bitgRfQ8h1Pn2UzJ8A6VZAbyLKu5M+PUJuyaVUYAdhJevoylrgwLj EMRsdU8yEgJ/olpiqTbs16Bdb4Oftdr2/p64xQx+pL14D0yEhqUskkX4RJhyZxM+SC5B Qv2uMd0WPjN9yEIfdG85b9eoyQ2J2C3OLdKfTCqOiVK4DqbUshraEu5ohUb+qjogIqE1 k4xA== X-Gm-Message-State: AOAM531diqkGqfg5LqyJRIMH6gwOJ69mTt959xLO8OjSESTHb5FZ1a2X ZUCCIuqoyWQD4pxryqVB0nyQ9WZgZ9R9LxZG X-Received: by 2002:a1c:9a47:: with SMTP id c68mr1493787wme.33.1598672292408; Fri, 28 Aug 2020 20:38:12 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id v29sm1827545wrv.51.2020.08.28.20.38.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:12 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v2 09/10] wcn36xx: Use existing pointers in wcn36xx_smd_config_bss_v1 Date: Sat, 29 Aug 2020 04:38:45 +0100 Message-Id: <20200829033846.2167619-10-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033846.2167619-1-bryan.odonoghue@linaro.org> References: <20200829033846.2167619-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200828_233813_581423_FF7C5EA7 X-CRM114-Status: GOOD ( 12.22 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:343 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org Two pointers are already defined in this function "bss" and "sta" which point to fields within msg_body->bss_params. We can substantially reduce the amount of extraneous text in this function by making use of those pointers. This change makes the code easier to read and modify. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 110 +++++++++++-------------- 1 file changed, 47 insertions(+), 63 deletions(-) -- 2.27.0 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 92ae77523115..9490b1bf4e05 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1299,87 +1299,71 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, sta = &bss->sta; /* convert orig to v1 */ - memcpy(&msg_body->bss_params.bssid, - &orig->bss_params.bssid, ETH_ALEN); - memcpy(&msg_body->bss_params.self_mac_addr, - &orig->bss_params.self_mac_addr, ETH_ALEN); + memcpy(bss->bssid, &orig->bss_params.bssid, ETH_ALEN); + memcpy(bss->self_mac_addr, &orig->bss_params.self_mac_addr, ETH_ALEN); - msg_body->bss_params.bss_type = orig->bss_params.bss_type; - msg_body->bss_params.oper_mode = orig->bss_params.oper_mode; - msg_body->bss_params.nw_type = orig->bss_params.nw_type; + bss->bss_type = orig->bss_params.bss_type; + bss->oper_mode = orig->bss_params.oper_mode; + bss->nw_type = orig->bss_params.nw_type; - msg_body->bss_params.short_slot_time_supported = + bss->short_slot_time_supported = orig->bss_params.short_slot_time_supported; - msg_body->bss_params.lla_coexist = orig->bss_params.lla_coexist; - msg_body->bss_params.llb_coexist = orig->bss_params.llb_coexist; - msg_body->bss_params.llg_coexist = orig->bss_params.llg_coexist; - msg_body->bss_params.ht20_coexist = orig->bss_params.ht20_coexist; - msg_body->bss_params.lln_non_gf_coexist = - orig->bss_params.lln_non_gf_coexist; - - msg_body->bss_params.lsig_tx_op_protection_full_support = + bss->lla_coexist = orig->bss_params.lla_coexist; + bss->llb_coexist = orig->bss_params.llb_coexist; + bss->llg_coexist = orig->bss_params.llg_coexist; + bss->ht20_coexist = orig->bss_params.ht20_coexist; + bss->lln_non_gf_coexist = orig->bss_params.lln_non_gf_coexist; + + bss->lsig_tx_op_protection_full_support = orig->bss_params.lsig_tx_op_protection_full_support; - msg_body->bss_params.rifs_mode = orig->bss_params.rifs_mode; - msg_body->bss_params.beacon_interval = orig->bss_params.beacon_interval; - msg_body->bss_params.dtim_period = orig->bss_params.dtim_period; - msg_body->bss_params.tx_channel_width_set = - orig->bss_params.tx_channel_width_set; - msg_body->bss_params.oper_channel = orig->bss_params.oper_channel; - msg_body->bss_params.ext_channel = orig->bss_params.ext_channel; - - msg_body->bss_params.reserved = orig->bss_params.reserved; - - memcpy(&msg_body->bss_params.ssid, - &orig->bss_params.ssid, + bss->rifs_mode = orig->bss_params.rifs_mode; + bss->beacon_interval = orig->bss_params.beacon_interval; + bss->dtim_period = orig->bss_params.dtim_period; + bss->tx_channel_width_set = orig->bss_params.tx_channel_width_set; + bss->oper_channel = orig->bss_params.oper_channel; + bss->ext_channel = orig->bss_params.ext_channel; + + bss->reserved = orig->bss_params.reserved; + + memcpy(&bss->ssid, &orig->bss_params.ssid, sizeof(orig->bss_params.ssid)); - msg_body->bss_params.action = orig->bss_params.action; - msg_body->bss_params.rateset = orig->bss_params.rateset; - msg_body->bss_params.ht = orig->bss_params.ht; - msg_body->bss_params.obss_prot_enabled = - orig->bss_params.obss_prot_enabled; - msg_body->bss_params.rmf = orig->bss_params.rmf; - msg_body->bss_params.ht_oper_mode = orig->bss_params.ht_oper_mode; - msg_body->bss_params.dual_cts_protection = - orig->bss_params.dual_cts_protection; - - msg_body->bss_params.max_probe_resp_retry_limit = + bss->action = orig->bss_params.action; + bss->rateset = orig->bss_params.rateset; + bss->ht = orig->bss_params.ht; + bss->obss_prot_enabled = orig->bss_params.obss_prot_enabled; + bss->rmf = orig->bss_params.rmf; + bss->ht_oper_mode = orig->bss_params.ht_oper_mode; + bss->dual_cts_protection = orig->bss_params.dual_cts_protection; + + bss->max_probe_resp_retry_limit = orig->bss_params.max_probe_resp_retry_limit; - msg_body->bss_params.hidden_ssid = orig->bss_params.hidden_ssid; - msg_body->bss_params.proxy_probe_resp = - orig->bss_params.proxy_probe_resp; - msg_body->bss_params.edca_params_valid = - orig->bss_params.edca_params_valid; - - memcpy(&msg_body->bss_params.acbe, - &orig->bss_params.acbe, + bss->hidden_ssid = orig->bss_params.hidden_ssid; + bss->proxy_probe_resp = orig->bss_params.proxy_probe_resp; + bss->edca_params_valid = orig->bss_params.edca_params_valid; + + memcpy(&bss->acbe, &orig->bss_params.acbe, sizeof(orig->bss_params.acbe)); - memcpy(&msg_body->bss_params.acbk, - &orig->bss_params.acbk, + memcpy(&bss->acbk, &orig->bss_params.acbk, sizeof(orig->bss_params.acbk)); - memcpy(&msg_body->bss_params.acvi, - &orig->bss_params.acvi, + memcpy(&bss->acvi, &orig->bss_params.acvi, sizeof(orig->bss_params.acvi)); - memcpy(&msg_body->bss_params.acvo, - &orig->bss_params.acvo, + memcpy(&bss->acvo, &orig->bss_params.acvo, sizeof(orig->bss_params.acvo)); - msg_body->bss_params.ext_set_sta_key_param_valid = + bss->ext_set_sta_key_param_valid = orig->bss_params.ext_set_sta_key_param_valid; - memcpy(&msg_body->bss_params.ext_set_sta_key_param, + memcpy(&bss->ext_set_sta_key_param, &orig->bss_params.ext_set_sta_key_param, sizeof(orig->bss_params.acvo)); - msg_body->bss_params.wcn36xx_hal_persona = - orig->bss_params.wcn36xx_hal_persona; - msg_body->bss_params.spectrum_mgt_enable = - orig->bss_params.spectrum_mgt_enable; - msg_body->bss_params.tx_mgmt_power = orig->bss_params.tx_mgmt_power; - msg_body->bss_params.max_tx_power = orig->bss_params.max_tx_power; + bss->wcn36xx_hal_persona = orig->bss_params.wcn36xx_hal_persona; + bss->spectrum_mgt_enable = orig->bss_params.spectrum_mgt_enable; + bss->tx_mgmt_power = orig->bss_params.tx_mgmt_power; + bss->max_tx_power = orig->bss_params.max_tx_power; - wcn36xx_smd_convert_sta_to_v1(wcn, &orig->bss_params.sta, - &msg_body->bss_params.sta); + wcn36xx_smd_convert_sta_to_v1(wcn, &orig->bss_params.sta, sta); PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body));