From: Christophe JAILLET Date: Sat, 9 Jul 2022 14:24:45 +0000 (+0200) Subject: net: dsa: hellcreek: Use the bitmap API to allocate bitmaps X-Git-Tag: v6.1-rc5~731^2~156 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7bde1c581e41e396ab14275793f193ffbd5b2b1;p=platform%2Fkernel%2Flinux-starfive.git 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 Acked-by: Kurt Kanzenbach Link: https://lore.kernel.org/r/8306e2ae69a5d8553691f5d10a86a4390daf594b.1657376651.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c index ac1f3b3..01f9099 100644 --- a/drivers/net/dsa/hirschmann/hellcreek.c +++ b/drivers/net/dsa/hirschmann/hellcreek.c @@ -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;