Skip to contentSkip to conversation

arm64: simplify arch_uprobe_xol_was_trapped return

PATCH Applied Osama Abdelkader 4 participants 4 messages Nov 26, 2025 – Jan 5

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: simplify arch_uprobe_xol_was_trapped return

convert arch_uprobe_xol_was_trapped() from explicit if/return true return false pattern to direct boolean expression return in arch/arm64/kernel/probes/uprobes.c

---
 arch/arm64/kernel/probes/uprobes.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/arm64/kernel/probes/uprobes.c +1 -4
index 2799bdb2fb82..b38c1dab7eb4 100644
@@ -103,10 +103,7 @@ bool arch_uprobe_xol_was_trapped(struct task_struct *t)
 	 * insn itself is trapped, then detect the case with the help of
 	 * invalid fault code which is being set in arch_uprobe_pre_xol
 	 */
-	if (t->thread.fault_code != UPROBE_INV_FAULT_CODE)
-		return true;
-
-	return false;
+	return t->thread.fault_code != UPROBE_INV_FAULT_CODE;
 }
 
 bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs)
Signature · 1 line
2.43.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · On Thu, 27 Nov 2025 00:31:30 +0200 Osama Abdelkader…

convert arch_uprobe_xol_was_trapped() from explicit if/return true return false pattern to direct boolean expression return in arch/arm64/kernel/probes/uprobes.c

Looks good to me.

Thanks!

Quoted 23 lines
---
 arch/arm64/kernel/probes/uprobes.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/arm64/kernel/probes/uprobes.c +1 -4
index 2799bdb2fb82..b38c1dab7eb4 100644
@@ -103,10 +103,7 @@ bool arch_uprobe_xol_was_trapped(struct task_struct *t)
 	 * insn itself is trapped, then detect the case with the help of
 	 * invalid fault code which is being set in arch_uprobe_pre_xol
 	 */
-	if (t->thread.fault_code != UPROBE_INV_FAULT_CODE)
-		return true;
-
-	return false;
+	return t->thread.fault_code != UPROBE_INV_FAULT_CODE;
 }
 
 bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs)
Signature · 1 line
2.43.0
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>
Reviewed-by on v1 1/1
#2 lore raw
In reply to Osama Abdelkader
Quoted 5 lines · Osama Abdelkader

convert arch_uprobe_xol_was_trapped() from explicit if/return true return false pattern to direct boolean expression return in arch/arm64/kernel/probes/uprobes.c

Quoted 20 lines
---
 arch/arm64/kernel/probes/uprobes.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/arm64/kernel/probes/uprobes.c +1 -4
index 2799bdb2fb82..b38c1dab7eb4 100644
@@ -103,10 +103,7 @@ bool arch_uprobe_xol_was_trapped(struct task_struct *t)
 	 * insn itself is trapped, then detect the case with the help of
 	 * invalid fault code which is being set in arch_uprobe_pre_xol
 	 */
-	if (t->thread.fault_code != UPROBE_INV_FAULT_CODE)
-		return true;
-
-	return false;
+	return t->thread.fault_code != UPROBE_INV_FAULT_CODE;
 }
 
 bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs)
maintainer Applied
#3 lore raw
In reply to Osama Abdelkader
Quoted 5 lines · Osama Abdelkader

convert arch_uprobe_xol_was_trapped() from explicit if/return true return false pattern to direct boolean expression return in arch/arm64/kernel/probes/uprobes.c

Applied to arm64 (for-next/misc), thanks!

[1/1] arm64: simplify arch_uprobe_xol_was_trapped return

      https://git.kernel.org/arm64/c/484626209600

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev