powerpc: Use the newly added is_tsk_32bit_task() macro
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Fri, 21 Jan 2022 07:58:47 +0000 (07:58 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 12 Feb 2022 11:47:42 +0000 (22:47 +1100)
Two places deserve using the macro is_tsk_32bit_task() added by
commit 252745240ba0 ("powerpc/audit: Fix syscall_get_arch()")

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/7304a889dbe885aefad8a8333673c81ee4b8f7a6.1642751874.git.christophe.leroy@csgroup.eu
arch/powerpc/kernel/ptrace/ptrace-view.c
arch/powerpc/perf/perf_regs.c

index b8be1d6668b59a36aba451912ceaafa823f95dc1..f15bc78caf7188278eca0074b61f1053b9563086 100644 (file)
@@ -841,7 +841,7 @@ static const struct user_regset_view user_ppc_compat_view = {
 
 const struct user_regset_view *task_user_regset_view(struct task_struct *task)
 {
-       if (IS_ENABLED(CONFIG_PPC64) && test_tsk_thread_flag(task, TIF_32BIT))
+       if (IS_ENABLED(CONFIG_COMPAT) && is_tsk_32bit_task(task))
                return &user_ppc_compat_view;
        return &user_ppc_native_view;
 }
index 51d31b65e423b63b9b4facfbd717a3d0522bc26f..350dccb0143c77d3e8c89373568cb1556f298f5b 100644 (file)
@@ -134,12 +134,10 @@ int perf_reg_validate(u64 mask)
 
 u64 perf_reg_abi(struct task_struct *task)
 {
-#ifdef CONFIG_PPC64
-       if (!test_tsk_thread_flag(task, TIF_32BIT))
-               return PERF_SAMPLE_REGS_ABI_64;
+       if (is_tsk_32bit_task(task))
+               return PERF_SAMPLE_REGS_ABI_32;
        else
-#endif
-       return PERF_SAMPLE_REGS_ABI_32;
+               return PERF_SAMPLE_REGS_ABI_64;
 }
 
 void perf_get_regs_user(struct perf_regs *regs_user,