[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251228145823.3250174-1-s9430939@naver.com>
Date: Sun, 28 Dec 2025 23:58:23 +0900
From: Minu Jin <s9430939@...er.com>
To: gregkh@...uxfoundation.org
Cc: linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org,
s9430939@...er.com
Subject: [PATCH] staging: rtl8723bs: use PTR_ALIGN for buffer alignment
Replace manual pointer alignment calculation with the standard PTR_ALIGN
macro in rtw_init_cmd_priv()
This improves code readability and ensures the use of kernel's
preferred alignment mechanism instead of manual calculation
Signed-off-by: Minu Jin <s9430939@...er.com>
---
drivers/staging/rtl8723bs/core/rtw_cmd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index ef2d92b5588a..0d2e8fade9c4 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -7,6 +7,7 @@
#include <drv_types.h>
#include <hal_btcoex.h>
#include <linux/jiffies.h>
+#include <linux/align.h>
static struct _cmd_callback rtw_cmd_callback[] = {
{GEN_CMD_CODE(_Read_MACREG), NULL}, /*0*/
@@ -175,7 +176,7 @@ int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
if (!pcmdpriv->cmd_allocated_buf)
return -ENOMEM;
- pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ - ((SIZE_PTR)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ-1));
+ pcmdpriv->cmd_buf = PTR_ALIGN(pcmdpriv->cmd_allocated_buf, CMDBUFF_ALIGN_SZ);
pcmdpriv->rsp_allocated_buf = rtw_zmalloc(MAX_RSPSZ + 4);
--
2.43.0
Powered by blists - more mailing lists