All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Kulikov <nikolayof23@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-staging@lists.linux.dev, ethantidmore06@gmail.com,
	Nikolay Kulikov <nikolayof23@gmail.com>
Subject: [PATCH v2 4/6] staging: rtl8723bs: remove custom is_zero_mac_addr() function
Date: Mon, 23 Mar 2026 18:06:06 +0300	[thread overview]
Message-ID: <20260323150650.7168-5-nikolayof23@gmail.com> (raw)
In-Reply-To: <20260323150650.7168-1-nikolayof23@gmail.com>

Remove the custom function is_zero_mac_addr() and replace all calls to it
with the default kernel function is_zero_ether_addr() to avoid
duplicating existing code.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_ioctl_set.c | 2 +-
 drivers/staging/rtl8723bs/core/rtw_mlme.c      | 2 +-
 drivers/staging/rtl8723bs/include/ieee80211.h  | 6 ------
 3 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
index eb4a32a998ae..c20a143ace4b 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
@@ -11,7 +11,7 @@ u8 rtw_validate_bssid(u8 *bssid)
 {
 	u8 ret = true;
 
-	if (is_zero_mac_addr(bssid) ||
+	if (is_zero_ether_addr(bssid) ||
 	    is_broadcast_mac_addr(bssid) ||
 	    is_multicast_mac_addr(bssid))
 		ret = false;
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 5516593bc8ab..43c2c3afa81e 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1694,7 +1694,7 @@ static int rtw_check_roaming_candidate(struct mlme_priv *mlme
 		goto exit;
 
 	/* got specific addr to roam */
-	if (!is_zero_mac_addr(mlme->roam_tgt_addr)) {
+	if (!is_zero_ether_addr(mlme->roam_tgt_addr)) {
 		if (!memcmp(mlme->roam_tgt_addr, competitor->network.mac_address, ETH_ALEN))
 			goto update;
 		else
diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
index 14c806a22b38..37b9b363c073 100644
--- a/drivers/staging/rtl8723bs/include/ieee80211.h
+++ b/drivers/staging/rtl8723bs/include/ieee80211.h
@@ -518,12 +518,6 @@ static inline int is_broadcast_mac_addr(const u8 *addr)
 		(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
 }
 
-static inline int is_zero_mac_addr(const u8 *addr)
-{
-	return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) &&   \
-		(addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));
-}
-
 #define CFG_IEEE80211_RESERVE_FCS (1<<0)
 #define CFG_IEEE80211_COMPUTE_FCS (1<<1)
 
-- 
2.53.0


  parent reply	other threads:[~2026-03-23 15:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 12:14 [PATCH 0/5] replace custom functions with kernel network Nikolay Kulikov
2026-03-20 12:14 ` [PATCH 1/5] staging: rtl8723bs: replace deeply nested if-else with switch-case Nikolay Kulikov
2026-03-20 17:30   ` Ethan Tidmore
2026-03-22  8:19     ` Nikolay Kulikov
2026-03-20 12:15 ` [PATCH 2/5] staging: rtl8723bs: move logical operators to end of previous line Nikolay Kulikov
2026-03-20 12:15 ` [PATCH 3/5] staging: rtl8723bs: remove custom is_zero_mac_addr() function Nikolay Kulikov
2026-03-20 12:15 ` [PATCH 4/5] staging: rtl8723bs: remove custom is_broadcast_mac_addr() function Nikolay Kulikov
2026-03-20 12:15 ` [PATCH 5/5] staging: rtl8723bs: remove custom is_multicast_mac_addr() function Nikolay Kulikov
2026-03-23 15:06 ` [PATCH v2 0/6] replace custom functions with kernel network functions Nikolay Kulikov
2026-03-23 15:06   ` [PATCH v2 1/6] staging: rtl8723bs: replace deeply nested if-else with switch-case Nikolay Kulikov
2026-03-23 15:06   ` [PATCH v2 2/6] staging: rtl8723bs: remove dead code in validate_recv_mgnt_frame() Nikolay Kulikov
2026-03-23 15:06   ` [PATCH v2 3/6] staging: rtl8723bs: move logical operators to end of previous line Nikolay Kulikov
2026-03-23 15:06   ` Nikolay Kulikov [this message]
2026-03-23 15:06   ` [PATCH v2 5/6] staging: rtl8723bs: remove custom is_broadcast_mac_addr() function Nikolay Kulikov
2026-03-23 15:06   ` [PATCH v2 6/6] staging: rtl8723bs: remove custom is_multicast_mac_addr() function Nikolay Kulikov

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=20260323150650.7168-5-nikolayof23@gmail.com \
    --to=nikolayof23@gmail.com \
    --cc=ethantidmore06@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-staging@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.