public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Use __kernel_ulong_t in struct msqid64_ds
@ 2013-12-25 16:08 H.J. Lu
  2013-12-26 15:52 ` H.J. Lu
  0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2013-12-25 16:08 UTC (permalink / raw)
  To: H. Peter Anvin, LKML

Both x32 and x86-64 use the same struct msqid64_ds for system calls.
But x32 long is 32-bit. This patch replaces unsigned long with
__kernel_ulong_t in struct msqid64_ds.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
 include/uapi/asm-generic/msgbuf.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/uapi/asm-generic/msgbuf.h b/include/uapi/asm-generic/msgbuf.h
index aec850d..f55ecc4 100644
--- a/include/uapi/asm-generic/msgbuf.h
+++ b/include/uapi/asm-generic/msgbuf.h
@@ -35,13 +35,13 @@ struct msqid64_ds {
 #if __BITS_PER_LONG != 64
 	unsigned long	__unused3;
 #endif
-	unsigned long  msg_cbytes;	/* current number of bytes on queue */
-	unsigned long  msg_qnum;	/* number of messages in queue */
-	unsigned long  msg_qbytes;	/* max number of bytes on queue */
+	__kernel_ulong_t msg_cbytes;	/* current number of bytes on queue */
+	__kernel_ulong_t msg_qnum;	/* number of messages in queue */
+	__kernel_ulong_t msg_qbytes;	/* max number of bytes on queue */
 	__kernel_pid_t msg_lspid;	/* pid of last msgsnd */
 	__kernel_pid_t msg_lrpid;	/* last receive pid */
-	unsigned long  __unused4;
-	unsigned long  __unused5;
+	__kernel_ulong_t __unused4;
+	__kernel_ulong_t __unused5;
 };
 
 #endif /* __ASM_GENERIC_MSGBUF_H */
-- 
1.8.4.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Use __kernel_ulong_t in struct msqid64_ds
  2013-12-25 16:08 [PATCH] Use __kernel_ulong_t in struct msqid64_ds H.J. Lu
@ 2013-12-26 15:52 ` H.J. Lu
  0 siblings, 0 replies; 2+ messages in thread
From: H.J. Lu @ 2013-12-26 15:52 UTC (permalink / raw)
  To: H. Peter Anvin, LKML

[-- Attachment #1: Type: text/plain, Size: 331 bytes --]

On Wed, Dec 25, 2013 at 08:08:07AM -0800, H.J. Lu wrote:
> Both x32 and x86-64 use the same struct msqid64_ds for system calls.
> But x32 long is 32-bit. This patch replaces unsigned long with
> __kernel_ulong_t in struct msqid64_ds.
> 

Here is the updated patch which uses __kernel_ulong_t only if
__BITS_PER_LONG == 64. 
 
H.J.

[-- Attachment #2: 0005-Use-__kernel_ulong_t-in-struct-msqid64_ds.patch --]
[-- Type: text/plain, Size: 1873 bytes --]

>From 018f0c350f4a38bb238deb632b79dc909b9490a7 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 25 Dec 2013 08:05:12 -0800
Subject: [PATCH] Use __kernel_ulong_t in struct msqid64_ds

Both x32 and x86-64 use the same struct msqid64_ds for system calls.
But x32 long is 32-bit. This patch replaces unsigned long with
__kernel_ulong_t in struct msqid64_ds if __BITS_PER_LONG == 64.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
 include/uapi/asm-generic/msgbuf.h | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/include/uapi/asm-generic/msgbuf.h b/include/uapi/asm-generic/msgbuf.h
index aec850d..e73766a 100644
--- a/include/uapi/asm-generic/msgbuf.h
+++ b/include/uapi/asm-generic/msgbuf.h
@@ -34,14 +34,23 @@ struct msqid64_ds {
 	__kernel_time_t msg_ctime;	/* last change time */
 #if __BITS_PER_LONG != 64
 	unsigned long	__unused3;
+	unsigned long	msg_cbytes;	/* current number of bytes on queue */
+	unsigned long	msg_qnum;	/* number of messages in queue */
+	unsigned long	msg_qbytes;	/* max number of bytes on queue */
+#else
+	__kernel_ulong_t msg_cbytes;	/* current number of bytes on queue */
+	__kernel_ulong_t msg_qnum;	/* number of messages in queue */
+	__kernel_ulong_t msg_qbytes;	/* max number of bytes on queue */
 #endif
-	unsigned long  msg_cbytes;	/* current number of bytes on queue */
-	unsigned long  msg_qnum;	/* number of messages in queue */
-	unsigned long  msg_qbytes;	/* max number of bytes on queue */
 	__kernel_pid_t msg_lspid;	/* pid of last msgsnd */
 	__kernel_pid_t msg_lrpid;	/* last receive pid */
-	unsigned long  __unused4;
-	unsigned long  __unused5;
+#if __BITS_PER_LONG != 64
+	unsigned long	__unused4;
+	unsigned long	__unused5;
+#else
+	__kernel_ulong_t __unused4;
+	__kernel_ulong_t __unused5;
+#endif
 };
 
 #endif /* __ASM_GENERIC_MSGBUF_H */
-- 
1.8.4.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-26 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-25 16:08 [PATCH] Use __kernel_ulong_t in struct msqid64_ds H.J. Lu
2013-12-26 15:52 ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox