Skip to content

Commit

Permalink
compat: lift compat_s64 and compat_u64 to <asm-generic/compat.h>
Browse files Browse the repository at this point in the history
lift the compat_s64 and compat_u64 definitions into common code using the
COMPAT_FOR_U64_ALIGNMENT symbol for the x86 special case.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Christoph Hellwig authored and Al Viro committed Sep 17, 2020
1 parent 9123e3a commit cc7886d
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 14 deletions.
2 changes: 0 additions & 2 deletions arch/arm64/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ typedef s32 compat_nlink_t;
typedef u16 compat_ipc_pid_t;
typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t;
typedef s64 compat_s64;
typedef u64 compat_u64;

struct compat_stat {
#ifdef __AARCH64EB__
Expand Down
2 changes: 0 additions & 2 deletions arch/mips/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ typedef s32 compat_caddr_t;
typedef struct {
s32 val[2];
} compat_fsid_t;
typedef s64 compat_s64;
typedef u64 compat_u64;

struct compat_stat {
compat_dev_t st_dev;
Expand Down
2 changes: 0 additions & 2 deletions arch/parisc/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ typedef u32 compat_dev_t;
typedef u16 compat_nlink_t;
typedef u16 compat_ipc_pid_t;
typedef u32 compat_caddr_t;
typedef s64 compat_s64;
typedef u64 compat_u64;

struct compat_stat {
compat_dev_t st_dev; /* dev_t is 32 bits on parisc */
Expand Down
2 changes: 0 additions & 2 deletions arch/powerpc/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ typedef s16 compat_nlink_t;
typedef u16 compat_ipc_pid_t;
typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t;
typedef s64 compat_s64;
typedef u64 compat_u64;

struct compat_stat {
compat_dev_t st_dev;
Expand Down
2 changes: 0 additions & 2 deletions arch/s390/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ typedef u16 compat_nlink_t;
typedef u16 compat_ipc_pid_t;
typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t;
typedef s64 compat_s64;
typedef u64 compat_u64;

typedef struct {
u32 mask;
Expand Down
3 changes: 1 addition & 2 deletions arch/sparc/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ typedef s16 compat_nlink_t;
typedef u16 compat_ipc_pid_t;
typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t;
typedef s64 compat_s64;
typedef u64 compat_u64;

struct compat_stat {
compat_dev_t st_dev;
compat_ino_t st_ino;
Expand Down
2 changes: 0 additions & 2 deletions arch/x86/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ typedef u16 compat_nlink_t;
typedef u16 compat_ipc_pid_t;
typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t;
typedef s64 __attribute__((aligned(4))) compat_s64;
typedef u64 __attribute__((aligned(4))) compat_u64;

struct compat_stat {
compat_dev_t st_dev;
Expand Down
8 changes: 8 additions & 0 deletions include/asm-generic/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,12 @@ typedef u32 compat_ulong_t;
typedef u32 compat_uptr_t;
typedef u32 compat_aio_context_t;

#ifdef CONFIG_COMPAT_FOR_U64_ALIGNMENT
typedef s64 __attribute__((aligned(4))) compat_s64;
typedef u64 __attribute__((aligned(4))) compat_u64;
#else
typedef s64 compat_s64;
typedef u64 compat_u64;
#endif

#endif

0 comments on commit cc7886d

Please sign in to comment.