OSDN Git Service

compat: Move compat_timespec/ timeval to compat_time.h
authorDeepa Dinamani <deepa.kernel@gmail.com>
Wed, 14 Mar 2018 04:03:25 +0000 (21:03 -0700)
committerArnd Bergmann <arnd@arndb.de>
Thu, 19 Apr 2018 11:29:54 +0000 (13:29 +0200)
All the current architecture specific defines for these
are the same. Refactor these common defines to a common
header file.

The new common linux/compat_time.h is also useful as it
will eventually be used to hold all the defines that
are needed for compat time types that support non y2038
safe types. New architectures need not have to define these
new types as they will only use new y2038 safe syscalls.
This file can be deleted after y2038 when we stop supporting
non y2038 safe syscalls.

The patch also requires an operation similar to:

git grep "asm/compat\.h" | cut -d ":" -f 1 |  xargs -n 1 sed -i -e "s%asm/compat.h%linux/compat.h%g"

Cc: acme@kernel.org
Cc: benh@kernel.crashing.org
Cc: borntraeger@de.ibm.com
Cc: catalin.marinas@arm.com
Cc: cmetcalf@mellanox.com
Cc: cohuck@redhat.com
Cc: davem@davemloft.net
Cc: deller@gmx.de
Cc: devel@driverdev.osuosl.org
Cc: gerald.schaefer@de.ibm.com
Cc: gregkh@linuxfoundation.org
Cc: heiko.carstens@de.ibm.com
Cc: hoeppner@linux.vnet.ibm.com
Cc: hpa@zytor.com
Cc: jejb@parisc-linux.org
Cc: jwi@linux.vnet.ibm.com
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-parisc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-s390@vger.kernel.org
Cc: mark.rutland@arm.com
Cc: mingo@redhat.com
Cc: mpe@ellerman.id.au
Cc: oberpar@linux.vnet.ibm.com
Cc: oprofile-list@lists.sf.net
Cc: paulus@samba.org
Cc: peterz@infradead.org
Cc: ralf@linux-mips.org
Cc: rostedt@goodmis.org
Cc: rric@kernel.org
Cc: schwidefsky@de.ibm.com
Cc: sebott@linux.vnet.ibm.com
Cc: sparclinux@vger.kernel.org
Cc: sth@linux.vnet.ibm.com
Cc: ubraun@linux.vnet.ibm.com
Cc: will.deacon@arm.com
Cc: x86@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: James Hogan <jhogan@kernel.org>
Acked-by: Helge Deller <deller@gmx.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
28 files changed:
arch/arm64/include/asm/compat.h
arch/arm64/include/asm/stat.h
arch/arm64/kernel/hw_breakpoint.c
arch/arm64/kernel/perf_regs.c
arch/mips/include/asm/compat.h
arch/mips/kernel/signal32.c
arch/parisc/include/asm/compat.h
arch/powerpc/include/asm/compat.h
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/oprofile/backtrace.c
arch/s390/hypfs/hypfs_sprp.c
arch/s390/include/asm/compat.h
arch/s390/include/asm/elf.h
arch/s390/kvm/priv.c
arch/s390/pci/pci_clp.c
arch/sparc/include/asm/compat.h
arch/x86/events/core.c
arch/x86/include/asm/compat.h
arch/x86/include/asm/ftrace.h
arch/x86/kernel/sys_x86_64.c
drivers/s390/block/dasd_ioctl.c
drivers/s390/char/fs3270.c
drivers/s390/char/sclp_ctl.c
drivers/s390/char/vmcp.c
drivers/s390/cio/chsc_sch.c
drivers/s390/net/qeth_core_main.c
include/linux/compat.h
include/linux/compat_time.h [new file with mode: 0644]

index c00c62e..0030f79 100644 (file)
@@ -34,7 +34,6 @@
 
 typedef u32            compat_size_t;
 typedef s32            compat_ssize_t;
-typedef s32            compat_time_t;
 typedef s32            compat_clock_t;
 typedef s32            compat_pid_t;
 typedef u16            __compat_uid_t;
@@ -66,16 +65,6 @@ typedef u32          compat_ulong_t;
 typedef u64            compat_u64;
 typedef u32            compat_uptr_t;
 
-struct compat_timespec {
-       compat_time_t   tv_sec;
-       s32             tv_nsec;
-};
-
-struct compat_timeval {
-       compat_time_t   tv_sec;
-       s32             tv_usec;
-};
-
 struct compat_stat {
 #ifdef __AARCH64EB__
        short           st_dev;
index 15e3559..eab7380 100644 (file)
@@ -20,6 +20,7 @@
 
 #ifdef CONFIG_COMPAT
 
+#include <linux/compat_time.h>
 #include <asm/compat.h>
 
 /*
index 74bb56f..413dbe5 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/smp.h>
 #include <linux/uaccess.h>
 
-#include <asm/compat.h>
 #include <asm/current.h>
 #include <asm/debug-monitors.h>
 #include <asm/hw_breakpoint.h>
index 1d091d0..0bbac61 100644 (file)
@@ -1,11 +1,11 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <linux/compat.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/perf_event.h>
 #include <linux/bug.h>
 #include <linux/sched/task_stack.h>
 
-#include <asm/compat.h>
 #include <asm/perf_regs.h>
 #include <asm/ptrace.h>
 
index 9a0fa66..3e548ee 100644 (file)
@@ -14,7 +14,6 @@
 
 typedef u32            compat_size_t;
 typedef s32            compat_ssize_t;
-typedef s32            compat_time_t;
 typedef s32            compat_clock_t;
 typedef s32            compat_suseconds_t;
 
@@ -46,16 +45,6 @@ typedef u32          compat_ulong_t;
 typedef u64            compat_u64;
 typedef u32            compat_uptr_t;
 
-struct compat_timespec {
-       compat_time_t   tv_sec;
-       s32             tv_nsec;
-};
-
-struct compat_timeval {
-       compat_time_t   tv_sec;
-       s32             tv_usec;
-};
-
 struct compat_stat {
        compat_dev_t    st_dev;
        s32             st_pad1[3];
index c4db910..b5d9e17 100644 (file)
@@ -8,13 +8,13 @@
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  * Copyright (C) 2016, Imagination Technologies Ltd.
  */
+#include <linux/compat.h>
 #include <linux/compiler.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
 #include <linux/syscalls.h>
 
-#include <asm/compat.h>
 #include <asm/compat-signal.h>
 #include <linux/uaccess.h>
 #include <asm/unistd.h>
index 57b8b2a..0cdfec8 100644 (file)
@@ -13,7 +13,6 @@
 
 typedef u32    compat_size_t;
 typedef s32    compat_ssize_t;
-typedef s32    compat_time_t;
 typedef s32    compat_clock_t;
 typedef s32    compat_pid_t;
 typedef u32    __compat_uid_t;
@@ -40,16 +39,6 @@ typedef u32  compat_ulong_t;
 typedef u64    compat_u64;
 typedef u32    compat_uptr_t;
 
-struct compat_timespec {
-       compat_time_t           tv_sec;
-       s32                     tv_nsec;
-};
-
-struct compat_timeval {
-       compat_time_t           tv_sec;
-       s32                     tv_usec;
-};
-
 struct compat_stat {
        compat_dev_t            st_dev; /* dev_t is 32 bits on parisc */
        compat_ino_t            st_ino; /* 32 bits */
index 62168e1..b4773c8 100644 (file)
@@ -17,7 +17,6 @@
 
 typedef u32            compat_size_t;
 typedef s32            compat_ssize_t;
-typedef s32            compat_time_t;
 typedef s32            compat_clock_t;
 typedef s32            compat_pid_t;
 typedef u32            __compat_uid_t;
@@ -45,16 +44,6 @@ typedef u32          compat_ulong_t;
 typedef u64            compat_u64;
 typedef u32            compat_uptr_t;
 
-struct compat_timespec {
-       compat_time_t   tv_sec;
-       s32             tv_nsec;
-};
-
-struct compat_timeval {
-       compat_time_t   tv_sec;
-       s32             tv_usec;
-};
-
 struct compat_stat {
        compat_dev_t    st_dev;
        compat_ino_t    st_ino;
index 6bee65f..a77528d 100644 (file)
@@ -13,6 +13,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 
+#include <linux/compat.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -42,7 +43,6 @@
 #include <asm/paca.h>
 #include <asm/lppaca.h>
 #include <asm/cache.h>
-#include <asm/compat.h>
 #include <asm/mmu.h>
 #include <asm/hvcall.h>
 #include <asm/xics.h>
index ecc66d5..ad054dd 100644 (file)
@@ -7,6 +7,7 @@
  * 2 of the License, or (at your option) any later version.
 **/
 
+#include <linux/compat_time.h>
 #include <linux/oprofile.h>
 #include <linux/sched.h>
 #include <asm/processor.h>
index ae0ed8d..5d85a03 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/string.h>
 #include <linux/types.h>
 #include <linux/uaccess.h>
-#include <asm/compat.h>
 #include <asm/diag.h>
 #include <asm/sclp.h>
 #include "hypfs.h"
index 9830fb6..501aaff 100644 (file)
@@ -53,7 +53,6 @@
 
 typedef u32            compat_size_t;
 typedef s32            compat_ssize_t;
-typedef s32            compat_time_t;
 typedef s32            compat_clock_t;
 typedef s32            compat_pid_t;
 typedef u16            __compat_uid_t;
@@ -97,16 +96,6 @@ typedef struct {
        u32 gprs_high[NUM_GPRS];
 } s390_compat_regs_high;
 
-struct compat_timespec {
-       compat_time_t   tv_sec;
-       s32             tv_nsec;
-};
-
-struct compat_timeval {
-       compat_time_t   tv_sec;
-       s32             tv_usec;
-};
-
 struct compat_stat {
        compat_dev_t    st_dev;
        u16             __pad1;
index 1a61b1b..7d22a47 100644 (file)
  * ELF register definitions..
  */
 
+#include <linux/compat.h>
+
 #include <asm/ptrace.h>
-#include <asm/compat.h>
 #include <asm/syscall.h>
 #include <asm/user.h>
 
@@ -136,7 +137,6 @@ typedef s390_regs elf_gregset_t;
 typedef s390_fp_regs compat_elf_fpregset_t;
 typedef s390_compat_regs compat_elf_gregset_t;
 
-#include <linux/compat.h>
 #include <linux/sched/mm.h>    /* for task_struct */
 #include <asm/mmu_context.h>
 
index ebfa044..a3bce0e 100644 (file)
@@ -26,7 +26,6 @@
 #include <asm/gmap.h>
 #include <asm/io.h>
 #include <asm/ptrace.h>
-#include <asm/compat.h>
 #include <asm/sclp.h>
 #include "gaccess.h"
 #include "kvm-s390.h"
index 93cd0f1..19b2d2a 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/uaccess.h>
 #include <asm/pci_debug.h>
 #include <asm/pci_clp.h>
-#include <asm/compat.h>
 #include <asm/clp.h>
 #include <uapi/asm/clp.h>
 
index 1898b62..1910c44 100644 (file)
@@ -11,7 +11,6 @@
 
 typedef u32            compat_size_t;
 typedef s32            compat_ssize_t;
-typedef s32            compat_time_t;
 typedef s32            compat_clock_t;
 typedef s32            compat_pid_t;
 typedef u16            __compat_uid_t;
@@ -39,16 +38,6 @@ typedef u32          compat_ulong_t;
 typedef u64            compat_u64;
 typedef u32            compat_uptr_t;
 
-struct compat_timespec {
-       compat_time_t   tv_sec;
-       s32             tv_nsec;
-};
-
-struct compat_timeval {
-       compat_time_t   tv_sec;
-       s32             tv_usec;
-};
-
 struct compat_stat {
        compat_dev_t    st_dev;
        compat_ino_t    st_ino;
index a6006e7..7a987e6 100644 (file)
@@ -2391,7 +2391,7 @@ static unsigned long get_segment_base(unsigned int segment)
 
 #ifdef CONFIG_IA32_EMULATION
 
-#include <asm/compat.h>
+#include <linux/compat.h>
 
 static inline int
 perf_callchain_user32(struct pt_regs *regs, struct perf_callchain_entry_ctx *entry)
index e1c8dab..7cd314b 100644 (file)
@@ -17,7 +17,6 @@
 
 typedef u32            compat_size_t;
 typedef s32            compat_ssize_t;
-typedef s32            compat_time_t;
 typedef s32            compat_clock_t;
 typedef s32            compat_pid_t;
 typedef u16            __compat_uid_t;
@@ -46,16 +45,6 @@ typedef u32          compat_u32;
 typedef u64 __attribute__((aligned(4))) compat_u64;
 typedef u32            compat_uptr_t;
 
-struct compat_timespec {
-       compat_time_t   tv_sec;
-       s32             tv_nsec;
-};
-
-struct compat_timeval {
-       compat_time_t   tv_sec;
-       s32             tv_usec;
-};
-
 struct compat_stat {
        compat_dev_t    st_dev;
        u16             __pad1;
index 09ad885..db25aa1 100644 (file)
@@ -49,7 +49,7 @@ int ftrace_int3_handler(struct pt_regs *regs);
 #if !defined(__ASSEMBLY__) && !defined(COMPILE_OFFSETS)
 
 #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_IA32_EMULATION)
-#include <asm/compat.h>
+#include <linux/compat.h>
 
 /*
  * Because ia32 syscalls do not map to x86_64 syscall numbers
index a3f15ed..6a78d4b 100644 (file)
@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <linux/compat.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/sched/mm.h>
@@ -19,7 +20,6 @@
 #include <linux/elf.h>
 
 #include <asm/elf.h>
-#include <asm/compat.h>
 #include <asm/ia32.h>
 #include <asm/syscalls.h>
 #include <asm/mpx.h>
index 7bdc6aa..2016e0e 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/fs.h>
 #include <linux/blkpg.h>
 #include <linux/slab.h>
-#include <asm/compat.h>
 #include <asm/ccwdev.h>
 #include <asm/schid.h>
 #include <asm/cmb.h>
index 6182248..16a4e85 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/slab.h>
 #include <linux/types.h>
 
-#include <asm/compat.h>
 #include <asm/ccwdev.h>
 #include <asm/cio.h>
 #include <asm/ebcdic.h>
index a78cea0..248b5db 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/init.h>
 #include <linux/ioctl.h>
 #include <linux/fs.h>
-#include <asm/compat.h>
 #include <asm/sclp_ctl.h>
 #include <asm/sclp.h>
 
index 17e411c..948ce82 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/mutex.h>
 #include <linux/cma.h>
 #include <linux/mm.h>
-#include <asm/compat.h>
 #include <asm/cpcmd.h>
 #include <asm/debug.h>
 #include <asm/vmcp.h>
index 0015729..8d9f366 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/miscdevice.h>
 #include <linux/kernel_stat.h>
 
-#include <asm/compat.h>
 #include <asm/cio.h>
 #include <asm/chsc.h>
 #include <asm/isc.h>
index 04fefa5..df5d845 100644 (file)
@@ -10,6 +10,7 @@
 #define KMSG_COMPONENT "qeth"
 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
 
+#include <linux/compat.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/string.h>
@@ -32,7 +33,6 @@
 #include <asm/chpid.h>
 #include <asm/io.h>
 #include <asm/sysinfo.h>
-#include <asm/compat.h>
 #include <asm/diag.h>
 #include <asm/cio.h>
 #include <asm/ccwdev.h>
index 48d29b1..cd50b00 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <linux/types.h>
+#include <linux/compat_time.h>
 
 #include <linux/stat.h>
 #include <linux/param.h>       /* for HZ */
diff --git a/include/linux/compat_time.h b/include/linux/compat_time.h
new file mode 100644 (file)
index 0000000..56a54a1
--- /dev/null
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_COMPAT_TIME_H
+#define _LINUX_COMPAT_TIME_H
+
+#include <linux/types.h>
+
+typedef s32            compat_time_t;
+
+struct compat_timespec {
+       compat_time_t   tv_sec;
+       s32             tv_nsec;
+};
+
+struct compat_timeval {
+       compat_time_t   tv_sec;
+       s32             tv_usec;
+};
+
+#endif /* _LINUX_COMPAT_TIME_H */