Linux kernel staging patches
 help / color / mirror / Atom feed
From: Leonardo Martins Martins <dev.lmmrtns@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	 Leonardo Martins Martins <dev.lmmrtns@gmail.com>
Subject: [PATCH 0/2] staging: rtl8723bs: replace and remove N_BYTE_ALIGMENT()
Date: Thu, 13 Aug 2026 21:25:51 -0300	[thread overview]
Message-ID: <20260813-staging-testing-v1-0-8baa7c210474@gmail.com> (raw)

The macro N_BYTE_ALIGMENT() is used throughout the driver to perform
byte alignment on pointers with manual castings to unsigned long and
back to the pointer's type, making the code quite verbose.

This series replaces the macro N_BYTE_ALIGMENT() with the standard
PTR_ALIGN() macro.

Note: I've noticed that several of these alignments are called right
after kzalloc() or vzalloc() while aligning to 4, with kzalloc()
guaranteeing at least 8-byte alignment, this alignment is redundant.
I've left it as is since I don't have the hardware to test on and I
couldn't find out whether vzalloc() also guarantees byte alignment.
Please let me know if this change is desired.

Signed-off-by: Leonardo Martins Martins <dev.lmmrtns@gmail.com>
---
Leonardo Martins Martins (2):
      staging: rtl8723bs: replace N_BYTE_ALIGMENT() with PTR_ALIGN()
      staging: rtl8723bs: remove unused macro N_BYTE_ALIGMENT()

 drivers/staging/rtl8723bs/core/rtw_recv.c       |  3 ++-
 drivers/staging/rtl8723bs/core/rtw_xmit.c       | 13 +++++++------
 drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c  |  3 ++-
 drivers/staging/rtl8723bs/include/basic_types.h |  3 ---
 4 files changed, 11 insertions(+), 11 deletions(-)
---
base-commit: c6eb4dc5964fdf4086b73b7f0f5dc0d595fb5cf3
change-id: 20260813-staging-testing-b664ef41cd30

Best regards,
-- 
Leonardo Martins Martins <dev.lmmrtns@gmail.com>


             reply	other threads:[~2026-08-14  0:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14  0:25 Leonardo Martins Martins [this message]
2026-08-14  0:25 ` [PATCH 1/2] staging: rtl8723bs: replace N_BYTE_ALIGMENT() with PTR_ALIGN() Leonardo Martins Martins
2026-08-14  0:25 ` [PATCH 2/2] staging: rtl8723bs: remove unused macro N_BYTE_ALIGMENT() Leonardo Martins Martins

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=20260813-staging-testing-v1-0-8baa7c210474@gmail.com \
    --to=dev.lmmrtns@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox