Skip to content

Commit 3f1808f

Browse files
andy-shevMarc Zyngier
authored andcommitted
irqchip/alpine-msi: 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 4cad4da commit 3f1808f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/irqchip/irq-alpine-msi.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,7 @@ static int alpine_msix_init(struct device_node *node,
267267
goto err_priv;
268268
}
269269

270-
priv->msi_map = kcalloc(BITS_TO_LONGS(priv->num_spis),
271-
sizeof(*priv->msi_map),
272-
GFP_KERNEL);
270+
priv->msi_map = bitmap_zalloc(priv->num_spis, GFP_KERNEL);
273271
if (!priv->msi_map) {
274272
ret = -ENOMEM;
275273
goto err_priv;
@@ -285,7 +283,7 @@ static int alpine_msix_init(struct device_node *node,
285283
return 0;
286284

287285
err_map:
288-
kfree(priv->msi_map);
286+
bitmap_free(priv->msi_map);
289287
err_priv:
290288
kfree(priv);
291289
return ret;

0 commit comments

Comments
 (0)