All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Sudip Mukherjee
	<sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Hartmut Knaack <knaack.h-Mmb7MZpHnFY@public.gmane.org>,
	Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>,
	Peter Meerwald <pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Markus Pargmann <mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Subject: Re: [PATCH] iio: adc: imx25-gcq: fix do_div
Date: Sat, 5 Mar 2016 18:43:11 +0000	[thread overview]
Message-ID: <56DB28BF.9070508@kernel.org> (raw)
In-Reply-To: <1457009513-7069-1-git-send-email-sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On 03/03/16 12:51, Sudip Mukherjee wrote:
> We are getting build failure with tilepro allmodconfig with the error:
> 
> drivers/iio/adc/fsl-imx25-gcq.c:236:4: note: in expansion of macro 'do_div'
> do_div(priv->channel_vref_mv[reg], 1000);
>     ^
> 
> include/asm-generic/div64.h:198:17: note: expected 'uint64_t *
> 	{aka long long unsigned int *}' but argument is of type 'u32 *
> 	{aka unsigned int *}'
> 
> Create a temporary variable of type u64 and use that in do_div.
> 
> Signed-off-by: Sudip Mukherjee <sudip.mukherjee-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
Markus, can you take a quick look at this. 

> ---
> 
> tilepro allmodconfig build log is at:
> https://travis-ci.org/sudipm-mukherjee/parport/jobs/113325889
> 
>  drivers/iio/adc/fsl-imx25-gcq.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c
> index 2fd1927..e0636d4 100644
> --- a/drivers/iio/adc/fsl-imx25-gcq.c
> +++ b/drivers/iio/adc/fsl-imx25-gcq.c
> @@ -174,6 +174,7 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev,
>  	struct device *dev = &pdev->dev;
>  	unsigned int refp_used[4] = {};
>  	int ret, i;
> +	u64 temp;
>  
>  	/*
>  	 * Setup all configurations registers with a default conversion
> @@ -233,7 +234,9 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev,
>  			priv->channel_vref_mv[reg] =
>  				regulator_get_voltage(priv->vref[refp]);
>  			/* Conversion from uV to mV */
> -			do_div(priv->channel_vref_mv[reg], 1000);
> +			temp = priv->channel_vref_mv[reg];
> +			do_div(temp, 1000);
> +			priv->channel_vref_mv[reg] = temp;
>  			break;
>  		case MX25_ADC_REFP_INT:
>  			priv->channel_vref_mv[reg] = 2500;
> 

WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23@kernel.org>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>
Cc: linux-kernel@vger.kernel.org, kernel-testers@vger.kernel.org,
	linux-iio@vger.kernel.org, Markus Pargmann <mpa@pengutronix.de>
Subject: Re: [PATCH] iio: adc: imx25-gcq: fix do_div
Date: Sat, 5 Mar 2016 18:43:11 +0000	[thread overview]
Message-ID: <56DB28BF.9070508@kernel.org> (raw)
In-Reply-To: <1457009513-7069-1-git-send-email-sudipm.mukherjee@gmail.com>

On 03/03/16 12:51, Sudip Mukherjee wrote:
> We are getting build failure with tilepro allmodconfig with the error:
> 
> drivers/iio/adc/fsl-imx25-gcq.c:236:4: note: in expansion of macro 'do_div'
> do_div(priv->channel_vref_mv[reg], 1000);
>     ^
> 
> include/asm-generic/div64.h:198:17: note: expected 'uint64_t *
> 	{aka long long unsigned int *}' but argument is of type 'u32 *
> 	{aka unsigned int *}'
> 
> Create a temporary variable of type u64 and use that in do_div.
> 
> Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Markus, can you take a quick look at this. 

> ---
> 
> tilepro allmodconfig build log is at:
> https://travis-ci.org/sudipm-mukherjee/parport/jobs/113325889
> 
>  drivers/iio/adc/fsl-imx25-gcq.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c
> index 2fd1927..e0636d4 100644
> --- a/drivers/iio/adc/fsl-imx25-gcq.c
> +++ b/drivers/iio/adc/fsl-imx25-gcq.c
> @@ -174,6 +174,7 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev,
>  	struct device *dev = &pdev->dev;
>  	unsigned int refp_used[4] = {};
>  	int ret, i;
> +	u64 temp;
>  
>  	/*
>  	 * Setup all configurations registers with a default conversion
> @@ -233,7 +234,9 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev,
>  			priv->channel_vref_mv[reg] =
>  				regulator_get_voltage(priv->vref[refp]);
>  			/* Conversion from uV to mV */
> -			do_div(priv->channel_vref_mv[reg], 1000);
> +			temp = priv->channel_vref_mv[reg];
> +			do_div(temp, 1000);
> +			priv->channel_vref_mv[reg] = temp;
>  			break;
>  		case MX25_ADC_REFP_INT:
>  			priv->channel_vref_mv[reg] = 2500;
> 


  parent reply	other threads:[~2016-03-05 18:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03 12:51 [PATCH] iio: adc: imx25-gcq: fix do_div Sudip Mukherjee
2016-03-03 12:51 ` Sudip Mukherjee
     [not found] ` <1457009513-7069-1-git-send-email-sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-03-05 18:43   ` Jonathan Cameron [this message]
2016-03-05 18:43     ` Jonathan Cameron
     [not found]     ` <56DB28BF.9070508-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-03-07  9:01       ` Markus Pargmann
2016-03-07  9:01         ` Markus Pargmann
2016-03-07 11:06         ` Sudip Mukherjee
2016-03-07 11:06           ` Sudip Mukherjee
2016-03-12 11:09           ` Jonathan Cameron
2016-03-12 11:09             ` Jonathan Cameron
2016-03-16  8:39             ` Lee Jones
2016-03-16  8:39               ` 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=56DB28BF.9070508@kernel.org \
    --to=jic23-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=knaack.h-Mmb7MZpHnFY@public.gmane.org \
    --cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
    --cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org \
    --cc=sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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 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.