]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dma-buf: replace "#if" with just "if"
authorChristian König <christian.koenig@amd.com>
Thu, 18 Sep 2025 11:52:54 +0000 (13:52 +0200)
committerChristian König <christian.koenig@amd.com>
Wed, 3 Dec 2025 10:22:24 +0000 (11:22 +0100)
No need to conditional compile that code, let the compilers dead code
elimination handle it instead.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Link: https://lore.kernel.org/r/20251006134713.1846-1-christian.koenig@amd.com
drivers/dma-buf/dma-buf.c

index 2bcf9ceca99758fa0ee89a4d281b49925676899e..2305bb2cc1f167126d9285b4bee931b6c81a76e6 100644 (file)
@@ -1141,8 +1141,7 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,
        }
        mangle_sg_table(sg_table);
 
-#ifdef CONFIG_DMA_API_DEBUG
-       {
+       if (IS_ENABLED(CONFIG_DMA_API_DEBUG)) {
                struct scatterlist *sg;
                u64 addr;
                int len;
@@ -1154,10 +1153,10 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,
                        if (!PAGE_ALIGNED(addr) || !PAGE_ALIGNED(len)) {
                                pr_debug("%s: addr %llx or len %x is not page aligned!\n",
                                         __func__, addr, len);
+                               break;
                        }
                }
        }
-#endif /* CONFIG_DMA_API_DEBUG */
        return sg_table;
 
 error_unmap: