[1/3] iio: adc: rcar-gyroadc: Cast pointer to uintptr_t to fix warning on 64-bit
diff mbox

Message ID 1507118906-8946-2-git-send-email-geert+renesas@glider.be
State New
Headers show

Commit Message

Geert Uytterhoeven Oct. 4, 2017, 12:08 p.m. UTC
On 64-bit:

    drivers/iio/adc/rcar-gyroadc.c: In function 'rcar_gyroadc_parse_subdevs':
    drivers/iio/adc/rcar-gyroadc.c:352:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
       childmode = (unsigned int)of_id->data;
		   ^

Cast the pointer to uintptr_t instead of unsigned int to fix this.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Currently this driver can be enabled on arm32 only, but the hardware
block can be found in some R-Car Gen3 SoCs, which are arm64.
---
 drivers/iio/adc/rcar-gyroadc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Horman Oct. 5, 2017, 9:11 a.m. UTC | #1
On Wed, Oct 04, 2017 at 02:08:24PM +0200, Geert Uytterhoeven wrote:
> On 64-bit:
> 
>     drivers/iio/adc/rcar-gyroadc.c: In function 'rcar_gyroadc_parse_subdevs':
>     drivers/iio/adc/rcar-gyroadc.c:352:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>        childmode = (unsigned int)of_id->data;
> 		   ^
> 
> Cast the pointer to uintptr_t instead of unsigned int to fix this.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jonathan Cameron Oct. 7, 2017, 11:17 a.m. UTC | #2
On Thu, 5 Oct 2017 11:11:51 +0200
Simon Horman <horms@verge.net.au> wrote:

> On Wed, Oct 04, 2017 at 02:08:24PM +0200, Geert Uytterhoeven wrote:
> > On 64-bit:
> > 
> >     drivers/iio/adc/rcar-gyroadc.c: In function 'rcar_gyroadc_parse_subdevs':
> >     drivers/iio/adc/rcar-gyroadc.c:352:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> >        childmode = (unsigned int)of_id->data;
> > 		   ^
> > 
> > Cast the pointer to uintptr_t instead of unsigned int to fix this.
> > 
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>  
> 
> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

Applied to the togreg branch of iio.git and pushed out as testing for the
autobuilders to play with it.

Thanks,

Jonathan

> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/drivers/iio/adc/rcar-gyroadc.c b/drivers/iio/adc/rcar-gyroadc.c
index 2cb5397ceeea9ff4..0098c66a19572400 100644
--- a/drivers/iio/adc/rcar-gyroadc.c
+++ b/drivers/iio/adc/rcar-gyroadc.c
@@ -348,7 +348,7 @@  static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev)
 			continue;
 		}
 
-		childmode = (unsigned int)of_id->data;
+		childmode = (uintptr_t)of_id->data;
 		switch (childmode) {
 		case RCAR_GYROADC_MODE_SELECT_1_MB88101A:
 			sample_width = 12;