Skip to contentSkip to conversation

staging: rtl8723bs: Use PTR_ALIGN for rsp_buf alignment

PATCH In review Parsal Baral 2 participants 3 messages Jun 3 – Jul 7 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: Use PTR_ALIGN for rsp_buf alignment

Replace manual pointer alignment calculation with the standard PTR_ALIGN macro for rsp_buf in rtw_init_cmd_priv()

Follows modernization of cmd_buf alignment in commit 69dc48dc5506 ("staging: rtl8723bs: use PTR_ALIGN for buffer alignment")

Compile-tested only

---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +1 -1
index c1185c25e..38ce3156c 100644
@@ -184,7 +184,7 @@ int rtw_init_cmd_priv(struct	cmd_priv *pcmdpriv)
 		return -ENOMEM;
 	}
 
-	pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
+	pcmdpriv->rsp_buf = PTR_ALIGN(pcmdpriv->rsp_allocated_buf, 4);
 
 	pcmdpriv->cmd_issued_cnt = 0;
 	pcmdpriv->cmd_done_cnt = 0;
Signature · 1 line
2.54.0
maintainer
#1 lore raw
Quoted 30 lines · Parsal Baral

Replace manual pointer alignment calculation with the standard PTR_ALIGN macro for rsp_buf in rtw_init_cmd_priv()

Follows modernization of cmd_buf alignment in commit 69dc48dc5506 ("staging: rtl8723bs: use PTR_ALIGN for buffer alignment")

Compile-tested only

---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +1 -1
index c1185c25e..38ce3156c 100644
@@ -184,7 +184,7 @@ int rtw_init_cmd_priv(struct	cmd_priv *pcmdpriv)
 		return -ENOMEM;
 	}
 
-	pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
+	pcmdpriv->rsp_buf = PTR_ALIGN(pcmdpriv->rsp_allocated_buf, 4);
 
 	pcmdpriv->cmd_issued_cnt = 0;
 	pcmdpriv->cmd_done_cnt = 0;
Signature · 1 line
2.54.0

Does not apply to the latest tree :(

#2 lore raw
Quoted 1 line · Greg KH

Does not apply to the latest tree :(

Sorry about that.

The code this patch modifies has been reworked in the staging-testing tree. Please disregard this patch.