mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rishik Yechuri <epicrishik@gmail.com>
To: Ping-Ke Shih <pkshih@realtek.com>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	Rishik Yechuri <rishik.yechuri.code@gmail.com>
Subject: [PATCH rtw-next 6/6] wifi: rtlwifi: remove byte(), packet_get_type() and FILL_OCTET_STRING()
Date: Tue, 10 Nov 2026 12:44:09 -0600	[thread overview]
Message-ID: <20261110184409.42205-7-rishik.yechuri.code@gmail.com> (raw)
In-Reply-To: <20261110184409.42205-1-rishik.yechuri.code@gmail.com>

byte() in wifi.h has a single user. rtl8192se takes the low byte of the
firmware header version with it, which is just a mask. Open code that
as & 0xff.

packet_get_type() and FILL_OCTET_STRING() have no users at all.
packet_get_type() also refers to EF1BYTE(), which no longer exists in
the driver, so it could not be used even if someone wanted to.

Remove the three macros.

No functional change intended.

Signed-off-by: Rishik Yechuri <rishik.yechuri.code@gmail.com>
Assisted-by: Claude:claude-fable-5-1
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c | 2 +-
 drivers/net/wireless/realtek/rtlwifi/wifi.h         | 7 -------
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
index 0719d0bb2cac..c18d5fffb0a1 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
@@ -334,7 +334,7 @@ int rtl92s_download_fw(struct ieee80211_hw *hw)
 	/* 1. Retrieve FW header. */
 	firmware->pfwheader = (struct fw_hdr *) puc_mappedfile;
 	pfwheader = firmware->pfwheader;
-	firmware->firmwareversion =  byte(pfwheader->version, 0);
+	firmware->firmwareversion = pfwheader->version & 0xff;
 	firmware->pfwheader->fwpriv.hci_sel = 1;/* pcie */
 
 	rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD,
diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h
index e289a88e9666..98b685754e8a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/wifi.h
+++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h
@@ -2806,9 +2806,6 @@ enum bt_radio_shared {
 	BT_RADIO_INDIVIDUAL = 1,
 };
 
-#define byte(x, n) ((x >> (8 * n)) & 0xff)
-
-#define packet_get_type(_packet) (EF1BYTE((_packet).octet[0]) & 0xFC)
 #define RTL_WATCH_DOG_TIME	2000
 #define rtl_dm(rtlpriv)		(&((rtlpriv)->dm))
 
@@ -2833,10 +2830,6 @@ enum bt_radio_shared {
 #define	RT_SET_PS_LEVEL(ppsc, _ps_flg)		\
 	(ppsc->cur_ps_level |= _ps_flg)
 
-#define FILL_OCTET_STRING(_os, _octet, _len)	\
-		(_os).octet = (u8 *)(_octet);		\
-		(_os).length = (_len);
-
 #define	LDPC_HT_ENABLE_RX			BIT(0)
 #define	LDPC_HT_ENABLE_TX			BIT(1)
 #define	LDPC_HT_TEST_TX_ENABLE			BIT(2)
-- 
2.43.0


      parent reply	other threads:[~2026-11-10 18:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 18:44 [PATCH rtw-next 0/6] wifi: rtlwifi: replace the 802.11 header helper macros with kernel ones Rishik Yechuri
2026-11-10 18:44 ` [PATCH rtw-next 1/6] wifi: rtlwifi: use struct ieee80211_pspoll for the PS Poll reserved page Rishik Yechuri
2026-11-10 18:44 ` [PATCH rtw-next 2/6] wifi: rtlwifi: use struct ieee80211_hdr for the reserved page headers Rishik Yechuri
2026-11-10 18:44 ` [PATCH rtw-next 3/6] wifi: rtlwifi: call msecs_to_jiffies() directly Rishik Yechuri
2026-11-10 18:44 ` [PATCH rtw-next 4/6] wifi: rtlwifi: rtl8192se: use ALIGN() for the H2C command length Rishik Yechuri
2026-11-10 18:44 ` [PATCH rtw-next 5/6] wifi: rtlwifi: use ieee80211_is_ctl() instead of WLAN_FC_GET_TYPE() Rishik Yechuri
2026-11-10 18:44 ` Rishik Yechuri [this message]

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=20261110184409.42205-7-rishik.yechuri.code@gmail.com \
    --to=epicrishik@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.com \
    --cc=rishik.yechuri.code@gmail.com \
    /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

all inboxes | Powered by JetHome®