Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 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>

authored by

Christophe JAILLET and committed by
Jakub Kicinski
e7bde1c5 1c151fed

+2 -5
+2 -5
drivers/net/dsa/hirschmann/hellcreek.c
··· 1894 1894 if (!port->counter_values) 1895 1895 return -ENOMEM; 1896 1896 1897 - port->vlan_dev_bitmap = 1898 - devm_kcalloc(dev, 1899 - BITS_TO_LONGS(VLAN_N_VID), 1900 - sizeof(unsigned long), 1901 - GFP_KERNEL); 1897 + port->vlan_dev_bitmap = devm_bitmap_zalloc(dev, VLAN_N_VID, 1898 + GFP_KERNEL); 1902 1899 if (!port->vlan_dev_bitmap) 1903 1900 return -ENOMEM; 1904 1901