Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: mmp: Fix again Wvoid-pointer-to-enum-cast warning

This was fixed and re-introduced. 'type' is an enum, thus cast of
pointer on 64-bit compile test with W=1 causes:

mmp_tdma.c:644:9: error: cast to smaller integer type 'enum mmp_tdma_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Fixes: a67ba97dfb30 ("dmaengine: Use device_get_match_data()")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250525-dma-fixes-v1-5-89d06dac9bcb@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Vinod Koul
a0b1589b 85a4ca29

+1 -1
+1 -1
drivers/dma/mmp_tdma.c
··· 641 641 int chan_num = TDMA_CHANNEL_NUM; 642 642 struct gen_pool *pool = NULL; 643 643 644 - type = (enum mmp_tdma_type)device_get_match_data(&pdev->dev); 644 + type = (kernel_ulong_t)device_get_match_data(&pdev->dev); 645 645 646 646 /* always have couple channels */ 647 647 tdev = devm_kzalloc(&pdev->dev, sizeof(*tdev), GFP_KERNEL);