From 622b95274e4d699f3c713c325e958565312625ad Mon Sep 17 00:00:00 2001 From: Ryan Harkin Date: Fri, 23 Oct 2015 16:50:51 +0100 Subject: cfi_flash: use specific width types for cword This patch changes the cword union to use specific length types that are architecture indepented. This patch also renames the members of the cword union to represent their usage, i.e.: c -> w8 s -> w16 l -> w32 ll -> w64 Where "w" stands for "width" in bits. I discovered this problem when enabling CFI flash on vexpress64. cword.l was an unsigned long int, but it was intended to be 32 bits wide. Unfortunately, it's 64-bits wide on a 64-bit system, meaning that a 64-bit system fails when attempting to use 32-bit wide CFI flash parts. Similar problems also existed with the other cword sizes. Signed-off-by: Ryan Harkin Reviewed-by: Linus Walleij Signed-off-by: Stefan Roese --- include/mtd/cfi_flash.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/mtd') diff --git a/include/mtd/cfi_flash.h b/include/mtd/cfi_flash.h index 048b477..52572b9 100644 --- a/include/mtd/cfi_flash.h +++ b/include/mtd/cfi_flash.h @@ -105,10 +105,10 @@ #define NUM_ERASE_REGIONS 4 /* max. number of erase regions */ typedef union { - unsigned char c; - unsigned short w; - unsigned long l; - unsigned long long ll; + u8 w8; + u16 w16; + u32 w32; + u64 w64; } cfiword_t; /* CFI standard query structure */ -- cgit v1.1