From patchwork Tue Mar 7 08:50:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Straube X-Patchwork-Id: 65338 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2331603wrd; Tue, 7 Mar 2023 01:28:31 -0800 (PST) X-Google-Smtp-Source: AK7set/Py7djw0uwU8UnZSjN7NWUK/UOVuTLBNFM3OHTuoCezzGBkeNqDV2CGvcR5PsVVmqa3FsU X-Received: by 2002:a17:906:c301:b0:8b1:7684:dfb0 with SMTP id s1-20020a170906c30100b008b17684dfb0mr13764668ejz.57.1678181310903; Tue, 07 Mar 2023 01:28:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678181310; cv=none; d=google.com; s=arc-20160816; b=WjHPQ5X/SoqsOuxfnBkHoIYgWQoDoXAr0+4Dv5g94zNI4tVzvuptuhK6UXVwjgmlLt USj9+sB3fVaRaYcYJ+D1jNuciDlzM1FE3nOLcC3wDbFCrrI/Bk+l61cIvqJjW7vvTeNA R6b8pYXElnLmfTjQDRiLUcAVdWD6X6v9SetbRCf90bPQBQwr7A8/sS94NbWuXXKH+5vh o8wInwU0s+eqrEIarWsdj+tN1xVZjFox2potTu0b/n9ZXU4Px4mnhGdBglbATE74gCFF C6LuatQwDDJZbTGbQRC2cwQOjfzJrd8In46jsVf4qdLpVYjpr2KjH0uxIRXDuiwGEdN6 h3dg== 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 :dkim-signature; bh=8GFQv4/Ns3Nfi73ZwFrLlp9/6YwSGNlJakq8RjW9OfI=; b=VAk67GCJCM4/NMh3cxqLaWyQHhKMzMRC6tL7CgJ6ZrzADzFr3YDXiY6kSbBCxRCsTN TNli0gpHpymAhjEYARtrr8TUU53WBmJt3upd5bH5R7AnJuWRUwMt4FhLrnk7GEUt6c3T 6pHUU5wzeaC5Z1BAoWSB3+AGazevnCNmW1BRPBYfkjT7qexCk/tSZ3q6IyunBxt0T7WI rkdWj8ycakiuoE65eMMlIHq3zaEg9LldzU0tu2zCBrqNaK3B8OV1TR09eerH3MNAy0UD DcUPCiOHDIEmN9SROwYCE5jblx7NjYeTGVjiMfPL2rtFcxYzvyOcFAd1+cW+unJNgDKe jxkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mb6HCoQd; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id de20-20020a1709069bd400b008d999499f63si2479817ejc.83.2023.03.07.01.28.07; Tue, 07 Mar 2023 01:28:30 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mb6HCoQd; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230005AbjCGIuU (ORCPT + 99 others); Tue, 7 Mar 2023 03:50:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229864AbjCGIuN (ORCPT ); Tue, 7 Mar 2023 03:50:13 -0500 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C1D56B5FF for ; Tue, 7 Mar 2023 00:50:10 -0800 (PST) Received: by mail-ed1-x533.google.com with SMTP id cw28so49292944edb.5 for ; Tue, 07 Mar 2023 00:50:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678179008; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8GFQv4/Ns3Nfi73ZwFrLlp9/6YwSGNlJakq8RjW9OfI=; b=mb6HCoQdgbUdoTO5sLWloyZgOY6Jk+NIF6Xl+Vo94MFkonwtA5Wa0oHgbVAgC7dZSj TE2wxofcsK5scYjpqMTgAR75sspJKXjNqhPV7iSVkpmIQVpPIXa7TMIPCRERdp6CqFpL FLx8MG0xu0yUBb3bVfB05mvl8RbEShHyyVJd731fKm2bppuHH0NotaUSlV89VogZi9vY DK8ySsOBLrzyDyAiM/3RRVjWJ7abz1ikONmVXMseyzC25hsOXe6+sS5rmUAp8/lEf74d r69zEegsa27Z1jBpH0VC7uey4gbouSaBD3yOFVJeXXmP/rEyzTmxELiOmnou6QpnFxuz LK/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678179008; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8GFQv4/Ns3Nfi73ZwFrLlp9/6YwSGNlJakq8RjW9OfI=; b=4zCr8QD+mo+0mz1i8sjcmjIuyeTm73142IN+lSZ0MM+rBI1IjYGmA6YR1gfZ3ZG3gm XRQf1lknEFf/idZaAEhAq/P3coehKgNgpmmue9Fi802i+SCtDGw7+deFbDXsemHplLYk je+jswWAQKOw7G+GK+ZIyN92BTqI+LDYf4Amdy6VAoq5a51XVxoQ6fkE/IUZL73m0s0W esXTAepuDT/x+nV17PgtcYGAdEfT81I9SCb5ijvtM6cCF+Ml23ngJwiHpUbN1rDbHS/P 3I5ySmz4RvcvNRrB7f7epaA8GBmi3umI8Q9XEjjDBwdWCI4n47KocF0CydcMMx5T0vTO SSkw== X-Gm-Message-State: AO0yUKVC8KhSMg/Pt36Alqqz6BXanCmrFwFf//BKtnkGZyY0ofleMKzd yetMkL/Br653b4/lxvUvR2M= X-Received: by 2002:a17:906:dfca:b0:884:37fd:bf4c with SMTP id jt10-20020a170906dfca00b0088437fdbf4cmr12474897ejc.19.1678179008745; Tue, 07 Mar 2023 00:50:08 -0800 (PST) Received: from localhost.localdomain (ip5f5abbe7.dynamic.kabel-deutschland.de. [95.90.187.231]) by smtp.gmail.com with ESMTPSA id o21-20020a170906289500b008ef42f9cf48sm5707402ejd.82.2023.03.07.00.50.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 00:50:08 -0800 (PST) From: Michael Straube To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Straube Subject: [PATCH 1/2] staging: r8188eu: busetkipkey is boolean Date: Tue, 7 Mar 2023 09:50:02 +0100 Message-Id: <20230307085003.5025-2-straube.linux@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307085003.5025-1-straube.linux@gmail.com> References: <20230307085003.5025-1-straube.linux@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759700645974657555?= X-GMAIL-MSGID: =?utf-8?q?1759700645974657555?= The field busetkipkey of struct security_priv is set to boolean values only. Remove unneeded comparisions from if statements that use this field. Signed-off-by: Michael Straube --- drivers/staging/r8188eu/core/rtw_recv.c | 2 +- drivers/staging/r8188eu/core/rtw_xmit.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c index fc7568cf948b..741c17121c9b 100644 --- a/drivers/staging/r8188eu/core/rtw_recv.c +++ b/drivers/staging/r8188eu/core/rtw_recv.c @@ -471,7 +471,7 @@ static struct recv_frame *decryptor(struct adapter *padapter, struct recv_frame break; } } else if (prxattrib->bdecrypted == 1 && prxattrib->encrypt > 0 && - (psecuritypriv->busetkipkey == 1 || prxattrib->encrypt != _TKIP_)) + (psecuritypriv->busetkipkey || prxattrib->encrypt != _TKIP_)) psecuritypriv->hw_decrypted = true; if (res == _FAIL) { diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index df88b3e29e77..cc3894101673 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -626,7 +626,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p pattrib->iv_len = 8; pattrib->icv_len = 4; - if (padapter->securitypriv.busetkipkey == _FAIL) { + if (!padapter->securitypriv.busetkipkey) { res = _FAIL; goto exit; } From patchwork Tue Mar 7 08:50:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Straube X-Patchwork-Id: 65337 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2331574wrd; Tue, 7 Mar 2023 01:28:23 -0800 (PST) X-Google-Smtp-Source: AK7set/uBqJy8BZ9RXb+a2ZvMTugxj2YqQSyPZ3SSReTUUdPKuMO2X3YITdrogjW2T5GUkCuFoYr X-Received: by 2002:a17:906:36d3:b0:8bf:e95c:467b with SMTP id b19-20020a17090636d300b008bfe95c467bmr12624354ejc.63.1678181303619; Tue, 07 Mar 2023 01:28:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678181303; cv=none; d=google.com; s=arc-20160816; b=QsVlrRKsFJ/LT+bVY4uRoLLBOAjd5M99xRWx2LpxWEky2jYSSxq5mBjrXnVp8wOTgZ yqI4iaB1Qhu1Sbc3qy7nJaViTATAoIhHpw8LUnNKfJXvcIlIPN39iWI4SPffc119T2cI MoJNx5zIDUkKtRiCH6t/y3fXav/K1uJdHCt7Pbed16mBWmbZAfebALexJ5C9w8/JhMq2 1jFNoaekV/MjW03SrGtnJ5OiC+Np6WknrpaxSzlBviV167AzSPJcCoqv3/Bznh297fFU ZqyTSS8EZKq3V7bNZGc+emHw4IQuY8Ak2kyw7hhzyQLenK1nf/ZXBYxc5NKTNpEuKdyu BPyg== 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 :dkim-signature; bh=mBfKXBJBDHVK+Yn8iTiZud/hY3U7WgMo73YMptZicWs=; b=gt4oKrwVIiscjWgzFlYpwsEZCW17nckF4g0G2QAli69hgbgNWVe/ftf4jYegmMpp1U WBsYY2f1t3vehQzXAO1UictR/Y1Wh3w/It/M10MrwlqwnWZTOxEFtqvofksdSl+mMvwy Hssjho1PEmhuACoXKDu0E3PKKnf9Zyguz5nCf00WmBmJiHs2I77+p7+JDSbUzL4Jy5// m6pbjMJut0/Ssbm5kkPdbFWcZd+kjcuDV+tHchKjhf/UvWtrJocTeDH285t4jkw0v729 Pv3kx+s66BhvObtdnN8hBEwghWMjrS22udCN2bLBzYS0OSqrHxYqq/UlAcZjNWJR7u/K FlOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TOAuHtZj; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r16-20020a1709062cd000b008d17b125783si10922970ejr.835.2023.03.07.01.28.00; Tue, 07 Mar 2023 01:28:23 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TOAuHtZj; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230061AbjCGIu0 (ORCPT + 99 others); Tue, 7 Mar 2023 03:50:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229972AbjCGIuN (ORCPT ); Tue, 7 Mar 2023 03:50:13 -0500 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EC8B38EB5 for ; Tue, 7 Mar 2023 00:50:10 -0800 (PST) Received: by mail-ed1-x52b.google.com with SMTP id cy23so49137341edb.12 for ; Tue, 07 Mar 2023 00:50:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678179009; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mBfKXBJBDHVK+Yn8iTiZud/hY3U7WgMo73YMptZicWs=; b=TOAuHtZjM3Ijc0PfNTcNtMrGRTmPJYiEm1CvHah72QXea4yC2xxYX1TNeuMNhRIGkj +lUwq3preMtRpKrJlkkuetb2G69HAiO1Ryr9AFLiFbY1LCEFiYzWyAyWYn8T6Bi0taRK bh+2KKVrQVXqPzbaQZyUdn9XD7X6QJL/5op9mBP93ruy+K0PSWhSOJpdOosJyfyA8yUN WMoYmuclPwU2wGd0UJhoTPt7NJ1R7pNTSr1FMW2a7SESYAGIFm5ahgK7vRuDa8v7RUM9 stZoT83PLOeNfrytDNfQtSps3HuXvxa+OQOR7jNWSs2Cq0S2Gx8jCJj/Yzgw5yM5cwkN zmgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678179009; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mBfKXBJBDHVK+Yn8iTiZud/hY3U7WgMo73YMptZicWs=; b=nkl0asPydh80q/QwLUCyeG3GsP4o8G7fTLfO23O2R34UGfp3U3+VtKgw6oKHFaHvBC wwkcuoSGQve/hY59fahQ8+6zOSynH8KbTfPHkXg3gkIwW7bBHr2SDGBXr8ldpoyxDKFw CeW5UrI+V9J8eZTwZFEl4DOOI2GFP+b3iYYpKfXa1DjsWdBAI+8QhA+I75fam3Nw6PnA 0cTEIp6oTp6KbfdUXfNV/OvNwwUltCcB1kfhFIpJuu+wp5wRw6qcByNbciQoaLKbIYfw 4ssuV1Zi350VyqRKQBxuutkJslFvUu6cCHOjYIFOJp6qCgbNxiEfPNa6YU3niQ0rvhRo 8xEg== X-Gm-Message-State: AO0yUKVgavvjFxjYWKtgvQqe3sVE267yj7nQQFUeALOX//0TCrTRKJCK Ec5GaZb5H5e8+Ucyy5539Kw= X-Received: by 2002:a17:907:8691:b0:8b1:3009:536b with SMTP id qa17-20020a170907869100b008b13009536bmr16987639ejc.29.1678179009200; Tue, 07 Mar 2023 00:50:09 -0800 (PST) Received: from localhost.localdomain (ip5f5abbe7.dynamic.kabel-deutschland.de. [95.90.187.231]) by smtp.gmail.com with ESMTPSA id o21-20020a170906289500b008ef42f9cf48sm5707402ejd.82.2023.03.07.00.50.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 00:50:09 -0800 (PST) From: Michael Straube To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Straube Subject: [PATCH 2/2] staging: r8188eu: bgrpkey_handshake is set but never used Date: Tue, 7 Mar 2023 09:50:03 +0100 Message-Id: <20230307085003.5025-3-straube.linux@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307085003.5025-1-straube.linux@gmail.com> References: <20230307085003.5025-1-straube.linux@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759700638344599887?= X-GMAIL-MSGID: =?utf-8?q?1759700638344599887?= The field bgrpkey_handshake of struct security_priv is set but never used. Remove it. Signed-off-by: Michael Straube --- drivers/staging/r8188eu/core/rtw_mlme.c | 1 - drivers/staging/r8188eu/include/rtw_security.h | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c index fb7d0e161fdd..809ac0317db2 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme.c +++ b/drivers/staging/r8188eu/core/rtw_mlme.c @@ -944,7 +944,6 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str if (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { padapter->securitypriv.binstallGrpkey = false; padapter->securitypriv.busetkipkey = false; - padapter->securitypriv.bgrpkey_handshake = false; psta->ieee8021x_blocked = true; psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm; memset((u8 *)&psta->dot118021x_UncstKey, 0, sizeof(union Keytype)); diff --git a/drivers/staging/r8188eu/include/rtw_security.h b/drivers/staging/r8188eu/include/rtw_security.h index 783ae18a122a..8c187de7a522 100644 --- a/drivers/staging/r8188eu/include/rtw_security.h +++ b/drivers/staging/r8188eu/include/rtw_security.h @@ -116,7 +116,6 @@ struct security_priv { u8 binstallGrpkey; u8 busetkipkey; u8 bcheck_grpkey; - u8 bgrpkey_handshake; s32 sw_encrypt;/* from registry_priv */ s32 sw_decrypt;/* from registry_priv */ s32 hw_decrypted;/* if the rx packets is hw_decrypted==false,i