linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Richard Purdie <rpurdie@rpsys.net>,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	Pavel Machek <pavel@ucw.cz>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Linux-Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: [PATCH v2] leds: pm8058: Silence pointer to integer size warning
Date: Fri, 1 Dec 2017 07:57:15 +0000	[thread overview]
Message-ID: <20171201075715.2bkjpjfqbitz2bem@dell> (raw)
In-Reply-To: <20171201051656.31694-1-bjorn.andersson@linaro.org>

On Thu, 30 Nov 2017, Bjorn Andersson wrote:

> The pointer returned by of_device_get_match_data() doesn't have the same
> size as u32 on 64-bit architectures, causing a compile warning when
> compile-testing the driver on such platform.
> 
> Cast the return value of of_device_get_match_data() to unsigned long and
> then to u32 to silence this warning.
> 
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Fixes: 7f866986e705 ("leds: add PM8058 LEDs driver")
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>  drivers/leds/leds-pm8058.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/leds/leds-pm8058.c b/drivers/leds/leds-pm8058.c
> index a52674327857..8988ba3b2d65 100644
> --- a/drivers/leds/leds-pm8058.c
> +++ b/drivers/leds/leds-pm8058.c
> @@ -106,7 +106,7 @@ static int pm8058_led_probe(struct platform_device *pdev)
>  	if (!led)
>  		return -ENOMEM;
>  
> -	led->ledtype = (u32)of_device_get_match_data(&pdev->dev);
> +	led->ledtype = (u32)(unsigned long)of_device_get_match_data(&pdev->dev);

Wouldn't (u32)(void *) be even more correct?

... if the compiler will let you get away with it.

>  	map = dev_get_regmap(pdev->dev.parent, NULL);
>  	if (!map) {

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2017-12-01  7:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-30  0:35 linux-next: build warning after merge of the mfd tree Stephen Rothwell
2017-11-30  3:05 ` [PATCH] leds: pm8058: Make ledtype pointer sized type Bjorn Andersson
2017-11-30  8:29   ` Lee Jones
2017-11-30  8:31     ` Lee Jones
2017-11-30 22:02       ` Jacek Anaszewski
2017-12-01  7:56         ` Lee Jones
2017-12-01 20:35           ` Jacek Anaszewski
2017-11-30  9:18   ` Linus Walleij
2017-11-30  9:41     ` Lee Jones
2017-11-30  9:40   ` Pavel Machek
2017-11-30 21:58     ` Jacek Anaszewski
2017-11-30 22:34       ` Pavel Machek
2017-11-30 23:14         ` Stephen Rothwell
2017-12-01  0:28           ` Pavel Machek
2017-12-01  5:10             ` Bjorn Andersson
2017-11-30 22:18     ` Bjorn Andersson
2017-11-30  8:28 ` linux-next: build warning after merge of the mfd tree Lee Jones
2017-12-01  5:16 ` [PATCH v2] leds: pm8058: Silence pointer to integer size warning Bjorn Andersson
2017-12-01  7:57   ` Lee Jones [this message]
2017-12-01  8:36     ` Pavel Machek
2017-12-01  8:56       ` Lee Jones
2017-12-01  8:56   ` Lee Jones
2017-12-01  9:01   ` [GIT PULL] Immutable branch between MFD and LED due for the v4.16 merge window Lee Jones

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=20171201075715.2bkjpjfqbitz2bem@dell \
    --to=lee.jones@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rpurdie@rpsys.net \
    --cc=sfr@canb.auug.org.au \
    /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;
as well as URLs for NNTP newsgroup(s).