Commit e7bde1c5 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Jakub Kicinski

net: dsa: hellcreek: Use the bitmap API to allocate bitmaps

Use devm_bitmap_zalloc() instead of hand-writing them.

It is less verbose and it improves the semantic.
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Kurt Kanzenbach's avatarKurt Kanzenbach <kurt@linutronix.de>
Link: https://lore.kernel.org/r/8306e2ae69a5d8553691f5d10a86a4390daf594b.1657376651.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1c151fed
......@@ -1894,10 +1894,7 @@ 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),
port->vlan_dev_bitmap = devm_bitmap_zalloc(dev, VLAN_N_VID,
GFP_KERNEL);
if (!port->vlan_dev_bitmap)
return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment