* [PATCH] dmaengine: axi-dmac: Add check for dma_set_max_seg_size
@ 2024-06-23 8:16 Ma Ke
2024-06-23 13:23 ` Markus Elfring
0 siblings, 1 reply; 2+ messages in thread
From: Ma Ke @ 2024-06-23 8:16 UTC (permalink / raw)
To: lars, vkoul; +Cc: dmaengine, linux-kernel, Ma Ke
To avoid possible failure of the dma_set_max_seg_size(), we should
better check the return value of the dma_set_max_seg_size().
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
---
drivers/dma/dma-axi-dmac.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c
index bdb752f11869..93543c2f1bd7 100644
--- a/drivers/dma/dma-axi-dmac.c
+++ b/drivers/dma/dma-axi-dmac.c
@@ -1051,7 +1051,9 @@ static int axi_dmac_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&dmac->chan.active_descs);
- dma_set_max_seg_size(&pdev->dev, UINT_MAX);
+ ret = dma_set_max_seg_size(&pdev->dev, UINT_MAX);
+ if (ret)
+ return ret;
dma_dev = &dmac->dma_dev;
dma_cap_set(DMA_SLAVE, dma_dev->cap_mask);
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] dmaengine: axi-dmac: Add check for dma_set_max_seg_size
2024-06-23 8:16 [PATCH] dmaengine: axi-dmac: Add check for dma_set_max_seg_size Ma Ke
@ 2024-06-23 13:23 ` Markus Elfring
0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2024-06-23 13:23 UTC (permalink / raw)
To: Ma Ke, dmaengine, Lars-Peter Clausen, Vinod Koul; +Cc: LKML
> To avoid possible failure of the dma_set_max_seg_size(),
Really?
It is desirable to detect a failed function call, isn't it?
> we should better check the return value of the dma_set_max_seg_size().
1. Please choose an imperative wording for an improved change description.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.10-rc4#n94
2. Would you like to add any tags (like “Fixes” and “Cc”) accordingly?
3. How do you think about to append the text “() in axi_dmac_probe()”
to the summary phrase?
Regards,
Markus
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-06-23 13:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-23 8:16 [PATCH] dmaengine: axi-dmac: Add check for dma_set_max_seg_size Ma Ke
2024-06-23 13:23 ` Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®