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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <dh.herrmann@xxxxxxxxx>
> Reported-by: H. Peter Anvin <hpa@xxxxxxxxx>

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


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




[Index of Archives]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Tourism]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux