[PATCH] savage: More (intermediate) casts to silence warnings
Mark Kettenis
mark.kettenis at xs4all.nl
Mon Feb 14 05:28:53 PST 2011
> Date: Sun, 13 Feb 2011 21:40:50 +0100
> From: Tormod Volden <lists.tormod at gmail.com>
>
> On Sat, Feb 12, 2011 at 10:43 PM, Mark Kettenis wrote:
> > This isn't really the right way to fix things. At least the casts
> > should use uintptr_t instead of int. That way you won't truncate
> > addresses on true 64-bit architectures. Or just leave these warnings
> > there as a reminder of the misdesigned DGA and DRI APIs. They really
> > should not try to store a "physical" address into a C pointer.
>
> Thanks for the review and explanation. I will change them to
> uintptr_t, and look out for similar cases. In practice, we probably
> won't see many Savage cards on 64-bit architectures :)
I probably would have stuck one into my OpenBSD/amd64 box if I had one
;). But these cards probably don't have 64-bit PCI BARs, and if they
do, the BIOS will still assign an address below the 4G boundary to
support 32-bit OSes.
Changing to uintptr_t is still a good idea though just in case people
copy the code to a driver where it does matter.
Thanks,
Mark
More information about the xorg-devel
mailing list