linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Suchanek <msuchanek@suse.de>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Michal Suchanek <msuchanek@suse.de>,
	Allison Randal <allison@lohutok.net>,
	Christophe Leroy <christophe.leroy@c-s.fr>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH] powerpc/perf: remove current_is_64bit()
Date: Thu, 12 Sep 2019 21:46:33 +0200	[thread overview]
Message-ID: <20190912194633.12045-1-msuchanek@suse.de> (raw)
In-Reply-To: <9973bf6b-f1b9-c778-bd88-ed41e45ca126@c-s.fr>

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 <christophe.leroy@c-s.fr>
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
 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


  parent reply	other threads:[~2019-09-12 19:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12 17:26 [PATCH v8 0/7] Disable compat cruft on ppc64le v8 Michal Suchanek
2019-09-12 17:26 ` [PATCH v8 1/7] powerpc: Add back __ARCH_WANT_SYS_LLSEEK macro Michal Suchanek
2019-09-12 17:26 ` [PATCH v8 2/7] powerpc: move common register copy functions from signal_32.c to signal.c Michal Suchanek
2019-09-12 17:26 ` [PATCH v8 3/7] powerpc/perf: consolidate read_user_stack_32 Michal Suchanek
2019-09-12 17:26 ` [PATCH v8 4/7] powerpc/perf: consolidate valid_user_sp Michal Suchanek
2019-09-12 17:26 ` [PATCH v8 5/7] powerpc/64: make buildable without CONFIG_COMPAT Michal Suchanek
2019-09-12 18:02   ` Christophe Leroy
2019-09-12 18:26     ` Michal Suchánek
2019-09-12 19:36       ` Christophe Leroy
2019-09-12 20:19         ` Michal Suchánek
2019-09-12 19:46     ` Michal Suchanek [this message]
2019-11-14  9:07       ` [PATCH] powerpc/perf: remove current_is_64bit() Michael Ellerman
2019-09-12 17:26 ` [PATCH v8 6/7] powerpc/64: Make COMPAT user-selectable disabled on littleendian by default Michal Suchanek
2019-09-12 17:26 ` [PATCH v8 7/7] powerpc/perf: split callchain.c by bitness Michal Suchanek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190912194633.12045-1-msuchanek@suse.de \
    --to=msuchanek@suse.de \
    --cc=allison@lohutok.net \
    --cc=benh@kernel.crashing.org \
    --cc=christophe.leroy@c-s.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).