]> git.baikalelectronics.ru Git - kernel.git/commitdiff
PCI: iproc: Use bitmap API to allocate bitmaps
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 4 Jul 2022 13:15:03 +0000 (15:15 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 5 Jul 2022 20:02:56 +0000 (15:02 -0500)
Use bitmap_zalloc()/bitmap_free() instead of hand-writing them.

It is less verbose and it improves the semantic.

Link: https://lore.kernel.org/r/d839a951358ceb447226dc776590a2a38f3e3f9d.1656940469.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Ray Jui <ray.jui@broadcom.com>
drivers/pci/controller/pcie-iproc-msi.c

index 757b7fbcdc5910deaa9b8c5ba465d7f52106f47d..fee036b07cd4f6ac53c501ce7efdcfa8604e3893 100644 (file)
@@ -589,8 +589,8 @@ int iproc_msi_init(struct iproc_pcie *pcie, struct device_node *node)
                msi->has_inten_reg = true;
 
        msi->nr_msi_vecs = msi->nr_irqs * EQ_LEN;
-       msi->bitmap = devm_kcalloc(pcie->dev, BITS_TO_LONGS(msi->nr_msi_vecs),
-                                  sizeof(*msi->bitmap), GFP_KERNEL);
+       msi->bitmap = devm_bitmap_zalloc(pcie->dev, msi->nr_msi_vecs,
+                                        GFP_KERNEL);
        if (!msi->bitmap)
                return -ENOMEM;