]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dmaengine: qcom: fix Wvoid-pointer-to-enum-cast warning
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 10 Aug 2023 09:59:59 +0000 (11:59 +0200)
committerVinod Koul <vkoul@kernel.org>
Wed, 4 Oct 2023 13:54:57 +0000 (19:24 +0530)
'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>
Link: https://lore.kernel.org/r/20230810100000.123515-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/qcom/hidma.c

index f4659553945b65e971bdf4336a975e470b2648da..d63b93dc7047643c00b5381df936715bc4c56369 100644 (file)
@@ -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;
 }