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

soc: ti: k3-ringacc: Use devm_bitmap_zalloc() when applicable

'rings_inuse' and 'proxy_inuse' are bitmaps. So use 'devm_bitmap_zalloc()'
to simplify code and improve the semantic.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/45544b0d97a7bea7764292852842adf5085a7700.1640276001.git.christophe.jaillet@wanadoo.fr

authored by

Christophe JAILLET and committed by
Nishanth Menon
a8eba8dd e783362e

+6 -9
+6 -9
drivers/soc/ti/k3-ringacc.c
··· 1402 1402 sizeof(*ringacc->rings) * 1403 1403 ringacc->num_rings, 1404 1404 GFP_KERNEL); 1405 - ringacc->rings_inuse = devm_kcalloc(dev, 1406 - BITS_TO_LONGS(ringacc->num_rings), 1407 - sizeof(unsigned long), GFP_KERNEL); 1408 - ringacc->proxy_inuse = devm_kcalloc(dev, 1409 - BITS_TO_LONGS(ringacc->num_proxies), 1410 - sizeof(unsigned long), GFP_KERNEL); 1405 + ringacc->rings_inuse = devm_bitmap_zalloc(dev, ringacc->num_rings, 1406 + GFP_KERNEL); 1407 + ringacc->proxy_inuse = devm_bitmap_zalloc(dev, ringacc->num_proxies, 1408 + GFP_KERNEL); 1411 1409 1412 1410 if (!ringacc->rings || !ringacc->rings_inuse || !ringacc->proxy_inuse) 1413 1411 return -ENOMEM; ··· 1481 1483 sizeof(*ringacc->rings) * 1482 1484 ringacc->num_rings * 2, 1483 1485 GFP_KERNEL); 1484 - ringacc->rings_inuse = devm_kcalloc(dev, 1485 - BITS_TO_LONGS(ringacc->num_rings), 1486 - sizeof(unsigned long), GFP_KERNEL); 1486 + ringacc->rings_inuse = devm_bitmap_zalloc(dev, ringacc->num_rings, 1487 + GFP_KERNEL); 1487 1488 1488 1489 if (!ringacc->rings || !ringacc->rings_inuse) 1489 1490 return ERR_PTR(-ENOMEM);