summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2025-09-18 14:52:54 +0300
committerChristian König <christian.koenig@amd.com>2025-12-03 13:22:24 +0300
commit41f231179a45068fdde2c6c9aa70cbca2eb11b49 (patch)
tree6fd1465a7079e1b56b1525765d8d455b958c850e
parent3d3ac202c7df0923dee7e182c95d170cf9345a9f (diff)
downloadlinux-41f231179a45068fdde2c6c9aa70cbca2eb11b49.tar.xz
dma-buf: replace "#if" with just "if"
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
-rw-r--r--drivers/dma-buf/dma-buf.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index 2bcf9ceca997..2305bb2cc1f1 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -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: