public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre@kernel.org>
To: Michal Suchanek <msuchanek@suse.de>
Cc: Quentin Schulz <quentin.schulz@free-electrons.com>,
	Chen-Yu Tsai <wens@csie.org>, Lee Jones <lee.jones@linaro.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] power: supply: axp20x_usb_power: fix warning on 64bit
Date: Thu, 12 Jan 2017 03:55:35 +0100	[thread overview]
Message-ID: <20170112025535.nvw7ig53mvb6mcg2@earth> (raw)
In-Reply-To: <20170110174812.19026-1-msuchanek@suse.de>

[-- Attachment #1: Type: text/plain, Size: 2055 bytes --]

Hi Michal,

On Tue, Jan 10, 2017 at 06:48:12PM +0100, Michal Suchanek wrote:
> Casting of_device_get_match_data return value to int causes warning on 64bit
> architectures.
> 
> ../drivers/power/supply/axp20x_usb_power.c: In function
> 'axp20x_usb_power_probe':
> ../drivers/power/supply/axp20x_usb_power.c:297:21: warning: cast from
> pointer to integer of different size [-Wpointer-to-int-cast]
> 
> Fixes: 0dcc70ca8644 ("power: supply: axp20x_usb_power: use of_device_id
>     data field instead of device_is_compatible")
> Signed-off-by: Michal Suchanek <msuchanek@suse.de>
> ---
>  drivers/power/supply/axp20x_usb_power.c | 5 +++--
>  include/linux/mfd/axp20x.h              | 2 +-
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c
> index 1bcb02551e02..632a33fe2d54 100644
> --- a/drivers/power/supply/axp20x_usb_power.c
> +++ b/drivers/power/supply/axp20x_usb_power.c
> @@ -48,7 +48,7 @@ struct axp20x_usb_power {
>  	struct device_node *np;
>  	struct regmap *regmap;
>  	struct power_supply *supply;
> -	int axp20x_id;
> +	enum axp20x_variants axp20x_id;
>  };
>  
>  static irqreturn_t axp20x_usb_power_irq(int irq, void *devid)
> @@ -294,7 +294,8 @@ static int axp20x_usb_power_probe(struct platform_device *pdev)
>  	if (!power)
>  		return -ENOMEM;
>  
> -	power->axp20x_id = (int)of_device_get_match_data(&pdev->dev);
> +	power->axp20x_id = (enum axp20x_variants)of_device_get_match_data(
> +								&pdev->dev);
>  
>  	power->np = pdev->dev.of_node;
>  	power->regmap = axp20x->regmap;
> diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
> index 0aa4ef7157b8..0d9a1ff38393 100644
> --- a/include/linux/mfd/axp20x.h
> +++ b/include/linux/mfd/axp20x.h
> @@ -13,7 +13,7 @@
>  
>  #include <linux/regmap.h>
>  
> -enum {
> +enum axp20x_variants {
>  	AXP152_ID = 0,
>  	AXP202_ID,
>  	AXP209_ID,

Thanks, queued into power-supply's for-next branch.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2017-01-12  2:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10 17:48 [PATCH] power: supply: axp20x_usb_power: fix warning on 64bit Michal Suchanek
2017-01-12  2:55 ` Sebastian Reichel [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=20170112025535.nvw7ig53mvb6mcg2@earth \
    --to=sre@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=msuchanek@suse.de \
    --cc=quentin.schulz@free-electrons.com \
    --cc=wens@csie.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