linux/drivers/dma/stm32
Clément Le Goffic 874558ec34 dmaengine: stm32-mdma: initialize m2m_hw_period and ccr to fix warnings
[ Upstream commit aaf3bc0265 ]

m2m_hw_period is initialized only when chan_config->m2m_hw is true. This
triggers a warning:
‘m2m_hw_period’ may be used uninitialized [-Wmaybe-uninitialized]
Although m2m_hw_period is only used when chan_config->m2m_hw is true and
ignored otherwise, initialize it unconditionally to 0.

ccr is initialized by stm32_mdma_set_xfer_param() when the sg list is not
empty. This triggers a warning:
‘ccr’ may be used uninitialized [-Wmaybe-uninitialized]
Indeed, it could be used uninitialized if the sg list is empty. Initialize
it to 0.

Signed-off-by: Clément Le Goffic <clement.legoffic@foss.st.com>
Reviewed-by: Clément Le Goffic <legoffic.clement@gmail.com>
Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://patch.msgid.link/20251217-mdma_warnings_fix-v2-1-340200e0bb55@foss.st.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-03-04 07:21:23 -05:00
..
Kconfig dmaengine: Add STM32 DMA3 support 2024-06-11 23:55:34 +05:30
Makefile dmaengine: Add STM32 DMA3 support 2024-06-11 23:55:34 +05:30
stm32-dma.c dmaengine: stm32-dma: configure next sg only if there are more than 2 sgs 2025-08-20 18:30:43 +02:00
stm32-dma3.c dmaengine: stm32-dma3: use module_platform_driver 2026-03-04 07:21:22 -05:00
stm32-dmamux.c dmaengine: stm32: dmamux: fix OF node leak on route allocation failure 2026-01-23 11:18:49 +01:00
stm32-mdma.c dmaengine: stm32-mdma: initialize m2m_hw_period and ccr to fix warnings 2026-03-04 07:21:23 -05:00