From patchwork Sat Oct 29 17:23:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 12750 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439390wru; Sat, 29 Oct 2022 10:24:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4SwKdvMFZpvLqjnqKZ0KZsM6hjFjAB9cggg3jYRH6J2SdM7L2XGJKmekcnk77HF9UaIaAC X-Received: by 2002:a17:903:247:b0:186:dd94:bc06 with SMTP id j7-20020a170903024700b00186dd94bc06mr5310241plh.98.1667064296007; Sat, 29 Oct 2022 10:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064296; cv=none; d=google.com; s=arc-20160816; b=ZKh4MKURYkH+gvBeIEb21fiC+O3uz44ia2sW/9yzCgv2Eoxjubb7NESBh+9VAt2jhG JdLHF6HiENMLIAp7N5EF/IpDTPqxHa0Ls3mtYtbSL2I/CVveebT0m253JP3azYjo1DT4 CC3gv2j4FounKKkqZSdSj0G0YZ4NegYvzGnTlstCccrwK0WGloH45qh+KiycJqwD86Df auwjQOnzbA9oYBRGE9NjhFV+y2tOnE/iQEU+WAZHahO7fpyE2GuKPZ2A8U1L5cgdsQnU KFUFjYW/95nYi1Du4H6N1x7gsvUzchYIuR267vjiE+1Kn9esUCHNdaBVQBDueQsMPsxa o6oQ== 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=xGkbsYIGdf1bX1Xk2rKt73iY72Ic2c2JIuLKhOGR4RaCGTPKFi8DxR8kkfTHFDX/LL lZOwqJIT5UipGQb/dB4wU+DDkPQNQnFiIzvgLZKQvDfI5J88f29s6p+510nvvWP+PjX8 8iNd99S/GhKTRSz8QclddOKTKgeBK05MNFkKtet7m8taeGhsMoa1OXJCu5gpStzwdVM+ vhzzLcxg7BC5Af9J4wss1XI81BJcDDO0MdFBQAB1boo0Ft4ZzHfptUxGRumMiRK7DkZM kfuOnz17gr1cRqeOIPIhc/B9yjA8RWQkAjfhtyxqlldSf61+QuPsoPDvuXJdIndCOJbp NlfA== 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 b23-20020a170902b61700b00186a2d376afsi2426009pls.273.2022.10.29.10.24.43; Sat, 29 Oct 2022 10:24:55 -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 S229744AbiJ2RYA (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229727AbiJ2RX7 (ORCPT ); Sat, 29 Oct 2022 13:23:59 -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 947F5402E5 for ; Sat, 29 Oct 2022 10:23:57 -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 1oopYn-00074v-S8; Sat, 29 Oct 2022 19:23:53 +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 01/13] staging: r8188eu: replace a GetAddr1Ptr call Date: Sat, 29 Oct 2022 19:23:25 +0200 Message-Id: <20221029172337.1574593-2-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?1748043611601805468?= X-GMAIL-MSGID: =?utf-8?q?1748043611601805468?= 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];