linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: adc/imx25-gcq: move incorrect do_div
@ 2016-02-12 11:15 Arnd Bergmann
  2016-02-13 13:45 ` Jonathan Cameron
  2016-02-15  9:59 ` Markus Pargmann
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2016-02-12 11:15 UTC (permalink / raw)
  To: Lee Jones, Jonathan Cameron
  Cc: linux-arm-kernel, Arnd Bergmann, Denis Carikli, Markus Pargmann,
	Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald, linux-iio,
	linux-kernel

The newly added driver uses do_div() to device a 32-bit number, which now
provokes a warning:

drivers/iio/adc/fsl-imx25-gcq.c: In function 'mx25_gcq_setup_cfgs':
include/asm-generic/div64.h:207:28: warning: comparison of distinct pointer types lacks a cast
  (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \

This replaces the do_div() call with a straight division operator.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 6df2e98c3ea5 ("iio: adc: Add imx25-gcq ADC driver")
---
 drivers/iio/adc/fsl-imx25-gcq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c
index 2fd192735d5b..72b32c1ab257 100644
--- a/drivers/iio/adc/fsl-imx25-gcq.c
+++ b/drivers/iio/adc/fsl-imx25-gcq.c
@@ -233,7 +233,7 @@ 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);
+			priv->channel_vref_mv[reg] /= 1000;
 			break;
 		case MX25_ADC_REFP_INT:
 			priv->channel_vref_mv[reg] = 2500;
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] iio: adc/imx25-gcq: move incorrect do_div
  2016-02-12 11:15 [PATCH] iio: adc/imx25-gcq: move incorrect do_div Arnd Bergmann
@ 2016-02-13 13:45 ` Jonathan Cameron
  2016-02-15  9:59 ` Markus Pargmann
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2016-02-13 13:45 UTC (permalink / raw)
  To: Arnd Bergmann, Lee Jones
  Cc: linux-arm-kernel, Denis Carikli, Markus Pargmann, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald, linux-iio, linux-kernel

On 12/02/16 11:15, Arnd Bergmann wrote:
> The newly added driver uses do_div() to device a 32-bit number, which now
> provokes a warning:
> 
> drivers/iio/adc/fsl-imx25-gcq.c: In function 'mx25_gcq_setup_cfgs':
> include/asm-generic/div64.h:207:28: warning: comparison of distinct pointer types lacks a cast
>   (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
> 
> This replaces the do_div() call with a straight division operator.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 6df2e98c3ea5 ("iio: adc: Add imx25-gcq ADC driver")
Acked-by: Jonathan Cameron <jic23@kernel.org>

oops.
> ---
>  drivers/iio/adc/fsl-imx25-gcq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c
> index 2fd192735d5b..72b32c1ab257 100644
> --- a/drivers/iio/adc/fsl-imx25-gcq.c
> +++ b/drivers/iio/adc/fsl-imx25-gcq.c
> @@ -233,7 +233,7 @@ 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);
> +			priv->channel_vref_mv[reg] /= 1000;
>  			break;
>  		case MX25_ADC_REFP_INT:
>  			priv->channel_vref_mv[reg] = 2500;
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iio: adc/imx25-gcq: move incorrect do_div
  2016-02-12 11:15 [PATCH] iio: adc/imx25-gcq: move incorrect do_div Arnd Bergmann
  2016-02-13 13:45 ` Jonathan Cameron
@ 2016-02-15  9:59 ` Markus Pargmann
  1 sibling, 0 replies; 3+ messages in thread
From: Markus Pargmann @ 2016-02-15  9:59 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Lee Jones, Jonathan Cameron, linux-arm-kernel, Denis Carikli,
	Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald, linux-iio,
	linux-kernel

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

Hi,

On Friday, February 12, 2016 12:15:29 PM Arnd Bergmann wrote:
> The newly added driver uses do_div() to device a 32-bit number, which now
> provokes a warning:
> 
> drivers/iio/adc/fsl-imx25-gcq.c: In function 'mx25_gcq_setup_cfgs':
> include/asm-generic/div64.h:207:28: warning: comparison of distinct pointer types lacks a cast
>   (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
> 
> This replaces the do_div() call with a straight division operator.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 6df2e98c3ea5 ("iio: adc: Add imx25-gcq ADC driver")

Thanks for fixing this.

Reviewed-by: Markus Pargmann <mpa@pengutronix.de>

Best Regards,

Markus

> ---
>  drivers/iio/adc/fsl-imx25-gcq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c
> index 2fd192735d5b..72b32c1ab257 100644
> --- a/drivers/iio/adc/fsl-imx25-gcq.c
> +++ b/drivers/iio/adc/fsl-imx25-gcq.c
> @@ -233,7 +233,7 @@ 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);
> +			priv->channel_vref_mv[reg] /= 1000;
>  			break;
>  		case MX25_ADC_REFP_INT:
>  			priv->channel_vref_mv[reg] = 2500;
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-15  9:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-12 11:15 [PATCH] iio: adc/imx25-gcq: move incorrect do_div Arnd Bergmann
2016-02-13 13:45 ` Jonathan Cameron
2016-02-15  9:59 ` Markus Pargmann

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).