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@naver.com>
Link: https://patch.msgid.link/20251228145823.3250174-1-s9430939@naver.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Minu Jin 2025-12-28 23:58:23 +09:00 committed by Greg Kroah-Hartman
parent 2e2d0c710c
commit 69dc48dc55

View File

@ -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);