[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51FE907A.2090201@zytor.com>
Date: Sun, 04 Aug 2013 10:33:46 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: David Herrmann <dh.herrmann@...il.com>
CC: linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
Tomi Valkeinen <tomi.valkeinen@...com>,
Ondrej Zajicek <santiago@...reenet.org>,
David Miller <davem@...emloft.net>
Subject: Re: [PATCH] fbdev: suppress warning when assigning vga-save/restore
base
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@...il.com>
> Reported-by: H. Peter Anvin <hpa@...or.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists