2019-09-12 20:10:30

by Michal Suchánek

[permalink] [raw]
Subject: [PATCH] powerpc/perf: remove current_is_64bit()

Since commit ed1cd6deb013 ("powerpc: Activate CONFIG_THREAD_INFO_IN_TASK")
current_is_64bit() is quivalent to !is_32bit_task().
Remove the redundant function.

Link: https://github.com/linuxppc/issues/issues/275
Link: https://lkml.org/lkml/2019/9/12/540

Fixes: linuxppc#275
Suggested-by: Christophe Leroy <[email protected]>
Signed-off-by: Michal Suchanek <[email protected]>
---
arch/powerpc/perf/callchain.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/arch/powerpc/perf/callchain.c b/arch/powerpc/perf/callchain.c
index 8f30f1b47c78..dd5051015008 100644
--- a/arch/powerpc/perf/callchain.c
+++ b/arch/powerpc/perf/callchain.c
@@ -100,22 +100,10 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *re
}
}

-static inline int current_is_64bit(void)
-{
- if (!IS_ENABLED(CONFIG_COMPAT))
- return IS_ENABLED(CONFIG_PPC64);
- /*
- * We can't use test_thread_flag() here because we may be on an
- * interrupt stack, and the thread flags don't get copied over
- * from the thread_info on the main stack to the interrupt stack.
- */
- return !test_ti_thread_flag(task_thread_info(current), TIF_32BIT);
-}
-
void
perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
{
- if (current_is_64bit())
+ if (!is_32bit_task())
perf_callchain_user_64(entry, regs);
else
perf_callchain_user_32(entry, regs);
--
2.23.0


2019-11-14 09:11:15

by Michael Ellerman

[permalink] [raw]
Subject: Re: [PATCH] powerpc/perf: remove current_is_64bit()

On Thu, 2019-09-12 at 19:46:33 UTC, Michal Suchanek wrote:
> Since commit ed1cd6deb013 ("powerpc: Activate CONFIG_THREAD_INFO_IN_TASK")
> current_is_64bit() is quivalent to !is_32bit_task().
> Remove the redundant function.
>
> Link: https://github.com/linuxppc/issues/issues/275
> Link: https://lkml.org/lkml/2019/9/12/540
>
> Fixes: linuxppc#275
> Suggested-by: Christophe Leroy <[email protected]>
> Signed-off-by: Michal Suchanek <[email protected]>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/42484d2c0f82b666292faf6668c77b49a3a04bc0

cheers