Re: [PATCH v4] staging: rtl8723bs: remove redundant rsp_allocated_buf
From: Dan Carpenter
Date: Wed Jun 17 2026 - 10:37:47 EST
On Wed, Jun 17, 2026 at 06:08:53PM +0530, Devansh Soni wrote:
> The original code allocated extra memory and manually aligned the
> rsp_buf pointer to a 4-byte boundary, however kzalloc() guarantees a
> minimum of 8-byte alignment so this was unnecessary.
>
> Also, because the pointer was shifted, the original pointer had to be
> stored in rsp_allocated_buf just so it could be passed to kfree() later.
>
> Remove the redundant alignment math, remove the extra 4 bytes of padding
> from kzalloc() call, and assign memory directly to rsp_buf.
>
> This allows us to remove the rsp_allocated_buf variable from cmd_priv
> struct.
>
> Suggested-by: Dan Carpenter <error27@xxxxxxxxx>
> Signed-off-by: Devansh Soni <devanshsoni874@xxxxxxxxx>
> ---
> Changes in v4:
> - Dropped PTR_ALIGN() entirely as kzalloc() 8-byte alignment is sufficient.
> - Removed the +4 byte padding from kzalloc().
> - Completely removed the rsp_allocated_buf tracking variable and updated kfree().
Thanks!
Reviewed-by: Dan Carpenter <error27@xxxxxxxxx>
regards,
dan carpenter