From patchwork Mon Oct 31 20:54:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 13441 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2547297wru; Mon, 31 Oct 2022 14:07:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5t06gbmQWqyoCE3ynQx03uTOYGgVc1XFF7ydKnzZDyGX+2Qf/XYKabHGUnHBQOlcA/SJBZ X-Received: by 2002:a17:907:a0c9:b0:7ad:dc98:d9d2 with SMTP id hw9-20020a170907a0c900b007addc98d9d2mr4777496ejc.310.1667250454309; Mon, 31 Oct 2022 14:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667250454; cv=none; d=google.com; s=arc-20160816; b=s1Oh6p5XsxyiiOsdv57RSOBjG7VpIo9GHcwnYMzIpO1Vl36VJSTJTPEh9OzPtL9i58 cEmwkh3GV59LevlROsHq/oIllZ3Vm59a7WKrgd4kgJJ8w1lVi5IuVsaDdcq0tTZZeFXz yL1hTLt283RB0mssA507kS/Kr28cM1j17/ux+oFWNhe9aMTkSwySwGuSJi2LoT4iyaGk 1xA9CSQPOJCyf/evqE+updrEtNgWe+83Iia5PZr4xDhDR6pEKQve86kWuztbwlVuxg1p 1vrmGEDRNDsdakQlt8JmPjUlwfGd/b3Q5bLCpj+qVyHdK9XhB9iyPxQd15aLh9huhk0T Bfog== 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=KG138z2VDLgPQTMe33TSkheuxHiqtYTg+jz69pDePlg=; b=RCpeauXWWi/Xp98w84rAxQq1P7Bgt7pmkqr7bYrqlJu/v45w78XaUYxX0N3JJs9BDd A7EAmP5VnPu7w4oKhbP9SRyjThydE/J+QD3vPZeE8j2Uq3Gi2ZC9f16JtB1zu3D58EHD wQgB7vGJOg9n/Bn5xpp08LkcNJd7O2McDrZBjnCnh+ME6Do6OL4Xm8zSogYV/BrJtYrg Bvjr6QJgnkYin1iHGU4a8hotFwVEdWmDlyYMyEJYED7947h+U/nOmkSHVmEWF6KExule 1ofknEbKbokDqkfcNZfG4TXvl4ZdUsMKLVID1sBzk/iPpLETzQacDqtWUR2rGv2GdNmJ IkAA== 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 z14-20020a056402274e00b0045cecdc1fbcsi11470248edd.9.2022.10.31.14.07.08; Mon, 31 Oct 2022 14:07:34 -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 S230171AbiJaUzO (ORCPT + 99 others); Mon, 31 Oct 2022 16:55:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230106AbiJaUy6 (ORCPT ); Mon, 31 Oct 2022 16:54:58 -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 B5FCFD10E for ; Mon, 31 Oct 2022 13:54:57 -0700 (PDT) Received: from dslb-084-059-234-234.084.059.pools.vodafone-ip.de ([84.59.234.234] 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 1opbo5-0006z9-R0; Mon, 31 Oct 2022 21:54:53 +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 , Joe Perches Subject: [PATCH 1/3] staging: r8188eu: use ether_addr_equal for address comparison Date: Mon, 31 Oct 2022 21:54:10 +0100 Message-Id: <20221031205412.124871-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031205412.124871-1-martin@kaiser.cx> References: <20221031205412.124871-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?1748238812322061649?= X-GMAIL-MSGID: =?utf-8?q?1748238812322061649?= We can use ether_addr_equal instead of memcmp in update_recvframe_phyinfo_88e for comparing the incoming frame's destination address with our local address. Both struct ieee80211_hdr and struct eeprom_priv's mac_addr component are 2-byte aligned. Suggested-by: Joe Perches Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c b/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c index f01ae71bcdb1..10bb2e602984 100644 --- a/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c +++ b/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c @@ -126,8 +126,8 @@ void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_stat get_bssid(&padapter->mlmepriv), ETH_ALEN)); pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID && - (!memcmp(ieee80211_get_DA(hdr), - myid(&padapter->eeprompriv), ETH_ALEN)); + ether_addr_equal(ieee80211_get_DA(hdr), + myid(&padapter->eeprompriv)); pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && ieee80211_is_beacon(fc); if (pkt_info.bPacketBeacon) {