Commit c6635792 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Bjorn Helgaas

PCI: Allocate dma_alias_mask with bitmap_zalloc()

Switch to bitmap_zalloc() to show clearly what we are allocating.  Besides
that it returns pointer of bitmap type ("unsigned long *") instead of the
opaque "void *".
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 1ccce46c
...@@ -5690,8 +5690,7 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode, ...@@ -5690,8 +5690,7 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode,
void pci_add_dma_alias(struct pci_dev *dev, u8 devfn) void pci_add_dma_alias(struct pci_dev *dev, u8 devfn)
{ {
if (!dev->dma_alias_mask) if (!dev->dma_alias_mask)
dev->dma_alias_mask = kcalloc(BITS_TO_LONGS(U8_MAX), dev->dma_alias_mask = bitmap_zalloc(U8_MAX, GFP_KERNEL);
sizeof(long), GFP_KERNEL);
if (!dev->dma_alias_mask) { if (!dev->dma_alias_mask) {
pci_warn(dev, "Unable to allocate DMA alias mask\n"); pci_warn(dev, "Unable to allocate DMA alias mask\n");
return; return;
......
...@@ -2143,7 +2143,7 @@ static void pci_release_dev(struct device *dev) ...@@ -2143,7 +2143,7 @@ static void pci_release_dev(struct device *dev)
pcibios_release_device(pci_dev); pcibios_release_device(pci_dev);
pci_bus_put(pci_dev->bus); pci_bus_put(pci_dev->bus);
kfree(pci_dev->driver_override); kfree(pci_dev->driver_override);
kfree(pci_dev->dma_alias_mask); bitmap_free(pci_dev->dma_alias_mask);
kfree(pci_dev); kfree(pci_dev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment