From patchwork Sun Oct 30 17:33:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 13016 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1893736wru; Sun, 30 Oct 2022 10:35:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5y2Fd+vMgrUEdhMqyj3NbiBWizK8bQogAlJ1XRcljp3Cp0ASBpRsovFcZAPFCYNzi1pWL7 X-Received: by 2002:a17:907:daa:b0:78d:9bc9:7d7a with SMTP id go42-20020a1709070daa00b0078d9bc97d7amr8913322ejc.567.1667151317086; Sun, 30 Oct 2022 10:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667151317; cv=none; d=google.com; s=arc-20160816; b=S4zveQiTQarjiWV1p7uXEBdXQhZZSZabfGeUjyT/8t0BV2qqf0lz1ZpCFSJwBk3Iog 254ovZpYSJ59OKu/KJLcHavfzasesNkX5EgxCauJ85SDjDK0IpI+xU5FSsBKMItFfSou H9HTRzRofyeBsFQ2PIB3J7kWZsK2g2DWMN8CVccispc7C/BLwrX/Zp1EaMbeBa3QTUwU flc+QrgRajt77wJMNNsUtTUeCu8W0VQOgG5riT4fTWBUMJluB7Qc3bXiQuW4jiELqjNv 2FU59E8/QVKnfjIuCyzvitb3r5QcOd/9EXD2ySANf0D1HAWezbczWRM0Jf9PcbDsCh/W 24Rg== 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=+4nFpzvycB+rWza2dr2Uynel0dTJ66Cwt69EkBFU7MY=; b=iyfTCwC0O0EyCCMzKsmJBEPJ74iVotNl2jjXLxKwaDR6/mSkwCufAvwB8v32jbyzvp 8WpEqrMjV1P9aI75G+Rp/mfmoPRDWBkznZ4bbGfnSf2MN+gzNB4XURYJRHs2nXmikBnO +pH7FFmAdq3WVfmtCLSXS/aYjY72cawo5Bj6uFfpH+cWNrWHRs2khIAgnKv80+KASVSo L8xmmk/AaXKsY3fUyOxEh1FG5l1WceAoeUwigtjXWvvERXbKVFuYZwzeKEFqOG+O1oWR k9Oj2P9uI+e8qlaYsxc0F+6X8r4Uz/GddanSO1qp498oRJal2ZABJoeuwN7VQ7yZR4ZU DCGQ== 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 s4-20020a17090699c400b007a8dddc7ec8si5012423ejn.382.2022.10.30.10.34.53; Sun, 30 Oct 2022 10:35:17 -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 S229822AbiJ3Rdv (ORCPT + 99 others); Sun, 30 Oct 2022 13:33:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbiJ3Rdu (ORCPT ); Sun, 30 Oct 2022 13:33:50 -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 3165595B4 for ; Sun, 30 Oct 2022 10:33:46 -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 1opCBp-000469-NY; Sun, 30 Oct 2022 18:33:41 +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 01/13] staging: r8188eu: replace a GetAddr1Ptr call Date: Sun, 30 Oct 2022 18:33:14 +0100 Message-Id: <20221030173326.1588647-2-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?1748134859644250071?= X-GMAIL-MSGID: =?utf-8?q?1748134859644250071?= Define a struct ieee80211_mgmt and use it to read the destination address. This replaces one call to the driver-specific GetAddr1Ptr function, which should eventually be removed. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 127dbc4e8b9a..5a366688a3f7 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3815,13 +3815,14 @@ static unsigned int on_action_public_default(struct recv_frame *precv_frame) unsigned int on_action_public(struct adapter *padapter, struct recv_frame *precv_frame) { + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; unsigned int ret = _FAIL; u8 *pframe = precv_frame->rx_data; u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); u8 category, action; /* check RA matches or not */ - if (memcmp(myid(&padapter->eeprompriv), GetAddr1Ptr(pframe), ETH_ALEN)) + if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN)) goto exit; category = frame_body[0];