All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Eric Tremblay <etremblay@distech-controls.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Andi Shyti <andi.shyti@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Subject: [PATCH 02/15] hwmon: (ad7418) fix Wvoid-pointer-to-enum-cast warning
Date: Thu, 10 Aug 2023 11:31:44 +0200	[thread overview]
Message-ID: <20230810093157.94244-2-krzysztof.kozlowski@linaro.org> (raw)
In-Reply-To: <20230810093157.94244-1-krzysztof.kozlowski@linaro.org>

'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


  reply	other threads:[~2023-08-10  9:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230810093157.94244-2-krzysztof.kozlowski@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=andi.shyti@kernel.org \
    --cc=etremblay@distech-controls.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.