* [PATCH 2/2] s390: Always use "long" for ssize_t to match size_t
[not found] <1344765694-7465-1-git-send-email-geert@linux-m68k.org>
@ 2012-08-12 10:01 ` Geert Uytterhoeven
2012-08-15 8:07 ` Heiko Carstens
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2012-08-12 10:01 UTC (permalink / raw)
To: linux-arch, linux-kernel
Cc: Geert Uytterhoeven, Martin Schwidefsky, Heiko Carstens,
linux-s390
On s390x-linux-gcc, __SIZE_TYPE__ expands to "long unsigned int" for both
32-bit s390 and 64-bit s390x, as
gcc-4.6.3-nolibc/s390x-linux/lib/gcc/s390x-linux/4.6.3/plugin/include/config/s390/linux.h
has
#define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "long unsigned int")
To match this, __kernel_size_t is always set to "long unsigned int".
But while __kernel_ssize_t is "long" on 64-bit s390x, it is "int" on 32-bit
s390, 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 "long", irrespective of word size.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux-s390@vger.kernel.org
---
arch/s390/include/asm/posix_types.h | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/s390/include/asm/posix_types.h b/arch/s390/include/asm/posix_types.h
index 7bcc14e..bf2a2ad 100644
--- a/arch/s390/include/asm/posix_types.h
+++ b/arch/s390/include/asm/posix_types.h
@@ -13,6 +13,7 @@
*/
typedef unsigned long __kernel_size_t;
+typedef long __kernel_ssize_t;
#define __kernel_size_t __kernel_size_t
typedef unsigned short __kernel_old_dev_t;
@@ -25,7 +26,6 @@ typedef unsigned short __kernel_mode_t;
typedef unsigned short __kernel_ipc_pid_t;
typedef unsigned short __kernel_uid_t;
typedef unsigned short __kernel_gid_t;
-typedef int __kernel_ssize_t;
typedef int __kernel_ptrdiff_t;
#else /* __s390x__ */
@@ -35,7 +35,6 @@ typedef unsigned int __kernel_mode_t;
typedef int __kernel_ipc_pid_t;
typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;
-typedef long __kernel_ssize_t;
typedef long __kernel_ptrdiff_t;
typedef unsigned long __kernel_sigset_t; /* at least 32 bits */
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/2] s390: Always use "long" for ssize_t to match size_t
2012-08-12 10:01 ` [PATCH 2/2] s390: Always use "long" for ssize_t to match size_t Geert Uytterhoeven
@ 2012-08-15 8:07 ` Heiko Carstens
0 siblings, 0 replies; 2+ messages in thread
From: Heiko Carstens @ 2012-08-15 8:07 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: linux-arch, linux-kernel, Martin Schwidefsky, linux-s390
On Sun, Aug 12, 2012 at 12:01:34PM +0200, Geert Uytterhoeven wrote:
> On s390x-linux-gcc, __SIZE_TYPE__ expands to "long unsigned int" for both
> 32-bit s390 and 64-bit s390x, as
> gcc-4.6.3-nolibc/s390x-linux/lib/gcc/s390x-linux/4.6.3/plugin/include/config/s390/linux.h
> has
>
> #define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "long unsigned int")
>
> To match this, __kernel_size_t is always set to "long unsigned int".
>
> But while __kernel_ssize_t is "long" on 64-bit s390x, it is "int" on 32-bit
> s390, 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 "long", irrespective of word size.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Applied. Thanks Geert!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-15 8:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1344765694-7465-1-git-send-email-geert@linux-m68k.org>
2012-08-12 10:01 ` [PATCH 2/2] s390: Always use "long" for ssize_t to match size_t Geert Uytterhoeven
2012-08-15 8:07 ` Heiko Carstens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).