From patchwork Wed Sep 9 15:36:28 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: 249486 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp523998ilg; Wed, 9 Sep 2020 08:35:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzae7+qtK0xJ52/UtgCeOGdUPvKyfoX3nWR/wWi4yXqKDiQpgs50Gs49ZBgo3bpHjiA3F9B X-Received: by 2002:a6b:b48c:: with SMTP id d134mr3865988iof.115.1599665754835; Wed, 09 Sep 2020 08:35:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599665754; cv=none; d=google.com; s=arc-20160816; b=0P/lLxcDNNt3EHRn1TCjJE65qDyb9mC9/jDc20iXmxW0th1gy3q2LJb5JLPOvxwfZl mn3Df6dliNhbVWCuJtGFYzh77xa+kvIKLX7o3hsKyr464YjqWgr0owKsRxlC92R3mWw7 oSMmEaUdVl6Qr22f2411lLjz0PeyVePwjWB9+lMepoCkrpfNYBEo+VfHovOWvmdttLuU 2jvK3FPjXgR6SP+h/1FLUyAVhq77MhifBltt9xZk4pG1b2woHh961tVTlo9+DYt/aITp wIcIzbxhvxlp9oDJq5fwXcSNNGfaPrtwl5g20N7J6xeRw+S9ETX/IfBs/lZR2whbXjex a96w== 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=bO8abkq1sdaBCdr+F1kXFa/GeWECCdvP/LdxiwDLGuo=; b=z+sh4GM5mntTbk3kraBkUeCdrrK9L7KNomcgn1RS9ApV7DRHI/oqLiu2HBLkO9iTr6 ppOrqe5jTG/n8PUVQdxMX0CeAgIRirhFB8iAFtiXLxpmkye7slFaZ62lBc6X0HLcVSzr 0nF8SY98s8h8Bue8GgZVWE3c2xzrRsrb21ne1PzYUSIsJ3mcReGu+oyUiv2A+N5Hvojn JIGxv3krksuY6wQmBmpTlRBt6CGrNHbmRg42O5jc6kBBsH69gSSYSnRwC60XDwayhnvC vuURpD4RGbUAQ1V+k7mNHDcR+Xhmmzs2S5tTkPUJK3FsQ4nxix2FqHalxw7eB0GVe4EA /weQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=AwdztXfb; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bDaDaBH3; 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 x19si2169972jas.106.2020.09.09.08.35.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 08:35:54 -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=AwdztXfb; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bDaDaBH3; 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=bO8abkq1sdaBCdr+F1kXFa/GeWECCdvP/LdxiwDLGuo=; b=AwdztXfbXxqrk6/8jeiLIit98 Nm/KAupgvSzpDue2nM/KMNAy5gDeYuSrcDB1gwWEwZeh/k7YBt7bJ9IpctBH+EaqXUpiTwdEKPN9/ VPcOfIeQEcYdjfHJ2xwMJbzIcKBhdbqLI4iBIySfLdPgasqiuwOzU+ZQdsmmhxS//YKyt3Grs5Tw5 TwxJpgSSh/qbwLlBkv11NVUP6YPi2vP9Sn+uTjO9uHAf61gnCBBl/0K2oN3psYACWdvaZzbtNpE1E vLvWsjSqqrKDiaYGf0UhIwWjJEnkJN81tkpDswQpTkVMciQEwh2zJa9q2IMxwPzKx+3lgOpTluGb3 gLtzK4Bbw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG28V-0006WT-Hu; Wed, 09 Sep 2020 15:35:51 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG28S-0006Tu-1a for wcn36xx@lists.infradead.org; Wed, 09 Sep 2020 15:35:49 +0000 Received: by mail-wm1-x344.google.com with SMTP id z9so2835706wmk.1 for ; Wed, 09 Sep 2020 08:35:47 -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=yTFsQ/Thh+oiXlokRzBRhy7fryTyWLYZWgMktev/5uE=; b=bDaDaBH3RlmXba1m2936yTlW0VjhPgcg7KEU3pm5sHzQ8eq4cbIryvBB5LKuF7T9TH HBtoJH/72ZuoWP2/Rp8My9ruBESz+sbp9jfgWMhH3IYHWn0/QqC3H7KuwJZV6SlkIMcA ZUvuYOrqFzV2/vs82kyDwCSGSRJuxTfbWPAxyALgWAHSzBTNJlFYoB63/wyA5mfn8SGQ ubq4vUPcGIY28MTs284xY2vYf8PD5jCyiGsp6S6xNb1dUpDTJSH2arWrwZUfKn0pJDZk OUg0wcCAIydOXK5kM/hXLn1wmDngzKTcmebAvY6xgrX0knTbzKH3mJHiqdfZmP3ZIlW5 9Njg== 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=yTFsQ/Thh+oiXlokRzBRhy7fryTyWLYZWgMktev/5uE=; b=BsyH70idcVcQ+zpOqKMajbIMNR71MA6vHoEUmC+W+rhxPKc/BqFsTX9HEVtRaLvb8c SSIQleRVferI53oxHotK0M7QK1XiLafv0wcl3lxHsPYc0MCz801EZuattJ31eGJekpzG 8wcy4x00FtQdKL+Pwd2rEc65migKiBw5gtmWOuM7FkNz7m/WnC9lR+EdVFHRk8bMQn0j w3mdBe9bSme61CvKTD8vS9Whfx3bOUxLEdtEIzlZBLfdepSMbgZTqPReh4sG30wj0kX5 hRaDP2xR+5NeUFj4aEX+FHWhQAbs8jePtVFLnezj0d1uWwtVKhffomfFUax2f38IZySW sX1A== X-Gm-Message-State: AOAM533UD22SBMEccG35PNgyZ4QdaXxeLImjR2hXVYkLZkTIzw7ZHkQV OGi1zsyL+rP1/shusbPuuFTGf3yTc+wXxQ== X-Received: by 2002:a7b:c24b:: with SMTP id b11mr4339736wmj.134.1599665747147; Wed, 09 Sep 2020 08:35:47 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id c18sm4924871wrx.63.2020.09.09.08.35.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 08:35:46 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v4 7/7] wcn36xx: Remove dead code in wcn36xx_smd_config_bss() Date: Wed, 9 Sep 2020 16:36:28 +0100 Message-Id: <20200909153628.2904888-8-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200909153628.2904888-1-bryan.odonoghue@linaro.org> References: <20200909153628.2904888-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-20200909_113548_206203_1D623437 X-CRM114-Status: GOOD ( 12.85 ) 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:344 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 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 -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 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 wcn36xx_smd_config_bss_v0() and wcn36xx_smd_config_bss_v1() have been designed to operate in standalone fashion. As a result we can drop the dead code now present in wcn36xx_smd_config_bss() and happily remove one kzalloc from the BSS config path as we do so. Signed-off-by: Bryan O'Donoghue Reviewed-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/smd.c | 39 ++++---------------------- 1 file changed, 5 insertions(+), 34 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 fc922dd9ccde..ce6536a3185c 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1673,42 +1673,15 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, struct ieee80211_sta *sta, const u8 *bssid, bool update) { - struct wcn36xx_hal_config_bss_req_msg *msg; - struct wcn36xx_hal_config_bss_params *bss; - struct wcn36xx_hal_config_sta_params *sta_params; int ret; mutex_lock(&wcn->hal_mutex); - msg = kzalloc(sizeof(*msg), GFP_KERNEL); - if (!msg) { - ret = -ENOMEM; - goto out; - } - INIT_HAL_MSG((*msg), WCN36XX_HAL_CONFIG_BSS_REQ); - - bss = &msg->bss_params; - sta_params = &bss->sta; - - wcn36xx_smd_set_bss_params(wcn, vif, sta, bssid, update, bss); - wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); - - wcn36xx_dbg(WCN36XX_DBG_HAL, - "hal config bss bssid %pM self_mac_addr %pM bss_type %d oper_mode %d nw_type %d\n", - bss->bssid, bss->self_mac_addr, bss->bss_type, - bss->oper_mode, bss->nw_type); - wcn36xx_dbg(WCN36XX_DBG_HAL, - "- sta bssid %pM action %d sta_index %d bssid_index %d aid %d type %d mac %pM\n", - sta_params->bssid, sta_params->action, - sta_params->sta_index, sta_params->bssid_index, - sta_params->aid, sta_params->type, - sta_params->mac); - - if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { + if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) ret = wcn36xx_smd_config_bss_v1(wcn, vif, sta, bssid, update); - } else { + else ret = wcn36xx_smd_config_bss_v0(wcn, vif, sta, bssid, update); - } + if (ret) { wcn36xx_err("Sending hal_config_bss failed\n"); goto out; @@ -1718,12 +1691,10 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, sta, wcn->hal_buf, wcn->hal_rsp_len); - if (ret) { + if (ret) wcn36xx_err("hal_config_bss response failed err=%d\n", ret); - goto out; - } + out: - kfree(msg); mutex_unlock(&wcn->hal_mutex); return ret; }