Skip to content

Commit 81d3c9e

Browse files
andy-shevMarc Zyngier
authored andcommitted
irqchip/gic-v2m: Switch to bitmap_zalloc()
Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3f1808f commit 81d3c9e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/irqchip/irq-gic-v2m.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ static void gicv2m_teardown(void)
269269

270270
list_for_each_entry_safe(v2m, tmp, &v2m_nodes, entry) {
271271
list_del(&v2m->entry);
272-
kfree(v2m->bm);
272+
bitmap_free(v2m->bm);
273273
iounmap(v2m->base);
274274
of_node_put(to_of_node(v2m->fwnode));
275275
if (is_fwnode_irqchip(v2m->fwnode))
@@ -386,8 +386,7 @@ static int __init gicv2m_init_one(struct fwnode_handle *fwnode,
386386
break;
387387
}
388388
}
389-
v2m->bm = kcalloc(BITS_TO_LONGS(v2m->nr_spis), sizeof(long),
390-
GFP_KERNEL);
389+
v2m->bm = bitmap_zalloc(v2m->nr_spis, GFP_KERNEL);
391390
if (!v2m->bm) {
392391
ret = -ENOMEM;
393392
goto err_iounmap;

0 commit comments

Comments
 (0)