From 9ee24b2a38358acbe004640776520a093ac34642 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 13 Jun 2019 09:08:47 +0200 Subject: binfmt_flat: remove flat_reloc_valid This helper is the same for all architectures, open code it in the only caller. Signed-off-by: Christoph Hellwig Tested-by: Vladimir Murzin Reviewed-by: Vladimir Murzin Signed-off-by: Greg Ungerer --- arch/h8300/include/asm/flat.h | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/h8300') diff --git a/arch/h8300/include/asm/flat.h b/arch/h8300/include/asm/flat.h index f4cdfcbdd2ba..dcc7775115dd 100644 --- a/arch/h8300/include/asm/flat.h +++ b/arch/h8300/include/asm/flat.h @@ -10,7 +10,6 @@ #define flat_argvp_envp_on_stack() 1 #define flat_old_ram_flag(flags) 1 -#define flat_reloc_valid(reloc, size) ((reloc) <= (size)) #define flat_set_persistent(relval, p) 0 /* -- cgit From 2f3196d49b1e10f1d4bc64cce00dc95fde2b0ce1 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 13 Jun 2019 09:08:48 +0200 Subject: binfmt_flat: remove flat_set_persistent This helper is a no-op on all architectures, remove it. Signed-off-by: Christoph Hellwig Tested-by: Vladimir Murzin Reviewed-by: Vladimir Murzin Signed-off-by: Greg Ungerer --- arch/h8300/include/asm/flat.h | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/h8300') diff --git a/arch/h8300/include/asm/flat.h b/arch/h8300/include/asm/flat.h index dcc7775115dd..7ef7eefded3d 100644 --- a/arch/h8300/include/asm/flat.h +++ b/arch/h8300/include/asm/flat.h @@ -10,7 +10,6 @@ #define flat_argvp_envp_on_stack() 1 #define flat_old_ram_flag(flags) 1 -#define flat_set_persistent(relval, p) 0 /* * on the H8 a couple of the relocations have an instruction in the -- cgit From 1d52dca117434eca9c6efc9c22d24e7a341ad903 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 13 Jun 2019 09:08:50 +0200 Subject: binfmt_flat: remove flat_old_ram_flag Instead add a Kconfig variable that only h8300 selects. Signed-off-by: Christoph Hellwig Signed-off-by: Greg Ungerer --- arch/h8300/Kconfig | 1 + arch/h8300/include/asm/flat.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/h8300') diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index ecfc4b4b6373..d30e8727b02d 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig @@ -2,6 +2,7 @@ config H8300 def_bool y select ARCH_32BIT_OFF_T + select BINFMT_FLAT_OLD_ALWAYS_RAM select GENERIC_ATOMIC64 select HAVE_UID16 select VIRT_TO_BUS diff --git a/arch/h8300/include/asm/flat.h b/arch/h8300/include/asm/flat.h index 7ef7eefded3d..14cc928d5478 100644 --- a/arch/h8300/include/asm/flat.h +++ b/arch/h8300/include/asm/flat.h @@ -9,7 +9,6 @@ #include #define flat_argvp_envp_on_stack() 1 -#define flat_old_ram_flag(flags) 1 /* * on the H8 a couple of the relocations have an instruction in the -- cgit From bdd15a288492f2f496a904c69c4b332057ae2ef6 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 13 Jun 2019 09:08:51 +0200 Subject: binfmt_flat: replace flat_argvp_envp_on_stack with a Kconfig variable This will eventually allow us to kill the need for an for many cases. Signed-off-by: Christoph Hellwig Tested-by: Vladimir Murzin Reviewed-by: Vladimir Murzin Signed-off-by: Greg Ungerer --- arch/h8300/Kconfig | 1 + arch/h8300/include/asm/flat.h | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/h8300') diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index d30e8727b02d..7457f190caaa 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig @@ -2,6 +2,7 @@ config H8300 def_bool y select ARCH_32BIT_OFF_T + select BINFMT_FLAT_ARGVP_ENVP_ON_STACK select BINFMT_FLAT_OLD_ALWAYS_RAM select GENERIC_ATOMIC64 select HAVE_UID16 diff --git a/arch/h8300/include/asm/flat.h b/arch/h8300/include/asm/flat.h index 14cc928d5478..4683146f0e9e 100644 --- a/arch/h8300/include/asm/flat.h +++ b/arch/h8300/include/asm/flat.h @@ -8,8 +8,6 @@ #include -#define flat_argvp_envp_on_stack() 1 - /* * on the H8 a couple of the relocations have an instruction in the * top byte. As there can only be 24bits of address space, we just -- cgit From aef0f78e7460cd2889fe5359b26f7ad3c9555630 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 13 Jun 2019 09:08:57 +0200 Subject: binfmt_flat: add a ARCH_HAS_BINFMT_FLAT option Allow architectures to opt into ARCH_HAS_BINFMT_FLAT support instead of assuming that all nommu ports support the format. Signed-off-by: Christoph Hellwig Reviewed-by: Vladimir Murzin Signed-off-by: Greg Ungerer --- arch/h8300/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/h8300') diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index 7457f190caaa..ec800e9d5aad 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig @@ -2,6 +2,7 @@ config H8300 def_bool y select ARCH_32BIT_OFF_T + select ARCH_HAS_BINFMT_FLAT select BINFMT_FLAT_ARGVP_ENVP_ON_STACK select BINFMT_FLAT_OLD_ALWAYS_RAM select GENERIC_ATOMIC64 -- cgit From 6843d8aa5b9bc61df8787801f19f538123724bfa Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 13 Jun 2019 09:09:00 +0200 Subject: binfmt_flat: remove the persistent argument from flat_get_addr_from_rp The argument is never used. Signed-off-by: Christoph Hellwig Signed-off-by: Greg Ungerer --- arch/h8300/include/asm/flat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/h8300') diff --git a/arch/h8300/include/asm/flat.h b/arch/h8300/include/asm/flat.h index 4683146f0e9e..78070f924177 100644 --- a/arch/h8300/include/asm/flat.h +++ b/arch/h8300/include/asm/flat.h @@ -17,7 +17,7 @@ #define flat_get_relocate_addr(rel) (rel & ~0x00000001) static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags, - u32 *addr, u32 *persistent) + u32 *addr) { u32 val = get_unaligned((__force u32 *)rp); if (!(flags & FLAT_FLAG_GOTPIC)) -- cgit