Skip to content

Commit 1fbda5f

Browse files
JustinStittvinodkoul
authored andcommitted
dmaengine: owl-dma: fix clang -Wvoid-pointer-to-enum-cast warning
When building with clang 18 I see the following warning: | drivers/dma/owl-dma.c:1119:14: warning: cast to smaller integer type | 'enum owl_dma_id' from 'const void *' [-Wvoid-pointer-to-enum-cast] | 1119 | od->devid = (enum owl_dma_id)of_device_get_match_data(&pdev->dev); This is due to the fact that `of_device_get_match_data()` returns a void* while `enum owl_dma_id` has the size of an int. Cast result of `of_device_get_match_data()` to a uintptr_t to silence the above warning for clang builds using W=1 Link: ClangBuiltLinux#1910 Reported-by: Nathan Chancellor <[email protected]> Signed-off-by: Justin Stitt <[email protected]> Acked-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 3c935af commit 1fbda5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/owl-dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ static int owl_dma_probe(struct platform_device *pdev)
11171117
dev_info(&pdev->dev, "dma-channels %d, dma-requests %d\n",
11181118
nr_channels, nr_requests);
11191119

1120-
od->devid = (enum owl_dma_id)of_device_get_match_data(&pdev->dev);
1120+
od->devid = (uintptr_t)of_device_get_match_data(&pdev->dev);
11211121

11221122
od->nr_pchans = nr_channels;
11231123
od->nr_vchans = nr_requests;

0 commit comments

Comments
 (0)