From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: David Herrmann <dh.herrmann@gmail.com>, linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Ondrej Zajicek <santiago@crfreenet.org>,
David Miller <davem@davemloft.net>
Subject: Re: [PATCH] fbdev: suppress warning when assigning vga-save/restore base
Date: Mon, 10 Feb 2014 11:23:31 +0000 [thread overview]
Message-ID: <52F8B6B3.5080602@ti.com> (raw)
In-Reply-To: <1375637141-2878-1-git-send-email-dh.herrmann@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1692 bytes --]
Hi David,
On 04/08/13 20:25, David Herrmann wrote:
> If drivers use "struct resource" objects to retrieve the vga-base, they
> must correctly cast the integer to pointer. With x86+PAE we have 32bit
> pointers but 64bit resource_size_t. Hence, cast it to "unsigned long"
> before casting to "void*" to suppress warnings due to size differences.
>
> As IO addresses are always low addresses, we can safely drop the higher
> part of the address. This is what these drivers did before, anyway.
>
> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
> Reported-by: H. Peter Anvin <hpa@zytor.com>
> ---
> Hi
>
> hpa reported build-warnings on i386+PAE:
> /home/hpa/kernel/distwork/drivers/video/arkfb.c:1019:23: warning: cast to
> pointer from integer of different size [-Wint-to-pointer-cast]
> par->state.vgabase = (void __iomem *) vga_res.start;
> ^
> /home/hpa/kernel/distwork/drivers/video/s3fb.c: In function ‘s3_pci_probe’:
> /home/hpa/kernel/distwork/drivers/video/s3fb.c:1186:23: warning: cast to pointer
> from integer of different size [-Wint-to-pointer-cast]
> par->state.vgabase = (void __iomem *) vga_res.start;
> ^
>
> This is due to resource_size_t being 64bit but "void*" 32bit. This patch tries
> to suppress these warnings but I am not really comfortable fixing this. I have
> no idea whether my assumption (IO address are 32bit) is right. Please verify.
>
> @David: The following 3 commits of yours presumably introduced the warnings. I
> would be glad if you could review this:
What was the conclusion on this patch? Should I apply for 3.14 fixes?
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: David Herrmann <dh.herrmann@gmail.com>, <linux-fbdev@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Ondrej Zajicek <santiago@crfreenet.org>,
David Miller <davem@davemloft.net>
Subject: Re: [PATCH] fbdev: suppress warning when assigning vga-save/restore base
Date: Mon, 10 Feb 2014 13:23:31 +0200 [thread overview]
Message-ID: <52F8B6B3.5080602@ti.com> (raw)
In-Reply-To: <1375637141-2878-1-git-send-email-dh.herrmann@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1692 bytes --]
Hi David,
On 04/08/13 20:25, David Herrmann wrote:
> If drivers use "struct resource" objects to retrieve the vga-base, they
> must correctly cast the integer to pointer. With x86+PAE we have 32bit
> pointers but 64bit resource_size_t. Hence, cast it to "unsigned long"
> before casting to "void*" to suppress warnings due to size differences.
>
> As IO addresses are always low addresses, we can safely drop the higher
> part of the address. This is what these drivers did before, anyway.
>
> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
> Reported-by: H. Peter Anvin <hpa@zytor.com>
> ---
> Hi
>
> hpa reported build-warnings on i386+PAE:
> /home/hpa/kernel/distwork/drivers/video/arkfb.c:1019:23: warning: cast to
> pointer from integer of different size [-Wint-to-pointer-cast]
> par->state.vgabase = (void __iomem *) vga_res.start;
> ^
> /home/hpa/kernel/distwork/drivers/video/s3fb.c: In function ‘s3_pci_probe’:
> /home/hpa/kernel/distwork/drivers/video/s3fb.c:1186:23: warning: cast to pointer
> from integer of different size [-Wint-to-pointer-cast]
> par->state.vgabase = (void __iomem *) vga_res.start;
> ^
>
> This is due to resource_size_t being 64bit but "void*" 32bit. This patch tries
> to suppress these warnings but I am not really comfortable fixing this. I have
> no idea whether my assumption (IO address are 32bit) is right. Please verify.
>
> @David: The following 3 commits of yours presumably introduced the warnings. I
> would be glad if you could review this:
What was the conclusion on this patch? Should I apply for 3.14 fixes?
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
next prev parent reply other threads:[~2014-02-10 11:23 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-04 17:25 [PATCH] fbdev: suppress warning when assigning vga-save/restore base David Herrmann
2013-08-04 17:25 ` David Herrmann
2013-08-04 17:33 ` H. Peter Anvin
2013-08-04 17:33 ` H. Peter Anvin
2013-08-05 1:51 ` David Miller
2013-08-05 1:51 ` David Miller
2013-08-05 20:29 ` Ondrej Zajicek
2013-08-05 20:29 ` Ondrej Zajicek
2013-08-05 21:02 ` H. Peter Anvin
2013-08-05 21:02 ` H. Peter Anvin
2013-08-05 21:14 ` H. Peter Anvin
2013-08-05 21:14 ` H. Peter Anvin
2013-08-05 22:29 ` David Miller
2013-08-05 22:29 ` David Miller
2014-02-10 11:23 ` Tomi Valkeinen [this message]
2014-02-10 11:23 ` Tomi Valkeinen
2014-02-10 11:32 ` David Herrmann
2014-02-10 11:32 ` David Herrmann
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=52F8B6B3.5080602@ti.com \
--to=tomi.valkeinen@ti.com \
--cc=davem@davemloft.net \
--cc=dh.herrmann@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=plagnioj@jcrosoft.com \
--cc=santiago@crfreenet.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.