diff mbox

[U-Boot,V2,07/10] fat: port integer.h to U-Boot types

Message ID 1439304945-7968-8-git-send-email-swarren@wwwdotorg.org
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Stephen Warren Aug. 11, 2015, 2:55 p.m. UTC
ff.c uses a bunch of custom typedefs. Define these in terms of standard
types from <linux/types.h>, so they'll automatically be the correct size
for any build of U-Boot.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
v2: Make INT and UINT 32-bit types e.g. so that f_read() can read (or
at the least, report reading) more than 64KiB-1 bytes. Now,
./test/fs/fs-test.sh passes.
---
 fs/fat/integer.h | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
diff mbox

Patch

diff --git a/fs/fat/integer.h b/fs/fat/integer.h
index f254b2a02808..15ed7e06dd7c 100644
--- a/fs/fat/integer.h
+++ b/fs/fat/integer.h
@@ -5,6 +5,8 @@ 
 #ifndef _FF_INTEGER
 #define _FF_INTEGER
 
+#include <linux/types.h>
+
 #ifdef _WIN32	/* FatFs development platform */
 
 #include <windows.h>
@@ -13,20 +15,20 @@ 
 #else			/* Embedded platform */
 
 /* This type MUST be 8 bit */
-typedef unsigned char	BYTE;
+typedef uint8_t		BYTE;
 
 /* These types MUST be 16 bit */
-typedef short			SHORT;
-typedef unsigned short	WORD;
-typedef unsigned short	WCHAR;
+typedef int16_t		SHORT;
+typedef uint16_t	WORD;
+typedef uint16_t	WCHAR;
 
 /* These types MUST be 16 bit or 32 bit */
-typedef int				INT;
-typedef unsigned int	UINT;
+typedef int32_t		INT;
+typedef uint32_t	UINT;
 
 /* These types MUST be 32 bit */
-typedef long			LONG;
-typedef unsigned long	DWORD;
+typedef int32_t		LONG;
+typedef uint32_t	DWORD;
 
 #endif