From nobody Mon Feb 9 01:43:19 2026 Received: from xmbghk7.mail.qq.com (xmbghk7.mail.qq.com [43.163.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5738686323 for ; Thu, 18 Dec 2025 14:46:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=43.163.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766069205; cv=none; b=AwXex/ewR11iJF30Psic5J54rcWiIzN3zPo7fyViN3XQg2LPbGoucHEx0l9GKU6okB7/ldzfwWSDKtVSn0fPLJhv1jzvm+4bIXhY2nnsAV7KOKVo0ZDsW1Xe5ghACibcGi6QouoOPQgUeHlYqcF6dNiMKOoYthdSCcLIhPvErOI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766069205; c=relaxed/simple; bh=kywbGSrEf5SlA24+P+b+U7NcBB9Kw6aEZxSB/83raSM=; h=Message-ID:From:To:Cc:Subject:Date:MIME-Version; b=MjdMx03VD0Mn9jnvdErtG7Wvop68KaawxGhDtLPRsSquhCVjHMVT7U+ki+ifFy9kTtmwoRDt+EUhQn3L3nFotgCpq3b2s0+Vy+SjDEbB5VLQ6Q7h5aHbt6C+9D8/0ygL6I4/uib2Oi8QE4fkXGGn0PUA79mKgoUS2i46YUkWT6Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com; spf=pass smtp.mailfrom=qq.com; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b=cdPiQ2qB; arc=none smtp.client-ip=43.163.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qq.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b="cdPiQ2qB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1766069194; bh=+3y8x1oMl/4jEV2v6gvzLwler/9x6dXiB3mwZsdxQio=; h=From:To:Cc:Subject:Date; b=cdPiQ2qB3ltAxU2dm+33epsHNglgf1Z40AX/vaLwh+qfNy6SApyboEzgGqgqClT7M +4U+mxJHCZa4p7l516Lw4+21f0S6EWgjLmh8mwlTXdw/jZnhm6ZzSMRzO0mS9EfSEI rSiQyBoUETbY/C2HUVn46q0cEra9a7/Prfq8fV+I= Received: from cjz-VMware-Virtual-Platform.localdomain ([110.176.98.92]) by newxmesmtplogicsvrsza63-0.qq.com (NewEsmtp) with SMTP id B9F87A28; Thu, 18 Dec 2025 22:46:31 +0800 X-QQ-mid: xmsmtpt1766069191tjxwhz6fu Message-ID: X-QQ-XMAILINFO: NdB5/PuY7PjGTBoeiXKRB5cr0PZcyF23FwM0FdiN3+0Govu3p2sfUrvCxHkAQD /e6Pxw6CaY1sXoZHxH+d4ElGlnixFl3g3a7sJgpS0cJQFcNtEBu+x2y8UAorpsGm2k3PvkfetNla 0WjHriBtRRQJMIR901bxccEIfaT0WaYTlXho0qVT4wcDz00Fx6mFArAVlaZST6j9fOXrXXka7psJ VzQzkRWJeT6IF6sN9PuDdCckMyWUGkYTYgJpAFCpPYKactu7dLWo3IDG1HbuBd8/pE+ewscawwIB 65PWZSETpDb0QT5VSHR8x+SS53FWkjX90pGYfcDtJFKt7aeckiOztBHS1KsdXuHZVFIYx/SuHWEx e3zFCm2EV0V7mhzYOsJhAGX9yXmkofFe1Xc5JeQ7eH1PpO8YB1fYK1C4b4FKe3seLT5kxYNt2a/Y d5fve3yq5V48N3feHCBcf+fW8rRaGvW9tzzt+VuAjCFW4im4H0ub6pvsRh2IqoK7rP7hwV0RL0zZ 6B+SUumYjxIE5MWlHyjbsykV7zjm8VoHS5ZH7PFKKPcEKdQ+ghyIgAsbfX/g8aqXYOy7mv7lDLF7 XkynuowDvKg4zUBBZpxQ/WeXdS367BEBmWrI8ds/h3AgrKan/DBLLCsJN6b69IafVIwRiW+pJX/C qUy6GDKrWAh6sNlM1WS44uMsYJYdWxgrRGByt9XvtoYEXZWfFU9E4rckkHB+q+7k7cuoTjFGzoTA yQSSpmtPebb/SWxXLf6TmPvDKoP/+7/emortAYoWc+2Hxf24iPWih+CBMLn6B64xFXCPmFg09CR+ Micrj8LjGgvU2z+cOsdJtGX939kh+/A3d2V9wWJP+mItO/wfOtroUyiQfX+WiHnyH87jziBB3kz0 /0gGMxFk4J7NZiKHhAU2UxWOwNSre9fNNxfF9r0oGjydaho+4PN33cEwWRsQfoBTOTK7t07m19B8 NNZwSBDlj9DNIQT8ju1nWWNbt+DWF+PtDUH0ms8Dl0rPNQY/VTIPX1MH8s5UnRkIDfYiDSmJxKrm uwkHteauBtkz4HzWhk X-QQ-XMRINFO: NI4Ajvh11aEj8Xl/2s1/T8w= From: cjz To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, changjunzheng Subject: [PATCH v2] rtl8723bs: Replace atomic_t with int for continual_io_error (no concurrency) Date: Thu, 18 Dec 2025 22:46:28 +0800 X-OQ-MSGID: <20251218144628.16191-1-guagua210311@qq.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: changjunzheng The 'continual_io_error' variable is defined as atomic_t, but all call sites of rtw_inc_and_chk_continual_io_error/rtw_reset_continual_io_error are in process context (sdio_ops_linux.c/sdio_intf.c, SDIO read/write retry logic). There is no interrupt/thread concurrency modifying this variable, so atomic operations are unnecessary and introduce slight performance overhead. This change replaces atomic_t with a normal int, and replaces atomic_inc_re= turn()/atomic_set() with ordinary increment/assignment, keeping all functional logic unchanged. --- v2 changes: 1. Remove redundant 'error_count' variable and fix variable declaration pos= ition (comply with kernel coding standards). 2. Simplify the function logic of rtw_inc_and_chk_continual_io_error. Signed-off-by: changjunzheng --- drivers/staging/rtl8723bs/core/rtw_io.c | 10 +++------- drivers/staging/rtl8723bs/include/drv_types.h | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_io.c b/drivers/staging/rtl8= 723bs/core/rtw_io.c index fe9f94001eed..0f52710e6d3a 100644 --- a/drivers/staging/rtl8723bs/core/rtw_io.c +++ b/drivers/staging/rtl8723bs/core/rtw_io.c @@ -139,16 +139,12 @@ int rtw_init_io_priv(struct adapter *padapter, void (= *set_intf_ops)(struct adapt */ int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj) { - int error_count =3D atomic_inc_return(&dvobj->continual_io_error); - - if (error_count > MAX_CONTINUAL_IO_ERR) - return true; - - return false; + dvobj->continual_io_error++; + return (dvobj->continual_io_error > MAX_CONTINUAL_IO_ERR); } =20 /* Set the continual_io_error of this @param dvobjprive to 0 */ void rtw_reset_continual_io_error(struct dvobj_priv *dvobj) { - atomic_set(&dvobj->continual_io_error, 0); + dvobj->continual_io_error =3D 0; } diff --git a/drivers/staging/rtl8723bs/include/drv_types.h b/drivers/stagin= g/rtl8723bs/include/drv_types.h index f86180dc350c..bd7bb5828d56 100644 --- a/drivers/staging/rtl8723bs/include/drv_types.h +++ b/drivers/staging/rtl8723bs/include/drv_types.h @@ -279,7 +279,7 @@ struct dvobj_priv { u8 Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */ =20 u8 irq_alloc; - atomic_t continual_io_error; + int continual_io_error; =20 atomic_t disable_func; =20 --=20 2.43.0