All of lore.kernel.org
 help / color / mirror / Atom feed
From: luka.gejak@linux.dev
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Dan Carpenter <dan.carpenter@linaro.org>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Luka Gejak <luka.gejak@linux.dev>
Subject: [PATCH v3 13/22] staging: rtl8723bs: hal: fix line lengths in rtl8723b_hal_init.c
Date: Sun,  8 Feb 2026 12:01:02 +0100	[thread overview]
Message-ID: <20260208110111.46642-14-luka.gejak@linux.dev> (raw)
In-Reply-To: <20260208110111.46642-1-luka.gejak@linux.dev>

From: Luka Gejak <luka.gejak@linux.dev>

Break long lines exceeding 100 characters to comply with kernel coding
style.

Signed-off-by: Luka Gejak <luka.gejak@linux.dev>
---
 .../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 64 ++++++++++++-------
 1 file changed, 41 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index 54dbcea89491..8505909725bc 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -58,7 +58,10 @@ static int _BlockWrite(struct adapter *padapter, void *buffer, u32 buffSize)
 	remainSize_p1 = buffSize % blockSize_p1;
 
 	for (i = 0; i < blockCount_p1; i++) {
-		ret = rtw_write32(padapter, (FW_8723B_START_ADDRESS + i * blockSize_p1), *((u32 *)(bufferPtr + i * blockSize_p1)));
+		u32 addr = FW_8723B_START_ADDRESS + i * blockSize_p1;
+		u32 data = *((u32 *)(bufferPtr + i * blockSize_p1));
+
+		ret = rtw_write32(padapter, addr, data);
 		if (ret == _FAIL) {
 			netdev_dbg(padapter->pnetdev, "write failed at %s %d, block:%d\n",
 				   __func__, __LINE__, i);
@@ -261,27 +264,34 @@ void rtl8723b_FirmwareSelfReset(struct adapter *padapter)
 	struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
 	u8 val;
 	u8 Delay = 100;
+	bool old_fw;
 
-	if (
-		!(IS_FW_81xxC(padapter) && ((pHalData->FirmwareVersion < 0x21) || (pHalData->FirmwareVersion == 0x21 && pHalData->FirmwareSubVersion < 0x01)))
-	) { /*  after 88C Fw v33.1 */
-		/* 0x1cf = 0x20. Inform 8051 to reset. 2009.12.25. tynli_test */
-		rtw_write8(padapter, REG_HMETFR+3, 0x20);
+	/* Check for old firmware version */
+	old_fw = IS_FW_81xxC(padapter) &&
+		 ((pHalData->FirmwareVersion < 0x21) ||
+		  (pHalData->FirmwareVersion == 0x21 &&
+		   pHalData->FirmwareSubVersion < 0x01));
+
+	if (old_fw)
+		return;
 
+	/* after 88C Fw v33.1 */
+	/* 0x1cf = 0x20. Inform 8051 to reset. 2009.12.25. tynli_test */
+	rtw_write8(padapter, REG_HMETFR + 3, 0x20);
+
+	val = rtw_read8(padapter, REG_SYS_FUNC_EN + 1);
+	while (val & BIT2) {
+		Delay--;
+		if (Delay == 0)
+			break;
+		udelay(50);
 		val = rtw_read8(padapter, REG_SYS_FUNC_EN + 1);
-		while (val & BIT2) {
-			Delay--;
-			if (Delay == 0)
-				break;
-			udelay(50);
-			val = rtw_read8(padapter, REG_SYS_FUNC_EN + 1);
-		}
+	}
 
-		if (Delay == 0) {
-			/* force firmware reset */
-			val = rtw_read8(padapter, REG_SYS_FUNC_EN + 1);
-			rtw_write8(padapter, REG_SYS_FUNC_EN + 1, val & (~BIT2));
-		}
+	if (Delay == 0) {
+		/* force firmware reset */
+		val = rtw_read8(padapter, REG_SYS_FUNC_EN + 1);
+		rtw_write8(padapter, REG_SYS_FUNC_EN + 1, val & (~BIT2));
 	}
 }
 
@@ -998,9 +1008,13 @@ void rtl8723b_SetBeaconRelatedRegisters(struct adapter *padapter)
 	rtw_write32(padapter, REG_TCR, value32);
 
 	/*  NOTE: Fix test chip's bug (about contention windows's randomness) */
-	if (check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE|WIFI_AP_STATE) == true) {
-		rtw_write8(padapter, REG_RXTSF_OFFSET_CCK, 0x50);
-		rtw_write8(padapter, REG_RXTSF_OFFSET_OFDM, 0x50);
+	{
+		u16 state_mask = WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE | WIFI_AP_STATE;
+
+		if (check_fwstate(&padapter->mlmepriv, state_mask)) {
+			rtw_write8(padapter, REG_RXTSF_OFFSET_CCK, 0x50);
+			rtw_write8(padapter, REG_RXTSF_OFFSET_OFDM, 0x50);
+		}
 	}
 
 	_BeaconFunctionEnable(padapter, true, true);
@@ -1653,7 +1667,9 @@ static u8 fill_txdesc_sectype(struct pkt_attrib *pattrib)
 	return sectype;
 }
 
-static void fill_txdesc_vcs_8723b(struct adapter *padapter, struct pkt_attrib *pattrib, struct txdesc_8723b *ptxdesc)
+static void fill_txdesc_vcs_8723b(struct adapter *padapter,
+				  struct pkt_attrib *pattrib,
+				  struct txdesc_8723b *ptxdesc)
 {
 	if (pattrib->vcs_mode) {
 		switch (pattrib->vcs_mode) {
@@ -1684,7 +1700,9 @@ static void fill_txdesc_vcs_8723b(struct adapter *padapter, struct pkt_attrib *p
 	}
 }
 
-static void fill_txdesc_phy_8723b(struct adapter *padapter, struct pkt_attrib *pattrib, struct txdesc_8723b *ptxdesc)
+static void fill_txdesc_phy_8723b(struct adapter *padapter,
+				  struct pkt_attrib *pattrib,
+				  struct txdesc_8723b *ptxdesc)
 {
 	if (pattrib->ht_en) {
 		ptxdesc->data_bw = BWMapping_8723B(padapter, pattrib);
-- 
2.52.0


  parent reply	other threads:[~2026-02-08 11:01 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-08 11:00 [PATCH v3 00/22] staging: rtl8723bs: fix out-of-bounds and various cleanups luka.gejak
2026-02-08 11:00 ` [PATCH v3 01/22] staging: rtl8723bs: fix potential out-of-bounds read in rtw_restruct_wmm_ie luka.gejak
2026-02-23 14:18   ` Greg Kroah-Hartman
2026-02-08 11:00 ` [PATCH v3 02/22] staging: rtl8723bs: remove unused rtl8192c function declarations luka.gejak
2026-02-08 11:00 ` [PATCH v3 03/22] staging: rtl8723bs: remove unused RECV_BLK defines luka.gejak
2026-02-08 11:00 ` [PATCH v3 04/22] staging: rtl8723bs: remove unused MAX_PATH_NUM defines luka.gejak
2026-02-08 11:00 ` [PATCH v3 05/22] staging: rtl8723bs: convert PSTA_INFO_T to struct sta_info * luka.gejak
2026-02-08 11:00 ` [PATCH v3 06/22] staging: rtl8723bs: remove NDIS type aliases luka.gejak
2026-02-08 11:00 ` [PATCH v3 07/22] staging: rtl8723bs: remove redundant MAC_ARG macro luka.gejak
2026-02-08 11:00 ` [PATCH v3 08/22] staging: rtl8723bs: core: fix line lengths in rtw_wlan_util.c luka.gejak
2026-02-08 11:00 ` [PATCH v3 09/22] staging: rtl8723bs: core: fix line lengths in rtw_recv.c luka.gejak
2026-02-08 11:00 ` [PATCH v3 10/22] staging: rtl8723bs: hal: fix line lengths in HalPhyRf_8723B.c luka.gejak
2026-02-08 11:01 ` [PATCH v3 11/22] staging: rtl8723bs: os_dep: fix line lengths in ioctl_cfg80211.c luka.gejak
2026-02-08 11:01 ` [PATCH v3 12/22] staging: rtl8723bs: hal: fix line lengths in rtl8723b_cmd.c luka.gejak
2026-02-08 11:01 ` luka.gejak [this message]
2026-02-08 11:01 ` [PATCH v3 14/22] staging: rtl8723bs: hal: fix line lengths in rtl8723b_phycfg.c luka.gejak
2026-02-08 11:01 ` [PATCH v3 15/22] staging: rtl8723bs: core: fix various line length overflows luka.gejak
2026-02-08 11:01 ` [PATCH v3 16/22] staging: rtl8723bs: hal: " luka.gejak
2026-02-08 11:01 ` [PATCH v3 17/22] staging: rtl8723bs: os_dep: " luka.gejak
2026-02-08 11:01 ` [PATCH v3 18/22] staging: rtl8723bs: core: fix line lengths in rtw_cmd.c luka.gejak
2026-02-08 11:01 ` [PATCH v3 19/22] staging: rtl8723bs: core: fix line lengths in rtw_mlme_ext.c luka.gejak
2026-02-08 11:01 ` [PATCH v3 20/22] staging: rtl8723bs: core: fix line lengths in rtw_mlme.c luka.gejak
2026-02-08 11:01 ` [PATCH v3 21/22] staging: rtl8723bs: core: fix line lengths in rtw_xmit.c luka.gejak
2026-02-08 11:01 ` [PATCH v3 22/22] staging: rtl8723bs: core: fix various line length overflows luka.gejak

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=20260208110111.46642-14-luka.gejak@linux.dev \
    --to=luka.gejak@linux.dev \
    --cc=dan.carpenter@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.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.