]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hinic: Use the bitmap API when applicable
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 26 Jun 2022 16:27:45 +0000 (18:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:40:59 +0000 (14:40 +0200)
commit7d9325d7a849ab7cfd31ad2e049f1394ad6615dc
treebb1c229f1d22cf2f18c51b8b04ac22e91a9d4a4d
parent06a6559345b8ab2774cd60a2ea8bece22d0e33b6
hinic: Use the bitmap API when applicable

[ Upstream commit 7c2c57263af41cfd8b5022274e6801542831bb69 ]

'vlan_bitmap' is a bitmap and is used as such. So allocate it with
devm_bitmap_zalloc() and its explicit bit size (i.e. VLAN_N_VID).

This avoids the need of the VLAN_BITMAP_SIZE macro which:
   - needlessly has a 'nic_dev' parameter
   - should be "long" (and not byte) aligned, so that the bitmap semantic
     is respected

This is in fact not an issue because VLAN_N_VID is 4096 at the time
being, but devm_bitmap_zalloc() is less verbose and easier to understand.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/6ff7b7d21414240794a77dc2456914412718a145.1656260842.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/huawei/hinic/hinic_main.c