All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] staging: rtl8723bs: replace and remove N_BYTE_ALIGMENT()
@ 2026-08-14  0:25 Leonardo Martins Martins
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Leonardo Martins Martins @ 2026-08-14  0:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Leonardo Martins Martins

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>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-14  0:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-14  0:25 [PATCH 0/2] staging: rtl8723bs: replace and remove N_BYTE_ALIGMENT() Leonardo Martins Martins
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

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.