Re: [PATCH] staging: rtl8723bs: use kzalloc_obj() instead of kzalloc()
From: Ethan Tidmore
Date: Mon Feb 16 2026 - 20:07:57 EST
On Mon Feb 16, 2026 at 10:17 AM CST, Mariyam Shahid wrote:
> Replace kzalloc() using sizeof(*ptr) with kzalloc_obj() to improve
> type safety. kzalloc_obj() ensures that the size allocated matches
> the type of the pointer automatically, which prevents potential
> mismatches if the pointer type is ever refactored.
>
> This change cleans up a checkpatch.pl warning:
> "Prefer kzalloc_obj over kzalloc with sizeof"
>
> Signed-off-by: Mariyam Shahid <mariyam.shahid135@xxxxxxxxx>
> ---
Hi,
The macro kzalloc_obj() is not in staging-next yet, so you'll likely get
a kernel test robot email. So, wait until this macro is in this branch
and then send this patch.
Thanks,
ET