From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Subject: [PATCH v2 1/6] powerpc/kprobes: Some cosmetic updates to try_to_emulate()
Date: Fri, 22 Sep 2017 14:40:43 +0530 [thread overview]
Message-ID: <9e98f74834af349564b71bc8443bdad55d6e37c6.1505934128.git.naveen.n.rao@linux.vnet.ibm.com> (raw)
In-Reply-To: <cover.1505934128.git.naveen.n.rao@linux.vnet.ibm.com>
1. This is only used in kprobes.c, so make it static.
2. Remove the un-necessary (ret == 0) comparison in the else clause.
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
arch/powerpc/kernel/kprobes.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index 367494dc67d9..c2a6ab38a67f 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -239,7 +239,7 @@ void arch_prepare_kretprobe(struct kretprobe_instance *ri, struct pt_regs *regs)
}
NOKPROBE_SYMBOL(arch_prepare_kretprobe);
-int try_to_emulate(struct kprobe *p, struct pt_regs *regs)
+static int try_to_emulate(struct kprobe *p, struct pt_regs *regs)
{
int ret;
unsigned int insn = *p->ainsn.insn;
@@ -261,7 +261,7 @@ int try_to_emulate(struct kprobe *p, struct pt_regs *regs)
*/
printk("Can't step on instruction %x\n", insn);
BUG();
- } else if (ret == 0)
+ } else
/* This instruction can't be boosted */
p->ainsn.boostable = -1;
--
2.14.1
next prev parent reply other threads:[~2017-09-22 9:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-22 9:10 [PATCH v2 0/6] powerpc/kprobes: More fixes Naveen N. Rao
2017-09-22 9:10 ` Naveen N. Rao [this message]
2017-10-08 8:43 ` [v2, 1/6] powerpc/kprobes: Some cosmetic updates to try_to_emulate() Michael Ellerman
2017-09-22 9:10 ` [PATCH v2 2/6] powerpc/kprobes: Do not suppress instruction emulation if a single run failed Naveen N. Rao
2017-09-22 9:10 ` [PATCH v2 3/6] powerpc/kprobes: Clean up jprobe detection in livepatch handler Naveen N. Rao
2017-09-22 9:10 ` [PATCH v2 4/6] powerpc/kprobes: Fix warnings from __this_cpu_read() on preempt kernels Naveen N. Rao
2017-09-22 9:10 ` [PATCH v2 5/6] powerpc/jprobes: Disable preemption when triggered through ftrace Naveen N. Rao
2017-09-22 9:10 ` [PATCH v2 6/6] powerpc/jprobes: Validate break handler invocation as being due to a jprobe_return() Naveen N. Rao
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=9e98f74834af349564b71bc8443bdad55d6e37c6.1505934128.git.naveen.n.rao@linux.vnet.ibm.com \
--to=naveen.n.rao@linux.vnet.ibm.com \
--cc=ananth@linux.vnet.ibm.com \
--cc=kamalesh@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mhiramat@kernel.org \
--cc=mpe@ellerman.id.au \
/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).