Thread (9 messages) 9 messages, 5 authors, 2014-02-10

Re: [PATCH] fbdev: suppress warning when assigning vga-save/restore base

From: "H. Peter Anvin" <hpa@zytor.com>
Date: 2013-08-04 17:34:40
Also in: lkml

On 08/04/2013 10:25 AM, 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 <redacted>
Reported-by: H. Peter Anvin <hpa@zytor.com>
I'm still bothered here.  Casting between resource_size_t and void *
implies a confusion between physical and virtual addresses.  That may be
unavoidable for some reason, but I'd like to know what exactly is confused.

Anyone who can dig backwards and summarize?  In other words:

Where in the current code do we stuff a physical address in a pointer,
or a virtual address into a non-pointer?

	-hpa

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help