All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] staging: rtl8723bs: rename u1bTmp to val
@ 2026-01-28 17:16 Luka Gejak
  2026-01-28 17:16 ` [PATCH 2/3] staging: rtl8723bs: modernize hex output and WMM check Luka Gejak
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Luka Gejak @ 2026-01-28 17:16 UTC (permalink / raw)
  To: gregkh; +Cc: straube.linux, linux-staging, linux-kernel, Luka Gejak

Remove Hungarian notation by renaming u1bTmp to val.
Also fix spacing around operators in the affected lines 
to comply with kernel coding style.

Signed-off-by: Luka Gejak <lukagejak5@gmail.com>
---
 .../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 24 +++++++-------
 drivers/staging/rtl8723bs/hal/sdio_halinit.c  | 32 +++++++++----------
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index 57c83f332e74..a4ebf9182f5b 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -17,8 +17,8 @@ static void _FWDownloadEnable(struct adapter *padapter, bool enable)
 
 	if (enable) {
 		/*  8051 enable */
-		tmp = rtw_read8(padapter, REG_SYS_FUNC_EN+1);
-		rtw_write8(padapter, REG_SYS_FUNC_EN+1, tmp|0x04);
+		tmp = rtw_read8(padapter, REG_SYS_FUNC_EN + 1);
+		rtw_write8(padapter, REG_SYS_FUNC_EN + 1, tmp | 0x04);
 
 		tmp = rtw_read8(padapter, REG_MCUFWDL);
 		rtw_write8(padapter, REG_MCUFWDL, tmp|0x01);
@@ -162,9 +162,9 @@ void _8051Reset8723(struct adapter *padapter)
 	io_rst &= ~BIT(0);
 	rtw_write8(padapter, REG_RSV_CTRL+1, io_rst);
 
-	cpu_rst = rtw_read8(padapter, REG_SYS_FUNC_EN+1);
+	cpu_rst = rtw_read8(padapter, REG_SYS_FUNC_EN + 1);
 	cpu_rst &= ~BIT(2);
-	rtw_write8(padapter, REG_SYS_FUNC_EN+1, cpu_rst);
+	rtw_write8(padapter, REG_SYS_FUNC_EN + 1, cpu_rst);
 
 	/*  Enable 8051 IO wrapper */
 	/*  0x1c[8] = 1 */
@@ -172,9 +172,9 @@ void _8051Reset8723(struct adapter *padapter)
 	io_rst |= BIT(0);
 	rtw_write8(padapter, REG_RSV_CTRL+1, io_rst);
 
-	cpu_rst = rtw_read8(padapter, REG_SYS_FUNC_EN+1);
+	cpu_rst = rtw_read8(padapter, REG_SYS_FUNC_EN + 1);
 	cpu_rst |= BIT(2);
-	rtw_write8(padapter, REG_SYS_FUNC_EN+1, cpu_rst);
+	rtw_write8(padapter, REG_SYS_FUNC_EN + 1, cpu_rst);
 }
 
 u8 g_fwdl_chksum_fail;
@@ -259,7 +259,7 @@ static s32 _FWFreeToGo(struct adapter *adapter, u32 min_cnt, u32 timeout_ms)
 void rtl8723b_FirmwareSelfReset(struct adapter *padapter)
 {
 	struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
-	u8 u1bTmp;
+	u8 val;
 	u8 Delay = 100;
 
 	if (
@@ -268,19 +268,19 @@ void rtl8723b_FirmwareSelfReset(struct adapter *padapter)
 		/* 0x1cf = 0x20. Inform 8051 to reset. 2009.12.25. tynli_test */
 		rtw_write8(padapter, REG_HMETFR+3, 0x20);
 
-		u1bTmp = rtw_read8(padapter, REG_SYS_FUNC_EN+1);
-		while (u1bTmp & BIT2) {
+		val = rtw_read8(padapter, REG_SYS_FUNC_EN + 1);
+		while (val & BIT2) {
 			Delay--;
 			if (Delay == 0)
 				break;
 			udelay(50);
-			u1bTmp = rtw_read8(padapter, REG_SYS_FUNC_EN+1);
+			val = rtw_read8(padapter, REG_SYS_FUNC_EN + 1);
 		}
 
 		if (Delay == 0) {
 			/* force firmware reset */
-			u1bTmp = rtw_read8(padapter, REG_SYS_FUNC_EN+1);
-			rtw_write8(padapter, REG_SYS_FUNC_EN+1, u1bTmp&(~BIT2));
+			val = rtw_read8(padapter, REG_SYS_FUNC_EN + 1);
+			rtw_write8(padapter, REG_SYS_FUNC_EN + 1, val & (~BIT2));
 		}
 	}
 }
diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
index 4e81ef53dc47..668616efa68a 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
@@ -589,7 +589,7 @@ u32 rtl8723bs_hal_init(struct adapter *padapter)
 	struct hal_com_data *pHalData;
 	struct pwrctrl_priv *pwrctrlpriv;
 	u32 NavUpper = WiFiNavUpperUs;
-	u8 u1bTmp;
+	u8 val;
 
 	pHalData = GET_HAL_DATA(padapter);
 	pwrctrlpriv = adapter_to_pwrctl(padapter);
@@ -780,9 +780,9 @@ u32 rtl8723bs_hal_init(struct adapter *padapter)
 	pHalData->SdioTxOQTMaxFreeSpace = pHalData->SdioTxOQTFreeSpace;
 
 	/*  Enable MACTXEN/MACRXEN block */
-	u1bTmp = rtw_read8(padapter, REG_CR);
-	u1bTmp |= (MACTXEN | MACRXEN);
-	rtw_write8(padapter, REG_CR, u1bTmp);
+	val = rtw_read8(padapter, REG_CR);
+	val |= (MACTXEN | MACRXEN);
+	rtw_write8(padapter, REG_CR, val);
 
 	rtw_hal_set_hwreg(padapter, HW_VAR_NAV_UPPER, (u8 *)&NavUpper);
 
@@ -848,7 +848,7 @@ u32 rtl8723bs_hal_init(struct adapter *padapter)
 /*  */
 static void CardDisableRTL8723BSdio(struct adapter *padapter)
 {
-	u8 u1bTmp;
+	u8 val;
 	u8 bMacPwrCtrlOn;
 
 	/*  Run LPS WL RFOFF flow */
@@ -856,26 +856,26 @@ static void CardDisableRTL8723BSdio(struct adapter *padapter)
 
 	/* 	==== Reset digital sequence   ====== */
 
-	u1bTmp = rtw_read8(padapter, REG_MCUFWDL);
-	if ((u1bTmp & RAM_DL_SEL) && padapter->bFWReady) /* 8051 RAM code */
+	val = rtw_read8(padapter, REG_MCUFWDL);
+	if ((val & RAM_DL_SEL) && padapter->bFWReady) /* 8051 RAM code */
 		rtl8723b_FirmwareSelfReset(padapter);
 
 	/*  Reset MCU 0x2[10]= 0. Suggested by Filen. 2011.01.26. by tynli. */
-	u1bTmp = rtw_read8(padapter, REG_SYS_FUNC_EN + 1);
-	u1bTmp &= ~BIT(2);	/*  0x2[10], FEN_CPUEN */
-	rtw_write8(padapter, REG_SYS_FUNC_EN + 1, u1bTmp);
+	val = rtw_read8(padapter, REG_SYS_FUNC_EN + 1);
+	val &= ~BIT(2);	/*  0x2[10], FEN_CPUEN */
+	rtw_write8(padapter, REG_SYS_FUNC_EN + 1, val);
 
 	/*  MCUFWDL 0x80[1:0]= 0 */
 	/*  reset MCU ready status */
 	rtw_write8(padapter, REG_MCUFWDL, 0);
 
 	/*  Reset MCU IO Wrapper, added by Roger, 2011.08.30 */
-	u1bTmp = rtw_read8(padapter, REG_RSV_CTRL + 1);
-	u1bTmp &= ~BIT(0);
-	rtw_write8(padapter, REG_RSV_CTRL + 1, u1bTmp);
-	u1bTmp = rtw_read8(padapter, REG_RSV_CTRL + 1);
-	u1bTmp |= BIT(0);
-	rtw_write8(padapter, REG_RSV_CTRL+1, u1bTmp);
+	val = rtw_read8(padapter, REG_RSV_CTRL + 1);
+	val &= ~BIT(0);
+	rtw_write8(padapter, REG_RSV_CTRL + 1, val);
+	val = rtw_read8(padapter, REG_RSV_CTRL + 1);
+	val |= BIT(0);
+	rtw_write8(padapter, REG_RSV_CTRL + 1, val);
 
 	/* 	==== Reset digital sequence end ====== */
 
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] staging: rtl8723bs: modernize hex output and WMM check
  2026-01-28 17:16 [PATCH 1/3] staging: rtl8723bs: rename u1bTmp to val Luka Gejak
@ 2026-01-28 17:16 ` Luka Gejak
  2026-01-29  7:18   ` Dan Carpenter
  2026-01-31  4:26   ` kernel test robot
  2026-01-28 17:16 ` [PATCH 3/3] staging: rtl8723bs: remove dead debugging code in rtw_mlme_ext.c Luka Gejak
  2026-01-29  7:11 ` [PATCH 1/3] staging: rtl8723bs: rename u1bTmp to val Dan Carpenter
  2 siblings, 2 replies; 6+ messages in thread
From: Luka Gejak @ 2026-01-28 17:16 UTC (permalink / raw)
  To: gregkh; +Cc: straube.linux, linux-staging, linux-kernel, Luka Gejak

Use %*ph for hex dumps to simplify code.
Refactor WMM IE check to use memcmp() and validate length first for safety.

Signed-off-by: Luka Gejak <lukagejak5@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 98704179ad35..4b671cde97f0 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -2000,7 +2000,8 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_
 	while (i < in_len) {
 		ielength = initial_out_len;
 
-		if (in_ie[i] == 0xDD && in_ie[i+2] == 0x00 && in_ie[i+3] == 0x50  && in_ie[i+4] == 0xF2 && in_ie[i+5] == 0x02 && i+5 < in_len) { /* WMM element ID and OUI */
+		if (i + 5 < in_len && in_ie[i] == 0xDD &&
+		    !memcmp(&in_ie[i + 2], "\x00\x50\xf2\x02", 4)) {
 			for (j = i; j < i + 9; j++) {
 				out_ie[ielength] = in_ie[j];
 				ielength++;
@@ -2084,8 +2085,7 @@ static void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
 		len = sec_ie[1] + 2;
 		len = (len < IW_CUSTOM_MAX) ? len : IW_CUSTOM_MAX;
 
-		for (i = 0; i < len; i++)
-			p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "%02x", sec_ie[i]);
+		p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), " %*ph", len, sec_ie);
 
 		p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), ")");
 
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] staging: rtl8723bs: remove dead debugging code in rtw_mlme_ext.c
  2026-01-28 17:16 [PATCH 1/3] staging: rtl8723bs: rename u1bTmp to val Luka Gejak
  2026-01-28 17:16 ` [PATCH 2/3] staging: rtl8723bs: modernize hex output and WMM check Luka Gejak
@ 2026-01-28 17:16 ` Luka Gejak
  2026-01-29  7:11 ` [PATCH 1/3] staging: rtl8723bs: rename u1bTmp to val Dan Carpenter
  2 siblings, 0 replies; 6+ messages in thread
From: Luka Gejak @ 2026-01-28 17:16 UTC (permalink / raw)
  To: gregkh; +Cc: straube.linux, linux-staging, linux-kernel, Luka Gejak

The if (0) block in rtw_mlme_ext.c is unreachable and contains
manual hex printing code that is no longer needed.
Removing this cleans up the driver and follows the staging TODO list.

Signed-off-by: Luka Gejak <lukagejak5@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index ac49bfbaa5bb..b61841bf16a5 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -1849,7 +1849,6 @@ unsigned int OnAction_ht(struct adapter *padapter, union recv_frame *precv_frame
 unsigned int OnAction_sa_query(struct adapter *padapter, union recv_frame *precv_frame)
 {
 	u8 *pframe = precv_frame->u.hdr.rx_data;
-	struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
 	struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
 	unsigned short tid;
 
@@ -1865,14 +1864,6 @@ unsigned int OnAction_sa_query(struct adapter *padapter, union recv_frame *precv
 	default:
 		break;
 	}
-	if (0) {
-		int pp;
-
-		netdev_dbg(padapter->pnetdev, "pattrib->pktlen = %d =>", pattrib->pkt_len);
-		for (pp = 0; pp < pattrib->pkt_len; pp++)
-			pr_cont(" %02x ", pframe[pp]);
-		pr_cont("\n");
-	}
 
 	return _SUCCESS;
 }
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] staging: rtl8723bs: rename u1bTmp to val
  2026-01-28 17:16 [PATCH 1/3] staging: rtl8723bs: rename u1bTmp to val Luka Gejak
  2026-01-28 17:16 ` [PATCH 2/3] staging: rtl8723bs: modernize hex output and WMM check Luka Gejak
  2026-01-28 17:16 ` [PATCH 3/3] staging: rtl8723bs: remove dead debugging code in rtw_mlme_ext.c Luka Gejak
@ 2026-01-29  7:11 ` Dan Carpenter
  2 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2026-01-29  7:11 UTC (permalink / raw)
  To: Luka Gejak; +Cc: gregkh, straube.linux, linux-staging, linux-kernel

On Wed, Jan 28, 2026 at 06:16:33PM +0100, Luka Gejak wrote:
> Remove Hungarian notation by renaming u1bTmp to val.
> Also fix spacing around operators in the affected lines 
> to comply with kernel coding style.

Do the "also" part in a separate patch, it's unrelated.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/3] staging: rtl8723bs: modernize hex output and WMM check
  2026-01-28 17:16 ` [PATCH 2/3] staging: rtl8723bs: modernize hex output and WMM check Luka Gejak
@ 2026-01-29  7:18   ` Dan Carpenter
  2026-01-31  4:26   ` kernel test robot
  1 sibling, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2026-01-29  7:18 UTC (permalink / raw)
  To: Luka Gejak; +Cc: gregkh, straube.linux, linux-staging, linux-kernel

On Wed, Jan 28, 2026 at 06:16:34PM +0100, Luka Gejak wrote:
> Use %*ph for hex dumps to simplify code.
> Refactor WMM IE check to use memcmp() and validate length first for safety.
> 

It's great that you are doing this, but these are two unrelated changes.
The "Refactor" change is a bugfix and needs a Fixes tag.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/3] staging: rtl8723bs: modernize hex output and WMM check
  2026-01-28 17:16 ` [PATCH 2/3] staging: rtl8723bs: modernize hex output and WMM check Luka Gejak
  2026-01-29  7:18   ` Dan Carpenter
@ 2026-01-31  4:26   ` kernel test robot
  1 sibling, 0 replies; 6+ messages in thread
From: kernel test robot @ 2026-01-31  4:26 UTC (permalink / raw)
  To: Luka Gejak, gregkh
  Cc: llvm, oe-kbuild-all, straube.linux, linux-staging, linux-kernel,
	Luka Gejak

Hi Luka,

kernel test robot noticed the following build warnings:

[auto build test WARNING on staging/staging-linus]
[also build test WARNING on linus/master v6.19-rc7]
[cannot apply to staging/staging-testing staging/staging-next next-20260130]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Luka-Gejak/staging-rtl8723bs-modernize-hex-output-and-WMM-check/20260129-012011
base:   staging/staging-linus
patch link:    https://lore.kernel.org/r/20260128171635.39879-2-lukagejak5%40gmail.com
patch subject: [PATCH 2/3] staging: rtl8723bs: modernize hex output and WMM check
config: i386-randconfig-012-20260131 (https://download.01.org/0day-ci/archive/20260131/202601311229.Q4R3mSEP-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260131/202601311229.Q4R3mSEP-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601311229.Q4R3mSEP-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/staging/rtl8723bs/core/rtw_mlme.c:2072:16: warning: unused variable 'i' [-Wunused-variable]
    2072 |         u8 *buff, *p, i;
         |                       ^
   1 warning generated.


vim +/i +2072 drivers/staging/rtl8723bs/core/rtw_mlme.c

554c0a3abf216c Hans de Goede   2017-03-29  2068  
522440e4176a67 Michael Straube 2025-08-01  2069  static void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
522440e4176a67 Michael Straube 2025-08-01  2070  {
522440e4176a67 Michael Straube 2025-08-01  2071  	uint	len;
522440e4176a67 Michael Straube 2025-08-01 @2072  	u8 *buff, *p, i;
522440e4176a67 Michael Straube 2025-08-01  2073  	union iwreq_data wrqu;
522440e4176a67 Michael Straube 2025-08-01  2074  
522440e4176a67 Michael Straube 2025-08-01  2075  	buff = NULL;
522440e4176a67 Michael Straube 2025-08-01  2076  	if (authmode == WLAN_EID_VENDOR_SPECIFIC) {
522440e4176a67 Michael Straube 2025-08-01  2077  		buff = rtw_zmalloc(IW_CUSTOM_MAX);
522440e4176a67 Michael Straube 2025-08-01  2078  		if (!buff)
522440e4176a67 Michael Straube 2025-08-01  2079  			return;
522440e4176a67 Michael Straube 2025-08-01  2080  
522440e4176a67 Michael Straube 2025-08-01  2081  		p = buff;
522440e4176a67 Michael Straube 2025-08-01  2082  
522440e4176a67 Michael Straube 2025-08-01  2083  		p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "ASSOCINFO(ReqIEs =");
522440e4176a67 Michael Straube 2025-08-01  2084  
522440e4176a67 Michael Straube 2025-08-01  2085  		len = sec_ie[1] + 2;
522440e4176a67 Michael Straube 2025-08-01  2086  		len = (len < IW_CUSTOM_MAX) ? len : IW_CUSTOM_MAX;
522440e4176a67 Michael Straube 2025-08-01  2087  
f053642fd6f8e2 Luka Gejak      2026-01-28  2088  		p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), " %*ph", len, sec_ie);
522440e4176a67 Michael Straube 2025-08-01  2089  
522440e4176a67 Michael Straube 2025-08-01  2090  		p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), ")");
522440e4176a67 Michael Straube 2025-08-01  2091  
522440e4176a67 Michael Straube 2025-08-01  2092  		memset(&wrqu, 0, sizeof(wrqu));
522440e4176a67 Michael Straube 2025-08-01  2093  
522440e4176a67 Michael Straube 2025-08-01  2094  		wrqu.data.length = p - buff;
522440e4176a67 Michael Straube 2025-08-01  2095  
522440e4176a67 Michael Straube 2025-08-01  2096  		wrqu.data.length = (wrqu.data.length < IW_CUSTOM_MAX) ? wrqu.data.length : IW_CUSTOM_MAX;
522440e4176a67 Michael Straube 2025-08-01  2097  
522440e4176a67 Michael Straube 2025-08-01  2098  		kfree(buff);
522440e4176a67 Michael Straube 2025-08-01  2099  	}
522440e4176a67 Michael Straube 2025-08-01  2100  }
522440e4176a67 Michael Straube 2025-08-01  2101  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-01-31  4:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-28 17:16 [PATCH 1/3] staging: rtl8723bs: rename u1bTmp to val Luka Gejak
2026-01-28 17:16 ` [PATCH 2/3] staging: rtl8723bs: modernize hex output and WMM check Luka Gejak
2026-01-29  7:18   ` Dan Carpenter
2026-01-31  4:26   ` kernel test robot
2026-01-28 17:16 ` [PATCH 3/3] staging: rtl8723bs: remove dead debugging code in rtw_mlme_ext.c Luka Gejak
2026-01-29  7:11 ` [PATCH 1/3] staging: rtl8723bs: rename u1bTmp to val Dan Carpenter

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.