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

From: Brett Creeley
Date: Thu Jan 25 2024 - 10:56:40 EST




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.



This is pretty much bitmap_zalloc(), except with devm. As Simon is asking, is
devm really necessary?
Will use kcalloc.