summary refs log tree commit diff
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-08-30 13:32:36 +0300
committerBjorn Helgaas <bhelgaas@google.com>2018-09-17 16:35:14 -0500
commitc6635792737b881021ead417b281067d56ed3380 (patch)
tree5dbd6dfe1ca0050a7523a3374ab44a07d0ca2b8e /drivers/pci/pci.c
parent1ccce46c5e8b8a0d2606fb8bb72bff069ffdc3ab (diff)
downloadlinux-c6635792737b881021ead417b281067d56ed3380.tar.gz
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 1835f3a7aa8d..dc3313d26c79 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -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)
 {
 	if (!dev->dma_alias_mask)
-		dev->dma_alias_mask = kcalloc(BITS_TO_LONGS(U8_MAX),
-					      sizeof(long), GFP_KERNEL);
+		dev->dma_alias_mask = bitmap_zalloc(U8_MAX, GFP_KERNEL);
 	if (!dev->dma_alias_mask) {
 		pci_warn(dev, "Unable to allocate DMA alias mask\n");
 		return;