diff mbox series

dmaengine: hsu: Add check for dma_set_max_seg_size in hsu_dma_probe()

Message ID 20240626082711.2826915-1-make24@iscas.ac.cn (mailing list archive)
State Rejected
Headers show
Series dmaengine: hsu: Add check for dma_set_max_seg_size in hsu_dma_probe() | expand

Commit Message

Ma Ke June 26, 2024, 8:27 a.m. UTC
As the possible failure of the dma_set_max_seg_size(), we should better
check the return value of the dma_set_max_seg_size().

Fixes: 17b3cf4233d7 ("dmaengine: hsu: set maximum allowed segment size for DMA")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
---
 drivers/dma/hsu/hsu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Markus Elfring June 26, 2024, 3:26 p.m. UTC | #1
> As the possible failure of the dma_set_max_seg_size(), we should better
> check the return value of the dma_set_max_seg_size().

Please avoid the repetition of a function name in such a change description.
Can it be improved with corresponding imperative wordings?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.10-rc5#n94

Regards,
Markus
Christoph Hellwig June 28, 2024, 5:51 a.m. UTC | #2
On Wed, Jun 26, 2024 at 04:27:11PM +0800, Ma Ke wrote:
> As the possible failure of the dma_set_max_seg_size(), we should better
> check the return value of the dma_set_max_seg_size().

As I've told you before: no.

We'll remove the return value from dma_set_max_seg_size.
diff mbox series

Patch

diff --git a/drivers/dma/hsu/hsu.c b/drivers/dma/hsu/hsu.c
index af5a2e252c25..9d02277fa923 100644
--- a/drivers/dma/hsu/hsu.c
+++ b/drivers/dma/hsu/hsu.c
@@ -479,7 +479,9 @@  int hsu_dma_probe(struct hsu_dma_chip *chip)
 
 	hsu->dma.dev = chip->dev;
 
-	dma_set_max_seg_size(hsu->dma.dev, HSU_CH_DxTSR_MASK);
+	ret = dma_set_max_seg_size(hsu->dma.dev, HSU_CH_DxTSR_MASK);
+	if (ret)
+		return ret;
 
 	ret = dma_async_device_register(&hsu->dma);
 	if (ret)