lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <EE88D4787656615D+20260110101801.5820-2-2023060904@ycu.edu.cn>
Date: Sat, 10 Jan 2026 18:17:58 +0800
From: 2023060904@....edu.cn
To: gregkh@...uxfoundation.org
Cc: linux-staging@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	2023060904@....edu.cn,
	guagua210311@...com
Subject: [PATCH 1/3] rtl8723bs: io: Add independent rtw_check_continual_io_error function

From: changjunzheng <guagua210311@...com>

Add a new function to check if the error count exceeds the MAX_CONTINUAL_IO_ERR
threshold. This function follows the single responsibility principle and
prepares for the subsequent removal of the global continual_io_error variable.

Changelog v3 -> v4:
1. Split the single v3 patch into 4 logical patches (per Greg KH's request)
2. Fix all coding style errors (trailing spaces, missing assignment spaces, indentation)
3. Add clear, purpose-driven commit messages for each patch
4. Add version changelog as required by kernel documentation
5. Add blank line before new function declaration to comply with coding style

Signed-off-by: changjunzheng <guagua210311@...com>
---
 drivers/staging/rtl8723bs/core/rtw_io.c    | 16 ++--------------
 drivers/staging/rtl8723bs/include/rtw_io.h |  3 +--
 2 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_io.c b/drivers/staging/rtl8723bs/core/rtw_io.c
index 0f52710e6d3a..cd455cfcf046 100644
--- a/drivers/staging/rtl8723bs/core/rtw_io.c
+++ b/drivers/staging/rtl8723bs/core/rtw_io.c
@@ -132,19 +132,7 @@ int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct adapt
 	return _SUCCESS;
 }
 
-/*
- * Increase and check if the continual_io_error of this @param dvobjprive is larger than MAX_CONTINUAL_IO_ERR
- * @return true:
- * @return false:
- */
-int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
-{
-	dvobj->continual_io_error++;
-	return (dvobj->continual_io_error > MAX_CONTINUAL_IO_ERR);
-}
-
-/* Set the continual_io_error of this @param dvobjprive to 0 */
-void rtw_reset_continual_io_error(struct dvobj_priv *dvobj)
+bool rtw_check_continual_io_error(int error_count)
 {
-	dvobj->continual_io_error = 0;
+	return (error_count > MAX_CONTINUAL_IO_ERR) ? true : false;
 }
diff --git a/drivers/staging/rtl8723bs/include/rtw_io.h b/drivers/staging/rtl8723bs/include/rtw_io.h
index adf1de4d7924..8ae8849f5fd9 100644
--- a/drivers/staging/rtl8723bs/include/rtw_io.h
+++ b/drivers/staging/rtl8723bs/include/rtw_io.h
@@ -48,8 +48,6 @@ struct	intf_hdl {
 #define SD_IO_TRY_CNT (8)
 #define MAX_CONTINUAL_IO_ERR SD_IO_TRY_CNT
 
-int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj);
-void rtw_reset_continual_io_error(struct dvobj_priv *dvobj);
 
 struct io_priv {
 
@@ -70,5 +68,6 @@ extern int rtw_write32(struct adapter *adapter, u32 addr, u32 val);
 extern u32 rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
 
 int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct adapter *padapter, struct _io_ops *pops));
+bool rtw_check_continual_io_error(int error_count);
 
 #endif	/* _RTL8711_IO_H_ */
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ