Skip to content

Commit

Permalink
net: dsa: hellcreek: Use the bitmap API to allocate bitmaps
Browse files Browse the repository at this point in the history
Use devm_bitmap_zalloc() instead of hand-writing them.

It is less verbose and it improves the semantic.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Kurt Kanzenbach <kurt@linutronix.de>
Link: https://lore.kernel.org/r/8306e2ae69a5d8553691f5d10a86a4390daf594b.1657376651.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Christophe JAILLET authored and Jakub Kicinski committed Jul 12, 2022
1 parent 1c151fe commit e7bde1c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/net/dsa/hirschmann/hellcreek.c
Original file line number Diff line number Diff line change
Expand Up @@ -1894,11 +1894,8 @@ static int hellcreek_probe(struct platform_device *pdev)
if (!port->counter_values)
return -ENOMEM;

port->vlan_dev_bitmap =
devm_kcalloc(dev,
BITS_TO_LONGS(VLAN_N_VID),
sizeof(unsigned long),
GFP_KERNEL);
port->vlan_dev_bitmap = devm_bitmap_zalloc(dev, VLAN_N_VID,
GFP_KERNEL);
if (!port->vlan_dev_bitmap)
return -ENOMEM;

Expand Down

0 comments on commit e7bde1c

Please sign in to comment.