Re: [PATCH] staging: rtl8723bs: use kzalloc_obj() instead of kzalloc()

From: Mariyam Shahid

Date: Tue Feb 17 2026 - 04:13:22 EST


On Tue, Feb 17, 2026 at 6:07 AM Ethan Tidmore <ethantidmore06@xxxxxxxxx> wrote:
>
> 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

Hi,

Thank you for the heads-up. I will keep an eye on the branch and
resend this patch once kzalloc_obj() has been merged into
staging-next.

Best regards, Mariyam