swiotlb: make io_tlb_default_mem local to swiotlb.c
[linux-2.6-block.git] / mm / slab_common.c
index d1555ea2981ac51f63c11aab9b84ec906d3c6910..c639dba9a3b767f288a511607683dc04effb316c 100644 (file)
@@ -864,10 +864,9 @@ void __init setup_kmalloc_cache_index_table(void)
 
 static unsigned int __kmalloc_minalign(void)
 {
-#ifdef CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC
-       if (io_tlb_default_mem.nslabs)
+       if (IS_ENABLED(CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC) &&
+           is_swiotlb_allocated())
                return ARCH_KMALLOC_MINALIGN;
-#endif
        return dma_get_cache_alignment();
 }