Re: [EXT] Re: [PATCH net] octeontx2-af: Initialize bitmap arrays.

From: Simon Horman
Date: Fri Jan 26 2024 - 16:01:58 EST


On Thu, Jan 25, 2024 at 07:56:22AM -0800, Brett Creeley wrote:
>
>
> On 1/24/2024 9:06 PM, Ratheesh Kannoth wrote:
> > Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> >
> >
> > > From: Brett Creeley <bcreeley@xxxxxxx>
> > > Subject: [EXT] Re: [PATCH net] octeontx2-af: Initialize bitmap arrays.
> > > Is there any reason to not use:
> > >
> > > bitmap_zalloc() and bitmap_free()?
> > Will follow simon's suggestion to keep patch diff minimal. As bitmap_zalloc() does not give any advantage over the other.
>
> It does make some sense because in multiple places you are open coding
> bitmap_zalloc()->bitmap_alloc() in multiple places.
>
> For example:
>
> mcam->bmap = kmalloc_array(BITS_TO_LONGS(mcam->bmap_entries),
> + sizeof(long), GFP_KERNEL | __GFP_ZERO);
>
> This is exactly what bitmap_zalloc()->bitmap_alloc() are doing.

Yes, I agree and I should have suggested using
bitmap_zalloc() and bitmap_free().