]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: codecs: tas2764: Fix Wvoid-pointer-to-enum-cast warning
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sun, 27 Apr 2025 10:51:07 +0000 (12:51 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 1 May 2025 20:38:52 +0000 (05:38 +0900)
'devid' is an enum, thus cast of pointer on 64-bit compile test with
clang and W=1 causes:

  tas2764.c:879:19: error: cast to smaller integer type 'enum tas2764_devid' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

One of the discussions in 2023 on LKML suggested warning is not suitable
for kernel.  Nothing changed in this regard for more than a year, so
assume the warning will stay and we want to have warnings-free builds.

Link: https://lore.kernel.org/all/20230814160457.GA2836@dev-arch.thelio-3990X/
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250427105105.18164-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tas2764.c

index 97968ee3af42e8400b8cbcc23fe2184afc8c715c..36e25e48b35463b11d0ac64341785027d88e4f34 100644 (file)
@@ -876,7 +876,7 @@ static int tas2764_i2c_probe(struct i2c_client *client)
        if (!tas2764)
                return -ENOMEM;
 
-       tas2764->devid = (enum tas2764_devid)of_device_get_match_data(&client->dev);
+       tas2764->devid = (kernel_ulong_t)of_device_get_match_data(&client->dev);
 
        tas2764->dev = &client->dev;
        tas2764->irq = client->irq;