From patchwork Sat Oct 29 17:23:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 12756 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439766wru; Sat, 29 Oct 2022 10:26:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7zijODWdXkjMmPuH6Tf7/otoCZzIZcmsfHDUhHgbt342M6gS8ghSsj92KVHTiKEZE8eskQ X-Received: by 2002:a05:6a00:a94:b0:562:dcbb:47c3 with SMTP id b20-20020a056a000a9400b00562dcbb47c3mr5600349pfl.79.1667064374822; Sat, 29 Oct 2022 10:26:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064374; cv=none; d=google.com; s=arc-20160816; b=TuMFPj4dVdMwWQ1ZoGHvEiY3i25dGWLMUfSbTKSF+0f/a5l6CkTWEVartKq5dQf//v d0LdTFDTUBEaVWUN093jN/t6/ZhslP/ah6hr0/1WSiz9p+879QSZgIDijuhVffTh/ldb Ar5pLJQAnRkeEbtood7BQCpAt3H214kvF9+biA8vBwOCrtYrKQFQoWgCGtO2LZ0DXrfN ZLU6V36+j2E7NZZ1RP9h0Uz+rZKikr+acTCLhaARd9SHcg1fn9rxfKyQyPGloS9u/AP4 9lbjJdAi0M5zMk0u/tkA99YxZ48ZSQDPSOLl84Mi4+IpIKPcq0L9BHFSEMlpLoGaxsqI Wt/w== 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=xucvsVs4NhnGYaPGBS0xBYYt3ezp5YpiLO2H6O3Jwo0=; b=KAoeOnUrAT4Oj3BapRI0kuVcRieU4Q1Eqqw6EWgVxgA+h37jw34FigcXbnPIfdBBUU /fJVgD7aj5SriPgVoIalE6qidSPWMYMeWKkW9Mn3/lummLjM12Os9v7CRNmaZVvKx+Au BEn4Lf5GNz4Q1ZPprSCYLF6iUFUlClzc8mszl6ToH3c0GYmGBWY2nvFMfIyHRzK+1d2x aW0Ugl0GTw1ufrNvWBaN9Tz3uunQn7ZC6tltFkfqRBLHDghRD/Me2rZHg8D6oGA3YYD8 KtJ8bSGhbjhj63u5NUFr5ehRFlEWMFomGnsl6uJtHhKp+b3W7HpGUg8PvRcDny8QKylW uifg== 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 oa7-20020a17090b1bc700b0021311a385c3si2707305pjb.46.2022.10.29.10.26.02; Sat, 29 Oct 2022 10:26:14 -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 S229934AbiJ2RYW (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiJ2RYI (ORCPT ); Sat, 29 Oct 2022 13:24:08 -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 41D9A40E24 for ; Sat, 29 Oct 2022 10:24:01 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] 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 1oopYs-00074v-2S; Sat, 29 Oct 2022 19:23:58 +0200 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 06/13] staging: r8188eu: remove category check in OnAction_p2p Date: Sat, 29 Oct 2022 19:23:30 +0200 Message-Id: <20221029172337.1574593-7-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-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?1748043694282753864?= X-GMAIL-MSGID: =?utf-8?q?1748043694282753864?= 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 0c2db015656f..97bcef078ea2 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3836,7 +3836,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; @@ -3847,10 +3847,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;