linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning
@ 2023-08-10  9:31 Krzysztof Kozlowski
  2023-08-10  9:31 ` [PATCH 02/15] hwmon: (ad7418) " Krzysztof Kozlowski
                   ` (14 more replies)
  0 siblings, 15 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10  9:31 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'chip' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  adt7475.c:1655:10: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

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

diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c
index 5363254644da..03acadc3a6cb 100644
--- a/drivers/hwmon/adt7475.c
+++ b/drivers/hwmon/adt7475.c
@@ -1652,7 +1652,7 @@ static int adt7475_probe(struct i2c_client *client)
 	i2c_set_clientdata(client, data);
 
 	if (client->dev.of_node)
-		chip = (enum chips)of_device_get_match_data(&client->dev);
+		chip = (uintptr_t)of_device_get_match_data(&client->dev);
 	else
 		chip = id->driver_data;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 02/15] hwmon: (ad7418) fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:31 [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
@ 2023-08-10  9:31 ` Krzysztof Kozlowski
  2023-08-10  9:31 ` [PATCH 03/15] hwmon: (ads7828) " Krzysztof Kozlowski
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10  9:31 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'type' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  ad7418.c:256:16: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

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

diff --git a/drivers/hwmon/ad7418.c b/drivers/hwmon/ad7418.c
index bcea66eac82b..4829f83ff52e 100644
--- a/drivers/hwmon/ad7418.c
+++ b/drivers/hwmon/ad7418.c
@@ -253,7 +253,7 @@ static int ad7418_probe(struct i2c_client *client)
 	mutex_init(&data->lock);
 	data->client = client;
 	if (dev->of_node)
-		data->type = (enum chips)of_device_get_match_data(dev);
+		data->type = (uintptr_t)of_device_get_match_data(dev);
 	else
 		data->type = i2c_match_id(ad7418_id, client)->driver_data;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 03/15] hwmon: (ads7828) fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:31 [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
  2023-08-10  9:31 ` [PATCH 02/15] hwmon: (ad7418) " Krzysztof Kozlowski
@ 2023-08-10  9:31 ` Krzysztof Kozlowski
  2023-08-10  9:31 ` [PATCH 04/15] hwmon: (ina2xx) " Krzysztof Kozlowski
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10  9:31 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'chip' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  ads7828.c:142:10: error: cast to smaller integer type 'enum ads7828_chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

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

diff --git a/drivers/hwmon/ads7828.c b/drivers/hwmon/ads7828.c
index e86894e35639..809e830f52a6 100644
--- a/drivers/hwmon/ads7828.c
+++ b/drivers/hwmon/ads7828.c
@@ -139,8 +139,7 @@ static int ads7828_probe(struct i2c_client *client)
 	}
 
 	if (client->dev.of_node)
-		chip = (enum ads7828_chips)
-			of_device_get_match_data(&client->dev);
+		chip = (uintptr_t)of_device_get_match_data(&client->dev);
 	else
 		chip = i2c_match_id(ads7828_device_ids, client)->driver_data;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 04/15] hwmon: (ina2xx) fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:31 [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
  2023-08-10  9:31 ` [PATCH 02/15] hwmon: (ad7418) " Krzysztof Kozlowski
  2023-08-10  9:31 ` [PATCH 03/15] hwmon: (ads7828) " Krzysztof Kozlowski
@ 2023-08-10  9:31 ` Krzysztof Kozlowski
  2023-08-14  8:33   ` David Laight
  2023-08-10  9:31 ` [PATCH 05/15] hwmon: (lm63) " Krzysztof Kozlowski
                   ` (11 subsequent siblings)
  14 siblings, 1 reply; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10  9:31 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'chip' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  ina2xx.c:627:10: error: cast to smaller integer type 'enum ina2xx_ids' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

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

diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c
index a47973e2d606..d8415d1f21fc 100644
--- a/drivers/hwmon/ina2xx.c
+++ b/drivers/hwmon/ina2xx.c
@@ -624,7 +624,7 @@ static int ina2xx_probe(struct i2c_client *client)
 	enum ina2xx_ids chip;
 
 	if (client->dev.of_node)
-		chip = (enum ina2xx_ids)of_device_get_match_data(&client->dev);
+		chip = (uintptr_t)of_device_get_match_data(&client->dev);
 	else
 		chip = i2c_match_id(ina2xx_id, client)->driver_data;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 05/15] hwmon: (lm63) fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:31 [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2023-08-10  9:31 ` [PATCH 04/15] hwmon: (ina2xx) " Krzysztof Kozlowski
@ 2023-08-10  9:31 ` Krzysztof Kozlowski
  2023-08-10  9:31 ` [PATCH 06/15] hwmon: (lm75) " Krzysztof Kozlowski
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10  9:31 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'kind' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  lm63.c:1108:16: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

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

diff --git a/drivers/hwmon/lm63.c b/drivers/hwmon/lm63.c
index 562c94c7d831..0878a044dd8e 100644
--- a/drivers/hwmon/lm63.c
+++ b/drivers/hwmon/lm63.c
@@ -1105,7 +1105,7 @@ static int lm63_probe(struct i2c_client *client)
 
 	/* Set the device type */
 	if (client->dev.of_node)
-		data->kind = (enum chips)of_device_get_match_data(&client->dev);
+		data->kind = (uintptr_t)of_device_get_match_data(&client->dev);
 	else
 		data->kind = i2c_match_id(lm63_id, client)->driver_data;
 	if (data->kind == lm64)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 06/15] hwmon: (lm75) fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:31 [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
                   ` (3 preceding siblings ...)
  2023-08-10  9:31 ` [PATCH 05/15] hwmon: (lm63) " Krzysztof Kozlowski
@ 2023-08-10  9:31 ` Krzysztof Kozlowski
  2023-08-10  9:31 ` [PATCH 07/15] hwmon: (lm85) " Krzysztof Kozlowski
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10  9:31 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'kind' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  lm75.c:581:10: error: cast to smaller integer type 'enum lm75_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

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

diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index bcfa8193e5e7..5b2ea05c951e 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -578,7 +578,7 @@ static int lm75_probe(struct i2c_client *client)
 	enum lm75_type kind;
 
 	if (client->dev.of_node)
-		kind = (enum lm75_type)of_device_get_match_data(&client->dev);
+		kind = (uintptr_t)of_device_get_match_data(&client->dev);
 	else
 		kind = i2c_match_id(lm75_ids, client)->driver_data;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 07/15] hwmon: (lm85) fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:31 [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
                   ` (4 preceding siblings ...)
  2023-08-10  9:31 ` [PATCH 06/15] hwmon: (lm75) " Krzysztof Kozlowski
@ 2023-08-10  9:31 ` Krzysztof Kozlowski
  2023-08-10  9:31 ` [PATCH 08/15] hwmon: (lm90) " Krzysztof Kozlowski
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10  9:31 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'type' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  lm85.c:1562:16: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

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

diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c
index 2a62ea7b25a9..68c210002357 100644
--- a/drivers/hwmon/lm85.c
+++ b/drivers/hwmon/lm85.c
@@ -1559,7 +1559,7 @@ static int lm85_probe(struct i2c_client *client)
 
 	data->client = client;
 	if (client->dev.of_node)
-		data->type = (enum chips)of_device_get_match_data(&client->dev);
+		data->type = (uintptr_t)of_device_get_match_data(&client->dev);
 	else
 		data->type = i2c_match_id(lm85_id, client)->driver_data;
 	mutex_init(&data->update_lock);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 08/15] hwmon: (lm90) fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:31 [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
                   ` (5 preceding siblings ...)
  2023-08-10  9:31 ` [PATCH 07/15] hwmon: (lm85) " Krzysztof Kozlowski
@ 2023-08-10  9:31 ` Krzysztof Kozlowski
  2023-08-10  9:31 ` [PATCH 09/15] hwmon: (max20730) " Krzysztof Kozlowski
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10  9:31 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'kind' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  lm90.c:2768:16: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

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

diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index b25ae8b7ec90..e0d7454a301c 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -2765,7 +2765,7 @@ static int lm90_probe(struct i2c_client *client)
 
 	/* Set the device type */
 	if (client->dev.of_node)
-		data->kind = (enum chips)of_device_get_match_data(&client->dev);
+		data->kind = (uintptr_t)of_device_get_match_data(&client->dev);
 	else
 		data->kind = i2c_match_id(lm90_id, client)->driver_data;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 09/15] hwmon: (max20730) fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:31 [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
                   ` (6 preceding siblings ...)
  2023-08-10  9:31 ` [PATCH 08/15] hwmon: (lm90) " Krzysztof Kozlowski
@ 2023-08-10  9:31 ` Krzysztof Kozlowski
  2023-08-10  9:31 ` [PATCH 10/15] hwmon: (max6697) " Krzysztof Kozlowski
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10  9:31 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'chip_id' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  max20730.c:719:13: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/hwmon/pmbus/max20730.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/pmbus/max20730.c b/drivers/hwmon/pmbus/max20730.c
index 6df4c5b75bdc..d56ec24764fd 100644
--- a/drivers/hwmon/pmbus/max20730.c
+++ b/drivers/hwmon/pmbus/max20730.c
@@ -716,7 +716,7 @@ static int max20730_probe(struct i2c_client *client)
 	}
 
 	if (client->dev.of_node)
-		chip_id = (enum chips)of_device_get_match_data(dev);
+		chip_id = (uintptr_t)of_device_get_match_data(dev);
 	else
 		chip_id = i2c_match_id(max20730_id, client)->driver_data;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 10/15] hwmon: (max6697) fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:31 [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
                   ` (7 preceding siblings ...)
  2023-08-10  9:31 ` [PATCH 09/15] hwmon: (max20730) " Krzysztof Kozlowski
@ 2023-08-10  9:31 ` Krzysztof Kozlowski
  2023-08-10  9:31 ` [PATCH 11/15] hwmon: (tmp513) " Krzysztof Kozlowski
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10  9:31 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'type' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  max6697.c:705:16: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

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

diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6697.c
index fe826fcf9990..7d10dd434f2e 100644
--- a/drivers/hwmon/max6697.c
+++ b/drivers/hwmon/max6697.c
@@ -702,7 +702,7 @@ static int max6697_probe(struct i2c_client *client)
 		return -ENOMEM;
 
 	if (client->dev.of_node)
-		data->type = (enum chips)of_device_get_match_data(&client->dev);
+		data->type = (uintptr_t)of_device_get_match_data(&client->dev);
 	else
 		data->type = i2c_match_id(max6697_id, client)->driver_data;
 	data->chip = &max6697_chip_data[data->type];
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 11/15] hwmon: (tmp513) fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:31 [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
                   ` (8 preceding siblings ...)
  2023-08-10  9:31 ` [PATCH 10/15] hwmon: (max6697) " Krzysztof Kozlowski
@ 2023-08-10  9:31 ` Krzysztof Kozlowski
  2023-08-10  9:31 ` [PATCH 12/15] hwmon: (pmbus/ibm-cffps) " Krzysztof Kozlowski
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10  9:31 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'id' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  tmp513.c:724:14: error: cast to smaller integer type 'enum tmp51x_ids' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

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

diff --git a/drivers/hwmon/tmp513.c b/drivers/hwmon/tmp513.c
index bff10f4b56e1..7db5d0fc24a4 100644
--- a/drivers/hwmon/tmp513.c
+++ b/drivers/hwmon/tmp513.c
@@ -721,7 +721,7 @@ static int tmp51x_probe(struct i2c_client *client)
 		return -ENOMEM;
 
 	if (client->dev.of_node)
-		data->id = (enum tmp51x_ids)device_get_match_data(&client->dev);
+		data->id = (uintptr_t)device_get_match_data(&client->dev);
 	else
 		data->id = i2c_match_id(tmp51x_id, client)->driver_data;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 12/15] hwmon: (pmbus/ibm-cffps) fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:31 [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
                   ` (9 preceding siblings ...)
  2023-08-10  9:31 ` [PATCH 11/15] hwmon: (tmp513) " Krzysztof Kozlowski
@ 2023-08-10  9:31 ` Krzysztof Kozlowski
  2023-08-10  9:31 ` [PATCH 13/15] hwmon: (pmbus/tps53679) " Krzysztof Kozlowski
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10  9:31 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'vs' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  ibm-cffps.c:492:8: error: cast to smaller integer type 'enum versions' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/hwmon/pmbus/ibm-cffps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/pmbus/ibm-cffps.c b/drivers/hwmon/pmbus/ibm-cffps.c
index 5b11aacda4d2..1ba4c5e95820 100644
--- a/drivers/hwmon/pmbus/ibm-cffps.c
+++ b/drivers/hwmon/pmbus/ibm-cffps.c
@@ -489,7 +489,7 @@ static int ibm_cffps_probe(struct i2c_client *client)
 	const struct i2c_device_id *id;
 
 	if (md) {
-		vs = (enum versions)md;
+		vs = (uintptr_t)md;
 	} else {
 		id = i2c_match_id(ibm_cffps_id, client);
 		if (id)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 13/15] hwmon: (pmbus/tps53679) fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:31 [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
                   ` (10 preceding siblings ...)
  2023-08-10  9:31 ` [PATCH 12/15] hwmon: (pmbus/ibm-cffps) " Krzysztof Kozlowski
@ 2023-08-10  9:31 ` Krzysztof Kozlowski
  2023-08-10  9:31 ` [PATCH 14/15] hwmon: (pmbus/ucd9000) " Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10  9:31 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'chip_id' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  tps53679.c:238:13: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/hwmon/pmbus/tps53679.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/pmbus/tps53679.c b/drivers/hwmon/pmbus/tps53679.c
index e77b12f342b4..5c9466244d70 100644
--- a/drivers/hwmon/pmbus/tps53679.c
+++ b/drivers/hwmon/pmbus/tps53679.c
@@ -235,7 +235,7 @@ static int tps53679_probe(struct i2c_client *client)
 	enum chips chip_id;
 
 	if (dev->of_node)
-		chip_id = (enum chips)of_device_get_match_data(dev);
+		chip_id = (uintptr_t)of_device_get_match_data(dev);
 	else
 		chip_id = i2c_match_id(tps53679_id, client)->driver_data;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 14/15] hwmon: (pmbus/ucd9000) fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:31 [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
                   ` (11 preceding siblings ...)
  2023-08-10  9:31 ` [PATCH 13/15] hwmon: (pmbus/tps53679) " Krzysztof Kozlowski
@ 2023-08-10  9:31 ` Krzysztof Kozlowski
  2023-08-10  9:31 ` [PATCH 15/15] hwmon: (pmbus/ucd9200) " Krzysztof Kozlowski
  2023-08-10 16:17 ` [PATCH 01/15] hwmon: (adt7475) " Guenter Roeck
  14 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10  9:31 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'chip' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  ucd9000.c:591:10: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/hwmon/pmbus/ucd9000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/pmbus/ucd9000.c b/drivers/hwmon/pmbus/ucd9000.c
index b1d1d4214e69..8d9d422450e5 100644
--- a/drivers/hwmon/pmbus/ucd9000.c
+++ b/drivers/hwmon/pmbus/ucd9000.c
@@ -588,7 +588,7 @@ static int ucd9000_probe(struct i2c_client *client)
 	}
 
 	if (client->dev.of_node)
-		chip = (enum chips)of_device_get_match_data(&client->dev);
+		chip = (uintptr_t)of_device_get_match_data(&client->dev);
 	else
 		chip = mid->driver_data;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 15/15] hwmon: (pmbus/ucd9200) fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:31 [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
                   ` (12 preceding siblings ...)
  2023-08-10  9:31 ` [PATCH 14/15] hwmon: (pmbus/ucd9000) " Krzysztof Kozlowski
@ 2023-08-10  9:31 ` Krzysztof Kozlowski
  2023-08-10 16:17 ` [PATCH 01/15] hwmon: (adt7475) " Guenter Roeck
  14 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10  9:31 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'chip' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  ucd9200.c:106:10: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/hwmon/pmbus/ucd9200.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/pmbus/ucd9200.c b/drivers/hwmon/pmbus/ucd9200.c
index e4aad64b2d94..7920d1c06df0 100644
--- a/drivers/hwmon/pmbus/ucd9200.c
+++ b/drivers/hwmon/pmbus/ucd9200.c
@@ -103,7 +103,7 @@ static int ucd9200_probe(struct i2c_client *client)
 	}
 
 	if (client->dev.of_node)
-		chip = (enum chips)of_device_get_match_data(&client->dev);
+		chip = (uintptr_t)of_device_get_match_data(&client->dev);
 	else
 		chip = mid->driver_data;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:31 [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
                   ` (13 preceding siblings ...)
  2023-08-10  9:31 ` [PATCH 15/15] hwmon: (pmbus/ucd9200) " Krzysztof Kozlowski
@ 2023-08-10 16:17 ` Guenter Roeck
  14 siblings, 0 replies; 18+ messages in thread
From: Guenter Roeck @ 2023-08-10 16:17 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Jean Delvare, Eric Tremblay, linux-hwmon, linux-kernel, Andi Shyti

On Thu, Aug 10, 2023 at 11:31:43AM +0200, Krzysztof Kozlowski wrote:
> 'chip' is an enum, thus cast of pointer on 64-bit compile test with W=1
> causes:
> 
>   adt7475.c:1655:10: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Series applied.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: [PATCH 04/15] hwmon: (ina2xx) fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:31 ` [PATCH 04/15] hwmon: (ina2xx) " Krzysztof Kozlowski
@ 2023-08-14  8:33   ` David Laight
  2023-08-14  9:54     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 18+ messages in thread
From: David Laight @ 2023-08-14  8:33 UTC (permalink / raw)
  To: 'Krzysztof Kozlowski',
	Jean Delvare, Guenter Roeck, Eric Tremblay, linux-hwmon,
	linux-kernel
  Cc: Andi Shyti

From: Krzysztof Kozlowski
> Sent: 10 August 2023 10:32
> 
> 'chip' is an enum, thus cast of pointer on 64-bit compile test with W=1
> causes:
> 
>   ina2xx.c:627:10: error: cast to smaller integer type 'enum ina2xx_ids' from 'const void *' [-
> Werror,-Wvoid-pointer-to-enum-cast]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/hwmon/ina2xx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c
> index a47973e2d606..d8415d1f21fc 100644
> --- a/drivers/hwmon/ina2xx.c
> +++ b/drivers/hwmon/ina2xx.c
> @@ -624,7 +624,7 @@ static int ina2xx_probe(struct i2c_client *client)
>  enum ina2xx_ids chip;
> 
>  if (client->dev.of_node)
> -chip = (enum ina2xx_ids)of_device_get_match_data(&client->dev);
> +chip = (uintptr_t)of_device_get_match_data(&client->dev);

The kernel type would be 'long' not uintptr_t.
But this all looks like something horrid is being done.

(And you've clearly lost all the tabs)

	David

>  else
>  chip = i2c_match_id(ina2xx_id, client)->driver_data;
> 
> --
> 2.34.1
> 

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 04/15] hwmon: (ina2xx) fix Wvoid-pointer-to-enum-cast warning
  2023-08-14  8:33   ` David Laight
@ 2023-08-14  9:54     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 18+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-14  9:54 UTC (permalink / raw)
  To: David Laight, Jean Delvare, Guenter Roeck, Eric Tremblay,
	linux-hwmon, linux-kernel
  Cc: Andi Shyti

On 14/08/2023 10:33, David Laight wrote:
> From: Krzysztof Kozlowski
>> Sent: 10 August 2023 10:32
>>
>> 'chip' is an enum, thus cast of pointer on 64-bit compile test with W=1
>> causes:
>>
>>   ina2xx.c:627:10: error: cast to smaller integer type 'enum ina2xx_ids' from 'const void *' [-
>> Werror,-Wvoid-pointer-to-enum-cast]
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> ---
>>  drivers/hwmon/ina2xx.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c
>> index a47973e2d606..d8415d1f21fc 100644
>> --- a/drivers/hwmon/ina2xx.c
>> +++ b/drivers/hwmon/ina2xx.c
>> @@ -624,7 +624,7 @@ static int ina2xx_probe(struct i2c_client *client)
>>  enum ina2xx_ids chip;
>>
>>  if (client->dev.of_node)
>> -chip = (enum ina2xx_ids)of_device_get_match_data(&client->dev);
>> +chip = (uintptr_t)of_device_get_match_data(&client->dev);
> 
> The kernel type would be 'long' not uintptr_t.

Yeah, Greg also pointed out. It was applied, so no sure if it is worth
to change to kernel_ulong_t.

> But this all looks like something horrid is being done.

Why exactly? This is pretty often pattern, code is correct and easy to
understand.

> 
> (And you've clearly lost all the tabs)

It's your email client who lost them:
https://lore.kernel.org/all/20230810093157.94244-4-krzysztof.kozlowski@linaro.org/

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-08-14  9:55 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-10  9:31 [PATCH 01/15] hwmon: (adt7475) fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
2023-08-10  9:31 ` [PATCH 02/15] hwmon: (ad7418) " Krzysztof Kozlowski
2023-08-10  9:31 ` [PATCH 03/15] hwmon: (ads7828) " Krzysztof Kozlowski
2023-08-10  9:31 ` [PATCH 04/15] hwmon: (ina2xx) " Krzysztof Kozlowski
2023-08-14  8:33   ` David Laight
2023-08-14  9:54     ` Krzysztof Kozlowski
2023-08-10  9:31 ` [PATCH 05/15] hwmon: (lm63) " Krzysztof Kozlowski
2023-08-10  9:31 ` [PATCH 06/15] hwmon: (lm75) " Krzysztof Kozlowski
2023-08-10  9:31 ` [PATCH 07/15] hwmon: (lm85) " Krzysztof Kozlowski
2023-08-10  9:31 ` [PATCH 08/15] hwmon: (lm90) " Krzysztof Kozlowski
2023-08-10  9:31 ` [PATCH 09/15] hwmon: (max20730) " Krzysztof Kozlowski
2023-08-10  9:31 ` [PATCH 10/15] hwmon: (max6697) " Krzysztof Kozlowski
2023-08-10  9:31 ` [PATCH 11/15] hwmon: (tmp513) " Krzysztof Kozlowski
2023-08-10  9:31 ` [PATCH 12/15] hwmon: (pmbus/ibm-cffps) " Krzysztof Kozlowski
2023-08-10  9:31 ` [PATCH 13/15] hwmon: (pmbus/tps53679) " Krzysztof Kozlowski
2023-08-10  9:31 ` [PATCH 14/15] hwmon: (pmbus/ucd9000) " Krzysztof Kozlowski
2023-08-10  9:31 ` [PATCH 15/15] hwmon: (pmbus/ucd9200) " Krzysztof Kozlowski
2023-08-10 16:17 ` [PATCH 01/15] hwmon: (adt7475) " Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).