include/linux: move typdef for uintptr_t
authorAneesh Bansal <aneesh.bansal@freescale.com>
Tue, 8 Dec 2015 08:24:28 +0000 (13:54 +0530)
committerYork Sun <yorksun@freescale.com>
Tue, 15 Dec 2015 00:57:34 +0000 (08:57 +0800)
uintptr_t which is a typdef for unsigned long is needed for creating
pointers (32 or 64 bit depending on Core) from 32 bit variables
storing the address.
If a 32 bit variable (u32) is typecasted to a pointer (void *),
compiler gives a warning in case size of pointer on the core is 64 bit.

The typdef has been moved from include/compiler.h to include/linux/types.h

Signed-off-by: Aneesh Bansal <aneesh.bansal@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
include/compiler.h
include/linux/types.h

index 47c296e202d1e97388d3207e4f0c2321831a2f87..f853ed4787623185bdb9f719c11fed44b3fa491b 100644 (file)
@@ -115,9 +115,6 @@ typedef unsigned int uint;
 #ifdef CONFIG_USE_STDINT
 /* Provided by gcc. */
 #include <stdint.h>
-#else
-/* Type for `void *' pointers. */
-typedef unsigned long int uintptr_t;
 #endif
 
 #include <linux/string.h>
index 6f75be4253786888b7717febfadc74a22afb29d3..c7e8fdb9c27b1b4890dd1437712ce4d7ceba0a27 100644 (file)
@@ -124,6 +124,7 @@ typedef             __UINT64_TYPE__ u_int64_t;
 typedef                __INT64_TYPE__          int64_t;
 #endif
 
+typedef unsigned long uintptr_t;
 /*
  * Below are truly Linux-specific types that should never collide with
  * any application/library that wants linux/types.h.