cris: Use "int" for ssize_t to match size_t
PATCH 1/1 cris: Use "int" for ssize_t to match size_t
On cris-linux-gcc, __SIZE_TYPE__ expands to "unsigned int", as gcc-4.6.3-nolibc/cris-linux/lib/gcc/cris-linux/4.6.3/plugin/include/config/cris/linux.h has
#define SIZE_TYPE "unsigned int"
Hence __kernel_size_t is also "unsigned int". But __kernel_ssize_t is "long", which has a different base type, causing compiler warnings like:
fs/quota/quota_tree.c:372:4: warning: format '%zd' expects argument of type 'signed size_t', but argument 4 has type 'ssize_t' [-Wformat]
To fix this, __kernel_ssize_t should be changed to "int". Hence cris can just use the generic 32-bit versions from include/asm-generic/posix_types.h for all size-related types.
--- arch/cris/include/asm/posix_types.h | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
arch/cris/include/asm/posix_types.h +0 -5
@@ -22,11 +22,6 @@ typedef unsigned short __kernel_uid_t;typedef unsigned short __kernel_gid_t ;#define __kernel_uid_t __kernel_uid_t -typedef __SIZE_TYPE__ __kernel_size_t ; -typedef long __kernel_ssize_t ; -typedef int __kernel_ptrdiff_t ; -#define __kernel_size_t __kernel_size_t -typedef unsigned short __kernel_old_dev_t ;#define __kernel_old_dev_t __kernel_old_dev_t
Signature · 1 line
1.7.0.4
Quoted 6 lines · Geert Uytterhoeven
On cris-linux-gcc,
__SIZE_TYPE__expands to "unsigned int", asgcc-4.6.3-nolibc/cris-linux/lib/gcc/cris-linux/4.6.3/plugin/include/config/cris/linux.hhas#define SIZE_TYPE "unsigned int"
Quoted 8 lines
Hence
__kernel_size_tis also "unsigned int". But__kernel_ssize_tis "long", which has a different base type, causing compiler warnings like:
fs/quota/quota_tree.c:372:4: warning: format '%zd' expects argument of type 'signedsize_t', but argument 4 has type 'ssize_t' [-Wformat]To fix this,
__kernel_ssize_tshould be changed to "int". Hence cris can just use the generic 32-bit versions frominclude/asm-generic/posix_types.hfor all size-related types.
Yup, I agree, thanks!
Quoted 2 lines
Signed-off-by Geert Uytterhoeven <[email protected]>Cc Mikael Starvik <[email protected]>
Quoted 30 lines
Cc Hans-Peter Nilsson <[email protected]>--- arch/cris/include/asm/posix_types.h | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)arch/cris/include/asm/posix_types.h +0
-5@@ -22,11 +22,6 @@ typedef unsigned short __kernel_uid_t;typedef unsigned short __kernel_gid_t ;#define __kernel_uid_t __kernel_uid_t -typedef __SIZE_TYPE__ __kernel_size_t ; -typedef long __kernel_ssize_t ; -typedef int __kernel_ptrdiff_t ; -#define __kernel_size_t __kernel_size_t -typedef unsigned short __kernel_old_dev_t ;#define __kernel_old_dev_t __kernel_old_dev_tSignature · 7 lines
1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
/^JN - Jesper Nilsson
Signature · 1 line
Jesper Nilsson -- [email protected]