- patches.apparmor/remove_suid_new_case_in_2.6.22.diff: Merge fix.
[linux-flexiantxendom0-3.2.10.git] / arch / i386 / kernel / pci-dma.c
index 3ebcea0..30b754f 100644 (file)
@@ -77,7 +77,7 @@ int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
 {
        void __iomem *mem_base = NULL;
        int pages = size >> PAGE_SHIFT;
-       int bitmap_size = (pages + 31)/32;
+       int bitmap_size = BITS_TO_LONGS(pages) * sizeof(long);
 
        if ((flags & (DMA_MEMORY_MAP | DMA_MEMORY_IO)) == 0)
                goto out;