Skip to contentSkip to conversation

x86: use HW_BREAKPOINT_RW where possible

PATCH New Changbin Du 1 participant 1 message Nov 7, 2022 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: use HW_BREAKPOINT_RW where possible

Use enum HW_BREAKPOINT_RW where possible instead of individual (HW_BREAKPOINT_R | HW_BREAKPOINT_W).

---
 arch/x86/kernel/hw_breakpoint.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/hw_breakpoint.c +2 -2
index 668a4a6533d9..cccfb446ce80 100644
@@ -213,7 +213,7 @@ int arch_bp_generic_fields(int x86_len, int x86_type,
 		*gen_type = HW_BREAKPOINT_W;
 		break;
 	case X86_BREAKPOINT_RW:
-		*gen_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R;
+		*gen_type = HW_BREAKPOINT_RW;
 		break;
 	default:
 		return -EINVAL;
@@ -347,7 +347,7 @@ static int arch_build_bp_info(struct perf_event *bp,
 	case HW_BREAKPOINT_W:
 		hw->type = X86_BREAKPOINT_WRITE;
 		break;
-	case HW_BREAKPOINT_W | HW_BREAKPOINT_R:
+	case HW_BREAKPOINT_RW:
 		hw->type = X86_BREAKPOINT_RW;
 		break;
 	case HW_BREAKPOINT_X:
Signature · 1 line
2.25.1