summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2026-07-13 10:30:22 +0200
committerMarek Szyprowski <m.szyprowski@samsung.com>2026-07-14 10:18:25 +0200
commit0188616c057d3eba8d8a4af62a59b5e7f2362571 (patch)
treefd300216f397b7ca1dcb3bcb038444313f53b431
parent1acce29926d93f3eba427696fe3da6451504dae2 (diff)
downloadlinux-next-0188616c057d3eba8d8a4af62a59b5e7f2362571.tar.gz
linux-next-0188616c057d3eba8d8a4af62a59b5e7f2362571.zip
dma-direct: Improve readability of the dma_direct_map_sg() for P2PDMA case
Improve readability of the sg_dma_len assignment in the P2PDMA cases by removing duplicated code, which was a direct result of the d0d08f4bd7f6 ("dma-direct: Fix missing sg_dma_len assignment in P2PDMA bus mappings") fix. No functional change. Suggested-by: Leon Romanovsky <leon@kernel.org> Link: https://lore.kernel.org/all/20260604071856.GA245424@unreal/ Reviewed-by: Pranjal Shrivastava <praan@google.com> Reviewed-by: Leon Romanovsky <leon@kernel.org> Reviewed-by: Logan Gunthorpe <logang@deltatee.com> Link: https://lore.kernel.org/r/20260713083022.1110993-1-m.szyprowski@samsung.com Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
-rw-r--r--kernel/dma/direct.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index 4391b797d4db..d8219efe3273 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@ -489,9 +489,8 @@ int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl, int nents,
case PCI_P2PDMA_MAP_BUS_ADDR:
sg->dma_address = pci_p2pdma_bus_addr_map(
p2pdma_state.mem, sg_phys(sg));
- sg_dma_len(sg) = sg->length;
sg_dma_mark_bus_address(sg);
- continue;
+ break;
default:
ret = -EREMOTEIO;
goto out_unmap;