From: Minu Jin Date: Sun, 28 Dec 2025 14:58:23 +0000 (+0900) Subject: staging: rtl8723bs: use PTR_ALIGN for buffer alignment X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69dc48dc550640b1c33e30f32620fe5ef1b068e9;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://patch.msgid.link/20251228145823.3250174-1-s9430939@naver.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index 27eddd22e064..d746f0d205ea 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -7,6 +7,7 @@ #include #include #include +#include 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);