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 c00c62e1a4a3e03d5d0f8c3d0145ad7fb14309b3..0030f79808b32c7a722dc4ca74ea577604fbf631 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 15e35598ac407a99fb7d48770f00b298ee52ea0e..eab7380197071b87692ddbea7f560510ef5cf4e3 100644 (file)
@@ -20,6 +20,7 @@
 
 #ifdef CONFIG_COMPAT
 
+#include <linux/compat_time.h>
 #include <asm/compat.h>
 
 /*
index 74bb56f656eff024839df19897ba06512128e9bb..413dbe530da836d3dc1119830628454168921064 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 1d091d048d046cc6a5fc66debbba8e21c2c873a6..0bbac612146eabecdc1c78a4aa12f602bf8f9ccb 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 9a0fa66b81aca6c47dab0189cbba57b7c413a952..3e548ee99a2f4ade32a38f13ef3ca87b78be2b94 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 c4db910a8794df541ec4c2f5b8ed1763340cf71a..b5d9e1784aff35ef0724a96e2784d11eb9e15057 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 57b8b2a2fd4e0b0bb6fe6e5ea2279e525e986e78..0cdfec8857bd9144678e3c1af537c8a1b82ad3f3 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 62168e1158f1b4ade5a2058080b0d9d6b25666a5..b4773c81f7d53ab30aa0b6c56dcd24847e3b00af 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 6bee65f3cfd34bf896ef770f805ec62d417ae9db..a77528db474cb8a2521849e4e3054316b00b85d1 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 ecc66d5f02c9075e2c97225895d840ba5775e3ec..ad054dd0d6666332b68476d51e2f4ec49637d800 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 ae0ed8dd5f1b362eb3c93ee58ed10d947a587c83..5d85a039391c6193454b40addda2319ea66a6ffe 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 9830fb6b076eaa957ecd6123ac9d8ca83482453d..501aaff853047d4f1da7cfa251fe7d9e97df798b 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 1a61b1b997f2a0da08882411a8b701780fffba9a..7d22a474a040ddd3d0e76c84075db6ab17bb2263 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 ebfa0442e569af65fae1a46a4736024555721b80..a3bce0e8434628a1c8d05404149e6573a71bd4ab 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 93cd0f1ca12bb4788cb79354940defd397de1f1a..19b2d2a9b43db346a4ac3e308582c7a322c9d01c 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 1898b6223160869e80b035f4b10ed6f61dae3271..1910c44521e3f889cf2763db7eb084a9811b7a90 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 a6006e7bb729a808d5a58829bb2524db98135c2f..7a987e6c7c356faa88f0c4cfbea7ebb377173115 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 e1c8dab8667097dcbb69ec6808df9f287a720487..7cd314b71c513154c2e13253791898c5c4807319 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 09ad8857274692b88942404a8f4e1d5a01624cd0..db25aa15b7055fa57b729ff650ccea061507a135 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 a3f15ed545b560759fda579f1e3bd29f752269a3..6a78d4b36a7974ad4d4b4d75500c566529e4d227 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 7bdc6aaa0ba3622c33ad33235131a7ba0b86c580..2016e0ed5865726011742227de740053d492b337 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 61822480a2a0bdfa808e4f9d3e19965857e7700d..16a4e8528bbc34198677f1e9f879790192fb4f33 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 a78cea0c3a09b8a6be200c80352fe89c31b28cd7..248b5db3eaa8c0de73caf360b45f5690453c675d 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 17e411c575768164c43ea47184e7bdfa2162fb28..948ce82a7725a349157b892b55e4892d6a344f77 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 0015729d917d90e049a1def14cba883ec2c31cc3..8d9f36625ba5eb2efed79a4e2d8485a16db4ce29 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 04fefa5bb08d168b7beefeeef62b1190aab84232..df5d8451a51a12760bcd2ef8893e61cf2f07ac1c 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 48d29b1339bed1a029da276a1dc8a80c442dfeea..cd50b00ef59adf4eab703a856ec44162433963da 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 */