Commit 00a2b7c7 authored by Marc Zyngier's avatar Marc Zyngier
Browse files

Merge branch irq/bitmap_zalloc into irq/irqchip-next



irqchip-wide replacement of bitmap allocation using kcalloc()
and co with bitmap-specific allocators (Andy Shevchenko)

* irq/bitmap_zalloc:
  irqchip/mvebu-odmi: Switch to bitmap_zalloc()
  irqchip/mvebu-gicp: Switch to devm_bitmap_zalloc()
  irqchip/ls-scfg-msi: Switch to devm_bitmap_zalloc()
  irqchip/gic-v3: Switch to bitmap_zalloc()
  irqchip/gic-v2m: Switch to bitmap_zalloc()
  irqchip/alpine-msi: Switch to bitmap_zalloc()
  irqchip/partitions: Switch to bitmap_zalloc()

Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
parents ff117646 c980983d
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -267,9 +267,7 @@ static int alpine_msix_init(struct device_node *node,
		goto err_priv;
	}

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

err_map:
	kfree(priv->msi_map);
	bitmap_free(priv->msi_map);
err_priv:
	kfree(priv);
	return ret;
+2 −3
Original line number Diff line number Diff line
@@ -269,7 +269,7 @@ static void gicv2m_teardown(void)

	list_for_each_entry_safe(v2m, tmp, &v2m_nodes, entry) {
		list_del(&v2m->entry);
		kfree(v2m->bm);
		bitmap_free(v2m->bm);
		iounmap(v2m->base);
		of_node_put(to_of_node(v2m->fwnode));
		if (is_fwnode_irqchip(v2m->fwnode))
@@ -386,8 +386,7 @@ static int __init gicv2m_init_one(struct fwnode_handle *fwnode,
			break;
		}
	}
	v2m->bm = kcalloc(BITS_TO_LONGS(v2m->nr_spis), sizeof(long),
			  GFP_KERNEL);
	v2m->bm = bitmap_zalloc(v2m->nr_spis, GFP_KERNEL);
	if (!v2m->bm) {
		ret = -ENOMEM;
		goto err_iounmap;
+3 −3
Original line number Diff line number Diff line
@@ -2140,7 +2140,7 @@ static unsigned long *its_lpi_alloc(int nr_irqs, u32 *base, int *nr_ids)
	if (err)
		goto out;

	bitmap = kcalloc(BITS_TO_LONGS(nr_irqs), sizeof (long), GFP_ATOMIC);
	bitmap = bitmap_zalloc(nr_irqs, GFP_ATOMIC);
	if (!bitmap)
		goto out;

@@ -2156,7 +2156,7 @@ static unsigned long *its_lpi_alloc(int nr_irqs, u32 *base, int *nr_ids)
static void its_lpi_free(unsigned long *bitmap, u32 base, u32 nr_ids)
{
	WARN_ON(free_lpi_range(base, nr_ids));
	kfree(bitmap);
	bitmap_free(bitmap);
}

static void gic_reset_prop_table(void *va)
@@ -3387,7 +3387,7 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id,
	if (!dev || !itt ||  !col_map || (!lpi_map && alloc_lpis)) {
		kfree(dev);
		kfree(itt);
		kfree(lpi_map);
		bitmap_free(lpi_map);
		kfree(col_map);
		return NULL;
	}
+2 −3
Original line number Diff line number Diff line
@@ -290,8 +290,7 @@ int __init mbi_init(struct fwnode_handle *fwnode, struct irq_domain *parent)
		if (ret)
			goto err_free_mbi;

		mbi_ranges[n].bm = kcalloc(BITS_TO_LONGS(mbi_ranges[n].nr_spis),
					   sizeof(long), GFP_KERNEL);
		mbi_ranges[n].bm = bitmap_zalloc(mbi_ranges[n].nr_spis, GFP_KERNEL);
		if (!mbi_ranges[n].bm) {
			ret = -ENOMEM;
			goto err_free_mbi;
@@ -329,7 +328,7 @@ int __init mbi_init(struct fwnode_handle *fwnode, struct irq_domain *parent)
err_free_mbi:
	if (mbi_ranges) {
		for (n = 0; n < mbi_range_nr; n++)
			kfree(mbi_ranges[n].bm);
			bitmap_free(mbi_ranges[n].bm);
		kfree(mbi_ranges);
	}

+1 −4
Original line number Diff line number Diff line
@@ -362,10 +362,7 @@ static int ls_scfg_msi_probe(struct platform_device *pdev)

	msi_data->irqs_num = MSI_IRQS_PER_MSIR *
			     (1 << msi_data->cfg->ibs_shift);
	msi_data->used = devm_kcalloc(&pdev->dev,
				    BITS_TO_LONGS(msi_data->irqs_num),
				    sizeof(*msi_data->used),
				    GFP_KERNEL);
	msi_data->used = devm_bitmap_zalloc(&pdev->dev, msi_data->irqs_num, GFP_KERNEL);
	if (!msi_data->used)
		return -ENOMEM;
	/*
Loading