From: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Mark Brown <broonie@kernel.org>, Lee Jones <lee.jones@linaro.org>,
Enric Balletbo i Serra <enric.balletbo@collabora.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regulator/mfd: fix pointer-to-int cast
Date: Wed, 3 Oct 2018 08:39:39 +0300 [thread overview]
Message-ID: <20181003053939.GE9389@localhost.localdomain> (raw)
In-Reply-To: <20181002210826.2588925-1-arnd@arndb.de>
Hello Arnd,
On Tue, Oct 02, 2018 at 11:07:32PM +0200, Arnd Bergmann wrote:
> gcc points out that a pointer is longer than an int on 64-bit
> architectures, and that casting between the two may be dangerous:
>
> drivers/mfd/rohm-bd718x7.c: In function 'bd718xx_i2c_probe':
> drivers/mfd/rohm-bd718x7.c:101:23: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
>
> In this driver it is correct, we just need the right kind of cast
> to avoid the warning.
>
> Fixes: 494edd266b94 ("regulator/mfd: Support ROHM BD71847 power management IC")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/mfd/rohm-bd718x7.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mfd/rohm-bd718x7.c b/drivers/mfd/rohm-bd718x7.c
> index 161c8aac6d86..e66d59190a82 100644
> --- a/drivers/mfd/rohm-bd718x7.c
> +++ b/drivers/mfd/rohm-bd718x7.c
> @@ -98,7 +98,7 @@ static int bd718xx_i2c_probe(struct i2c_client *i2c,
> return -ENOMEM;
>
> bd718xx->chip_irq = i2c->irq;
> - bd718xx->chip_type = (unsigned int)
> + bd718xx->chip_type = (uintptr_t)
> of_device_get_match_data(&i2c->dev);
> bd718xx->dev = &i2c->dev;
> dev_set_drvdata(&i2c->dev, bd718xx);
Big thanks for this activity =) I also got heads up mail from linux-next
so I also did a patch fixing this. I think Mark alrady applied that
patch to his tree.
(https://lore.kernel.org/lkml/20181002145901.899D41121A41@debutante.sirena.org.uk/)
Br,
Matti Vaittinen
prev parent reply other threads:[~2018-10-03 5:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-02 21:07 Arnd Bergmann
2018-10-03 5:39 ` Matti Vaittinen [this message]
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=20181003053939.GE9389@localhost.localdomain \
--to=matti.vaittinen@fi.rohmeurope.com \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=enric.balletbo@collabora.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®