From patchwork Sun Oct 30 17:33:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 13022 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1893989wru; Sun, 30 Oct 2022 10:35:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4b97rQex59XiqkWqbppd2M+9cYAZtqNIrozA7X4ywhXW/28p+cR37JTg1rPYTCou6gpG0B X-Received: by 2002:a17:907:c03:b0:781:fd5a:c093 with SMTP id ga3-20020a1709070c0300b00781fd5ac093mr9122265ejc.89.1667151351623; Sun, 30 Oct 2022 10:35:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667151351; cv=none; d=google.com; s=arc-20160816; b=jMn/1TzpC0U3TPyOAdmoeJvE0VQjlXfiOYBD0wanwfialBLNC5z+sR4UBCztJw3Wx9 gfVubJf8/8wKo8g+kUuj5LYrCHakTtXljOIMRQUQxphgiG5AX8rEO/BK5jjpc5tz3nB6 fSHaQ0cfCxv0DYp9B5EQZu55iGouzAIwsPwSZ7N6ABCC5HaaOc68vYJ4YRffGV664IzD oYpRbAtfefjM4oMYZJqVKabVEplzc7eFFDstWxPgPdqakNle57FlcImkx3oMYWdb4UnL /lnGCAeo+N7wn3D5BJj/Ok6UCj3y1kBRJlqNBptGJ/nOc1Y+ZbmonENHL0lkyKaQBeFF ty4g== 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=FIPzMOo/7ZY4X/JJTF9vCJkO6336Krn30eUPwsuZ/Do=; b=SeDfEwM261ggro+SJL4yJbBZvkK+2843EBp2Auel4SfnjKEMMHrPulSRQRwpp/C7+S swgZEUUjG/xPnC/iMCMlxUJT36xFWNepJ3bhR9iBHJmfJ8GHwIiGAfxa+ECc9nNpFULc DDZajSjiZEi6qIhUt+8yw2NiOJExLY0XmKielIK2uaJ54ws4wJtAOLyLJPIjF6iHfvrd ChXV0xBRqsQt1hq5kjEcrmTGtRqJ6+0yCx9ilOnekZicyazTNkKoZ4AnSr0H1K4xqQzp iYClQxeu1ebk4kZH11OQzotpTOZFQJlSjuU2juPLJIC+qaTo7g7ekKoLQkmG7RJKkVLJ a25A== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d25-20020a170906175900b0078b85fdf4e4si4264328eje.532.2022.10.30.10.35.28; Sun, 30 Oct 2022 10:35:51 -0700 (PDT) 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 S229927AbiJ3ReN (ORCPT + 99 others); Sun, 30 Oct 2022 13:34:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229826AbiJ3Rdv (ORCPT ); Sun, 30 Oct 2022 13:33:51 -0400 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 463B495B4 for ; Sun, 30 Oct 2022 10:33:51 -0700 (PDT) Received: from ipservice-092-217-067-184.092.217.pools.vodafone-ip.de ([92.217.67.184] 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 1opCBt-000469-Le; Sun, 30 Oct 2022 18:33:45 +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 v2 06/13] staging: r8188eu: remove category check in OnAction_p2p Date: Sun, 30 Oct 2022 18:33:19 +0100 Message-Id: <20221030173326.1588647-7-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221030173326.1588647-1-martin@kaiser.cx> References: <20221030173326.1588647-1-martin@kaiser.cx> MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748134895726168967?= X-GMAIL-MSGID: =?utf-8?q?1748134895726168967?= The caller of OnAction_p2p has already checked the action category. We can remove the check in OnAction_p2p. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index f1054192bfb1..efcb2f3b6d3f 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3835,7 +3835,7 @@ static void on_action_public(struct adapter *padapter, struct recv_frame *precv_ static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame) { u8 *frame_body; - u8 category, OUI_Subtype; + u8 OUI_Subtype; u8 *pframe = precv_frame->rx_data; uint len = precv_frame->len; struct wifidirect_info *pwdinfo = &padapter->wdinfo; @@ -3846,10 +3846,6 @@ static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_fram frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); - category = frame_body[0]; - if (category != RTW_WLAN_CATEGORY_P2P) - return; - if (be32_to_cpu(*((__be32 *)(frame_body + 1))) != P2POUI) return;