Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7583942rwl; Fri, 30 Dec 2022 10:36:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXu/GUjGEJM7M1BRI+AfZFb9aTR6uzMTWBnQV85cOmBOiUZBS50oOhlzQ+wiwuUVa7lM7Sbk X-Received: by 2002:a05:6a20:d909:b0:b3:5196:94f2 with SMTP id jd9-20020a056a20d90900b000b3519694f2mr18814129pzb.54.1672425387593; Fri, 30 Dec 2022 10:36:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672425387; cv=none; d=google.com; s=arc-20160816; b=uPF+eMvZtYCzVgEXLbNgGG3dPBq+mxuVFdZbBea2ScvEMvyhS7aiGDekXYxhfNIAIQ 4mRn5aSoztjqFogAIa+uouggUc6ub8sLmWIjy82XLAY3zbkeqYqJ61KCwe6zWdMcXwvs jfpRidg0wsKcf5wE47qCa2WwBg5F0H8jcadBTpMe5YsAvwsXg+TjAbrW8EcsnIgQ+z5O qp/mSa+GbAtbsyQEk68RYBe6ovZgFi839uVC/VC2AZ7Vg+JLyLm5X35jZ1ax2M4LPUXm 7Nq7IEgXzE1A1O9D+7RXPe9MvCbBoHiO7H3s1oMMOypCrEWhGhmoEQ30kZpq7zl5oCmx MiwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9riakcnRMBIWTC6w3yfgBcitUX8iJe1gQ0Q4SMsO3xA=; b=qiVrznnk5rqS4lUO8X7ssacDRRSHix/wMwxCWWDZyJOInKKoIwRtakwp+XMUmDWYRy 03o5AOQxvXknV3fAfZ4xSogeYOvynHqOP46t413cfhdzuAuT9KkD4SN+G1GUHMiX/qxY ygzScQVV5kGwPfCo2uTxesvTf9JvkA+RWVuRrHEesMrxmNvOLfVi1FYTVK8qRKgH/Ntw 7BiLnYdbyH4SFGcjMpXTzukWe8+f+FLO8zsGQy0qdKBrTA2aLMXXmkXRhe8Kz77/mqn1 DlYSpgZHKq+EgBDZQW7E1lHWF/K+yKf8Mu/ryLMuJn/pCwxomIFub+Hms1lgAFAUVvmb RhkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a634e14000000b0047856d87247si22539973pgb.603.2022.12.30.10.36.19; Fri, 30 Dec 2022 10:36:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235491AbiL3SHj (ORCPT + 63 others); Fri, 30 Dec 2022 13:07:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235436AbiL3SHU (ORCPT ); Fri, 30 Dec 2022 13:07:20 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3BDC1C424 for ; Fri, 30 Dec 2022 10:07:16 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1pBJmi-0004rR-BI; Fri, 30 Dec 2022 19:07:12 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 08/20] staging: r8188eu: remove duplicate psta check Date: Fri, 30 Dec 2022 19:06:34 +0100 Message-Id: <20221230180646.91008-9-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We do not need the psta check in the while loop of rtw_xmitframe_coalesce. psta is already checked near the start of the function and is not modified afterwards. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 36 ++++++++++++------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 62b66a205a06..2bccb9ca42e9 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1009,25 +1009,23 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct /* adding icv, if necessary... */ if (pattrib->iv_len) { - if (psta) { - switch (pattrib->encrypt) { - case _WEP40_: - case _WEP104_: - WEP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); - break; - case _TKIP_: - if (bmcst) - TKIP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); - else - TKIP_IV(pattrib->iv, psta->dot11txpn, 0); - break; - case _AES_: - if (bmcst) - AES_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); - else - AES_IV(pattrib->iv, psta->dot11txpn, 0); - break; - } + switch (pattrib->encrypt) { + case _WEP40_: + case _WEP104_: + WEP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); + break; + case _TKIP_: + if (bmcst) + TKIP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); + else + TKIP_IV(pattrib->iv, psta->dot11txpn, 0); + break; + case _AES_: + if (bmcst) + AES_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); + else + AES_IV(pattrib->iv, psta->dot11txpn, 0); + break; } memcpy(pframe, pattrib->iv, pattrib->iv_len); -- 2.30.2