Merge tag 'dma-mapping-6.6-2023-08-29' of git://git.infradead.org/users/hch/dma-mapping
[platform/kernel/linux-rpi.git] / mm / slab_common.c
index 01cdbf1..cd71f95 100644 (file)
@@ -895,10 +895,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();
 }