[1/3] regulator: ltc3589: Fix Wvoid-pointer-to-enum-cast warning

Message ID 20230810111914.204847-1-krzysztof.kozlowski@linaro.org
State New
Headers
Series [1/3] regulator: ltc3589: Fix Wvoid-pointer-to-enum-cast warning |

Commit Message

Krzysztof Kozlowski Aug. 10, 2023, 11:19 a.m. UTC
  'variant' is an enum, thus cast of pointer on 64-bit compile test with
W=1 causes:

  ltc3589.c:394:22: error: cast to smaller integer type 'enum ltc3589_variant' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/regulator/ltc3589.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Mark Brown Aug. 10, 2023, 6:23 p.m. UTC | #1
On Thu, 10 Aug 2023 13:19:12 +0200, Krzysztof Kozlowski wrote:
> 'variant' is an enum, thus cast of pointer on 64-bit compile test with
> W=1 causes:
> 
>   ltc3589.c:394:22: error: cast to smaller integer type 'enum ltc3589_variant' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/3] regulator: ltc3589: Fix Wvoid-pointer-to-enum-cast warning
      commit: fddc9bb6e277b99b0410410794d156e963aa8f0b
[2/3] regulator: max77857: Fix Wvoid-pointer-to-enum-cast warning
      commit: b29f42c6629bb3bd3d479592d40a7e4c73461a01
[3/3] regulator: lp872x: Fix Wvoid-pointer-to-enum-cast warning
      commit: c418920567ae6101826cc05cda042f71435830d0

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
  

Patch

diff --git a/drivers/regulator/ltc3589.c b/drivers/regulator/ltc3589.c
index cf931b8c36dc..d892c2a5df7b 100644
--- a/drivers/regulator/ltc3589.c
+++ b/drivers/regulator/ltc3589.c
@@ -391,8 +391,7 @@  static int ltc3589_probe(struct i2c_client *client)
 
 	i2c_set_clientdata(client, ltc3589);
 	if (client->dev.of_node)
-		ltc3589->variant = (enum ltc3589_variant)
-			of_device_get_match_data(&client->dev);
+		ltc3589->variant = (uintptr_t)of_device_get_match_data(&client->dev);
 	else
 		ltc3589->variant = id->driver_data;
 	ltc3589->dev = dev;