* [PATCH] i2c: ocores: Fix pointer to integer cast warning
@ 2013-02-19 7:33 Jayachandran C
[not found] ` <1361259199-24709-1-git-send-email-jchandra-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Jayachandran C @ 2013-02-19 7:33 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Wolfram Sang, Peter Korsgaard
Cc: Jayachandran C
After commit a000b8c1 [i2c: ocores: Add support for the GRLIB port of the
controller and use function pointers for getreg and setreg function],
compiling i2c-ocores.c for 64-bit gives the following warning:
drivers/i2c/busses/i2c-ocores.c: In function 'ocores_i2c_of_probe':
drivers/i2c/busses/i2c-ocores.c:334:15: warning: cast from pointer to integer of different size
Fix it by casting the pointer to long.
Signed-off-by: Jayachandran C <jchandra-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
drivers/i2c/busses/i2c-ocores.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index a873d0a..6afa02d 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -331,7 +331,7 @@ static int ocores_i2c_of_probe(struct platform_device *pdev,
&i2c->reg_io_width);
match = of_match_node(ocores_i2c_match, pdev->dev.of_node);
- if (match && (int)match->data == TYPE_GRLIB) {
+ if (match && (long)match->data == TYPE_GRLIB) {
dev_dbg(&pdev->dev, "GRLIB variant of i2c-ocores\n");
i2c->setreg = oc_setreg_grlib;
i2c->getreg = oc_getreg_grlib;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] i2c: ocores: Fix pointer to integer cast warning
[not found] ` <1361259199-24709-1-git-send-email-jchandra-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
@ 2013-02-19 8:31 ` Peter Korsgaard
[not found] ` <87liakiu20.fsf-D6SC8u56vOOJDPpyT6T3/w@public.gmane.org>
2013-02-21 9:37 ` Wolfram Sang
1 sibling, 1 reply; 4+ messages in thread
From: Peter Korsgaard @ 2013-02-19 8:31 UTC (permalink / raw)
To: Jayachandran C
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Wolfram Sang,
andreas-FkzTOoA/JUlBDgjK7y7TUQ
>>>>> "Jayachandran" == Jayachandran C <jchandra-dY08KVG/lbpWk0Htik3J/w@public.gmane.org> writes:
Jayachandran> After commit a000b8c1 [i2c: ocores: Add support for the
Jayachandran> GRLIB port of the controller and use function pointers
Jayachandran> for getreg and setreg function], compiling i2c-ocores.c
Jayachandran> for 64-bit gives the following warning:
Jayachandran> drivers/i2c/busses/i2c-ocores.c: In function 'ocores_i2c_of_probe':
Jayachandran> drivers/i2c/busses/i2c-ocores.c:334:15: warning: cast from pointer to integer of different size
Jayachandran> Fix it by casting the pointer to long.
I've CC'ed Andreas who made the change.
Acked-by: Peter Korsgaard <jacmet-OfajU3CKLf1/SzgSGea1oA@public.gmane.org>
Jayachandran> Signed-off-by: Jayachandran C <jchandra-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Jayachandran> ---
Jayachandran> drivers/i2c/busses/i2c-ocores.c | 2 +-
Jayachandran> 1 file changed, 1 insertion(+), 1 deletion(-)
Jayachandran> diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
Jayachandran> index a873d0a..6afa02d 100644
Jayachandran> --- a/drivers/i2c/busses/i2c-ocores.c
Jayachandran> +++ b/drivers/i2c/busses/i2c-ocores.c
Jayachandran> @@ -331,7 +331,7 @@ static int ocores_i2c_of_probe(struct platform_device *pdev,
Jayachandran> &i2c->reg_io_width);
Jayachandran> match = of_match_node(ocores_i2c_match, pdev->dev.of_node);
Jayachandran> - if (match && (int)match->data == TYPE_GRLIB) {
Jayachandran> + if (match && (long)match->data == TYPE_GRLIB) {
Jayachandran> dev_dbg(&pdev->dev, "GRLIB variant of i2c-ocores\n");
i2c-> setreg = oc_setreg_grlib;
i2c-> getreg = oc_getreg_grlib;
Jayachandran> --
Jayachandran> 1.7.9.5
Jayachandran> --
Jayachandran> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
Jayachandran> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Jayachandran> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i2c: ocores: Fix pointer to integer cast warning
[not found] ` <87liakiu20.fsf-D6SC8u56vOOJDPpyT6T3/w@public.gmane.org>
@ 2013-02-19 13:05 ` Andreas Larsson
0 siblings, 0 replies; 4+ messages in thread
From: Andreas Larsson @ 2013-02-19 13:05 UTC (permalink / raw)
To: Peter Korsgaard
Cc: Jayachandran C, linux-i2c-u79uwXL29TY76Z2rM5mHXA, Wolfram Sang
On 2013-02-19 09:31, Peter Korsgaard wrote:
>>>>>> "Jayachandran" == Jayachandran C <jchandra-dY08KVG/lbpWk0Htik3J/w@public.gmane.org> writes:
>
> Jayachandran> After commit a000b8c1 [i2c: ocores: Add support for the
> Jayachandran> GRLIB port of the controller and use function pointers
> Jayachandran> for getreg and setreg function], compiling i2c-ocores.c
> Jayachandran> for 64-bit gives the following warning:
>
> Jayachandran> drivers/i2c/busses/i2c-ocores.c: In function 'ocores_i2c_of_probe':
> Jayachandran> drivers/i2c/busses/i2c-ocores.c:334:15: warning: cast from pointer to integer of different size
>
> Jayachandran> Fix it by casting the pointer to long.
>
> I've CC'ed Andreas who made the change.
>
> Acked-by: Peter Korsgaard <jacmet-OfajU3CKLf1/SzgSGea1oA@public.gmane.org>
Thanks!
Acked-by: Andreas Larsson <andreas-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i2c: ocores: Fix pointer to integer cast warning
[not found] ` <1361259199-24709-1-git-send-email-jchandra-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2013-02-19 8:31 ` Peter Korsgaard
@ 2013-02-21 9:37 ` Wolfram Sang
1 sibling, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2013-02-21 9:37 UTC (permalink / raw)
To: Jayachandran C; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Peter Korsgaard
On Tue, Feb 19, 2013 at 01:03:19PM +0530, Jayachandran C wrote:
> After commit a000b8c1 [i2c: ocores: Add support for the GRLIB port of the
> controller and use function pointers for getreg and setreg function],
> compiling i2c-ocores.c for 64-bit gives the following warning:
>
> drivers/i2c/busses/i2c-ocores.c: In function 'ocores_i2c_of_probe':
> drivers/i2c/busses/i2c-ocores.c:334:15: warning: cast from pointer to integer of different size
>
> Fix it by casting the pointer to long.
>
> Signed-off-by: Jayachandran C <jchandra-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Applied, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-02-21 9:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-19 7:33 [PATCH] i2c: ocores: Fix pointer to integer cast warning Jayachandran C
[not found] ` <1361259199-24709-1-git-send-email-jchandra-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2013-02-19 8:31 ` Peter Korsgaard
[not found] ` <87liakiu20.fsf-D6SC8u56vOOJDPpyT6T3/w@public.gmane.org>
2013-02-19 13:05 ` Andreas Larsson
2013-02-21 9:37 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox