linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: rafiqul713 <rafiqul713@gmail.com>
To: netdev@vger.kernel.org
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
	rafiqul713 <rafiqul713@gmail.com>
Subject: [PATCH] [PATCH] staging: rtl8723bs: use ether_addr_equal in rtw_ap.c
Date: Sat,  1 Nov 2025 21:16:23 +0100	[thread overview]
Message-ID: <20251101201623.185575-1-rafiqul713@gmail.com> (raw)

Replace memcmp() with ether_addr_equal() for MAC address comparison.
This is the preferred and more readable method in network code.

Signed-off-by: rafiqul713 <rafiqul713@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_ap.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
index 0908f2234f67..7cfd4088ce8e 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -6,6 +6,7 @@
  ******************************************************************************/
 
 #include <drv_types.h>
+#include <linux/etherdevice.h>
 #include <linux/unaligned.h>
 
 void init_mlme_ap_info(struct adapter *padapter)
@@ -1185,7 +1186,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
 	list_for_each(plist, phead) {
 		paclnode = list_entry(plist, struct rtw_wlan_acl_node, list);
 
-		if (!memcmp(paclnode->addr, addr, ETH_ALEN)) {
+		if (ether_addr_equal(paclnode->addr, addr)) {
 			if (paclnode->valid == true) {
 				added = true;
 				break;
@@ -1238,7 +1239,7 @@ void rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
 		paclnode = list_entry(plist, struct rtw_wlan_acl_node, list);
 
 		if (
-			!memcmp(paclnode->addr, addr, ETH_ALEN) ||
+			ether_addr_equal(paclnode->addr, addr) ||
 			is_broadcast_ether_addr(addr)
 		) {
 			if (paclnode->valid) {
-- 
2.34.1


             reply	other threads:[~2025-11-01 20:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-01 20:16 rafiqul713 [this message]
2025-11-02 11:31 ` [PATCH] [PATCH] staging: rtl8723bs: use ether_addr_equal in rtw_ap.c Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251101201623.185575-1-rafiqul713@gmail.com \
    --to=rafiqul713@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).