[flashrom] [PATCH 05/10] Use uintptr_t for chipaddr instead of unsigned long.

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Sat Jul 13 18:07:22 CEST 2013


Am 10.07.2013 21:17 schrieb Stefan Tauner:
> Signed-off-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>
>
> diff --git a/flash.h b/flash.h
> index ba93245..9e787c0 100644
> --- a/flash.h
> +++ b/flash.h
> @@ -41,7 +41,8 @@
>  #define ERROR_OOM	-100
>  #define TIMEOUT_ERROR	-101
>  
> -typedef unsigned long chipaddr;
> +/* TODO: check using code for correct usage of types */
> +typedef uintptr_t chipaddr;

This looks too good to be viable. I have a bad feeling about this in the
context of 64-bit resources on x86 (32bit), but drivers accessing
resources shouldn't be using chipaddr anyway.. That said, it should not
result in any breakage on 32bit platforms. We may see pretty explosions
once we start supporting the x32 pseudo-arch. But that will need an
audit of the codebase anyway.

Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/





More information about the flashrom mailing list