
From: Stephen Rothwell <sfr@canb.auug.org.au>

All the 32 bit architectures (effectively) define SIGEV_PAD_SIZE to be
((SIGEV_MAX_SIZE/sizeof(int)) - 3).  So define COMPAT_SIGEV_PAD_SIZE to be
this and replace SIGEV_PAD_SIZE32 where it is used.  It also needs to be
used in the definition of struct compat_sigevent as most of the
architectures would have had it 4 bytes too small in the kernel (since we
were using SIGEV_PAD_SIZE).

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/ia64/ia32/ia32priv.h       |    4 +---
 25-akpm/arch/s390/kernel/compat_linux.h |    3 +--
 25-akpm/include/asm-sparc64/siginfo.h   |    3 +--
 25-akpm/include/linux/compat.h          |    4 +++-
 4 files changed, 6 insertions(+), 8 deletions(-)

diff -puN arch/ia64/ia32/ia32priv.h~add-and-use-compat_sigev_pad_size arch/ia64/ia32/ia32priv.h
--- 25/arch/ia64/ia32/ia32priv.h~add-and-use-compat_sigev_pad_size	Mon Mar  7 16:01:34 2005
+++ 25-akpm/arch/ia64/ia32/ia32priv.h	Mon Mar  7 16:01:34 2005
@@ -230,8 +230,6 @@ typedef union sigval32 {
 	unsigned int sival_ptr;
 } sigval_t32;
 
-#define SIGEV_PAD_SIZE32 ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
-
 typedef struct compat_siginfo {
 	int si_signo;
 	int si_errno;
@@ -289,7 +287,7 @@ typedef struct sigevent32 {
 	int sigev_signo;
 	int sigev_notify;
 	union {
-		int _pad[SIGEV_PAD_SIZE32];
+		int _pad[COMPAT_SIGEV_PAD_SIZE];
 		struct {
 			u32 _function;
 			u32 _attribute; /* really pthread_attr_t */
diff -puN arch/s390/kernel/compat_linux.h~add-and-use-compat_sigev_pad_size arch/s390/kernel/compat_linux.h
--- 25/arch/s390/kernel/compat_linux.h~add-and-use-compat_sigev_pad_size	Mon Mar  7 16:01:34 2005
+++ 25-akpm/arch/s390/kernel/compat_linux.h	Mon Mar  7 16:01:34 2005
@@ -199,7 +199,6 @@ struct ucontext32 {
 	compat_sigset_t		uc_sigmask;	/* mask last for extensibility */
 };
 
-#define SIGEV_PAD_SIZE32 ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
 struct sigevent32 {
 	union {
 		int sival_int;
@@ -208,7 +207,7 @@ struct sigevent32 {
 	int sigev_signo;
 	int sigev_notify;
 	union {
-		int _pad[SIGEV_PAD_SIZE32];
+		int _pad[COMPAT_SIGEV_PAD_SIZE];
 		int _tid;
 		struct {
 			u32 *_function;
diff -puN include/asm-sparc64/siginfo.h~add-and-use-compat_sigev_pad_size include/asm-sparc64/siginfo.h
--- 25/include/asm-sparc64/siginfo.h~add-and-use-compat_sigev_pad_size	Mon Mar  7 16:01:34 2005
+++ 25-akpm/include/asm-sparc64/siginfo.h	Mon Mar  7 16:01:34 2005
@@ -4,7 +4,6 @@
 #define SI_PAD_SIZE32	((SI_MAX_SIZE/sizeof(int)) - 3)
 
 #define SIGEV_PAD_SIZE	((SIGEV_MAX_SIZE/sizeof(int)) - 4)
-#define SIGEV_PAD_SIZE32 ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
 
 #define __ARCH_SI_PREAMBLE_SIZE	(4 * sizeof(int))
 #define __ARCH_SI_TRAPNO
@@ -47,7 +46,7 @@ typedef struct sigevent32 {
 	int sigev_signo;
 	int sigev_notify;
 	union {
-		int _pad[SIGEV_PAD_SIZE32];
+		int _pad[COMPAT_SIGEV_PAD_SIZE];
 
 		struct {
 			u32 _function;
diff -puN include/linux/compat.h~add-and-use-compat_sigev_pad_size include/linux/compat.h
--- 25/include/linux/compat.h~add-and-use-compat_sigev_pad_size	Mon Mar  7 16:01:34 2005
+++ 25-akpm/include/linux/compat.h	Mon Mar  7 16:01:34 2005
@@ -101,12 +101,14 @@ typedef union compat_sigval {
 	compat_uptr_t	sival_ptr;
 } compat_sigval_t;
 
+#define COMPAT_SIGEV_PAD_SIZE	((SIGEV_MAX_SIZE/sizeof(int)) - 3)
+
 typedef struct compat_sigevent {
 	compat_sigval_t sigev_value;
 	compat_int_t sigev_signo;
 	compat_int_t sigev_notify;
 	union {
-		compat_int_t _pad[SIGEV_PAD_SIZE];
+		compat_int_t _pad[COMPAT_SIGEV_PAD_SIZE];
 		compat_int_t _tid;
 
 		struct {
_
