public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Krzysztof Kozlowski' <krzysztof.kozlowski@linaro.org>,
	Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Eric Tremblay <etremblay@distech-controls.com>,
	"linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Andi Shyti <andi.shyti@kernel.org>
Subject: RE: [PATCH 04/15] hwmon: (ina2xx) fix Wvoid-pointer-to-enum-cast warning
Date: Mon, 14 Aug 2023 08:33:31 +0000	[thread overview]
Message-ID: <e13c70334dce4bfa9e5ea11126d4eb86@AcuMS.aculab.com> (raw)
In-Reply-To: <20230810093157.94244-4-krzysztof.kozlowski@linaro.org>

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)


  reply	other threads:[~2023-08-14  8:34 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 ` [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 [this message]
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=e13c70334dce4bfa9e5ea11126d4eb86@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=andi.shyti@kernel.org \
    --cc=etremblay@distech-controls.com \
    --cc=jdelvare@suse.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox