Message ID | 20230810100000.123515-1-krzysztof.kozlowski@linaro.org (mailing list archive) |
---|---|
State | Accepted |
Commit | 9a2136b60cc1a5ba9c5878f08a41f41271c4cd17 |
Headers | show |
Series | [1/2] dmaengine: qcom: fix Wvoid-pointer-to-enum-cast warning | expand |
On Thu, 10 Aug 2023 11:59:59 +0200, Krzysztof Kozlowski wrote: > 'cap' is an enum, thus cast of pointer on 64-bit compile test with W=1 > causes: > > hidma.c:748:8: error: cast to smaller integer type 'enum hidma_cap' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] > > Applied, thanks! [1/2] dmaengine: qcom: fix Wvoid-pointer-to-enum-cast warning commit: 9a2136b60cc1a5ba9c5878f08a41f41271c4cd17 [2/2] dmaengine: mmp: fix Wvoid-pointer-to-enum-cast warning commit: 094f9ee5fb547c31486801a017a07d7f1c1e7881 Best regards,
diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c index b5e3633e6a5e..499df3c83976 100644 --- a/drivers/dma/qcom/hidma.c +++ b/drivers/dma/qcom/hidma.c @@ -745,7 +745,7 @@ static bool hidma_test_capability(struct device *dev, enum hidma_cap test_cap) { enum hidma_cap cap; - cap = (enum hidma_cap) device_get_match_data(dev); + cap = (uintptr_t) device_get_match_data(dev); return cap ? ((cap & test_cap) > 0) : 0; }
'cap' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: hidma.c:748:8: error: cast to smaller integer type 'enum hidma_cap' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> --- drivers/dma/qcom/hidma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)