From: Dan Carpenter <error27@gmail.com>
To: Devansh Soni <devanshsoni874@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] staging: rtl8723bs: remove redundant rsp_allocated_buf
Date: Wed, 17 Jun 2026 16:21:34 +0300 [thread overview]
Message-ID: <ajKfXgdcYGVhT-0f@stanley.mountain> (raw)
In-Reply-To: <20260617123853.63022-1-devanshsoni874@gmail.com>
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@gmail.com>
> Signed-off-by: Devansh Soni <devanshsoni874@gmail.com>
> ---
> 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@gmail.com>
regards,
dan carpenter
prev parent reply other threads:[~2026-06-17 14:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-17 12:38 [PATCH v4] staging: rtl8723bs: remove redundant rsp_allocated_buf Devansh Soni
2026-06-17 13:21 ` Dan Carpenter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ajKfXgdcYGVhT-0f@stanley.mountain \
--to=error27@gmail.com \
--cc=devanshsoni874@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.