git: ff624eb63606 - main - kinst: use dtrace_dis_get_byte() instead of own copy

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Tue, 23 May 2023 15:13:31 UTC
The branch main has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=ff624eb63606534304f2867db260e2c405ea1645

commit ff624eb63606534304f2867db260e2c405ea1645
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2023-05-23 15:12:18 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2023-05-23 15:12:18 +0000

    kinst: use dtrace_dis_get_byte() instead of own copy
    
    No functional change intended.
    
    Reviewed by:    markj
    Approved by:    markj (mentor)
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D39872
---
 sys/cddl/dev/kinst/amd64/kinst_isa.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/sys/cddl/dev/kinst/amd64/kinst_isa.c b/sys/cddl/dev/kinst/amd64/kinst_isa.c
index b89c3ce15a1a..5035f43be440 100644
--- a/sys/cddl/dev/kinst/amd64/kinst_isa.c
+++ b/sys/cddl/dev/kinst/amd64/kinst_isa.c
@@ -246,18 +246,6 @@ kinst_set_disp32(struct kinst_probe *kp, uint8_t *bytes)
 	kp->kp_md.disp = (int64_t)disp32;
 }
 
-static int
-kinst_dis_get_byte(void *p)
-{
-	int ret;
-	uint8_t **instr = p;
-
-	ret = **instr;
-	(*instr)++;
-
-	return (ret);
-}
-
 /*
  * Set up all of the state needed to faithfully execute a probed instruction.
  *
@@ -294,7 +282,7 @@ kinst_instr_dissect(struct kinst_probe *kp, uint8_t **instr)
 	kpmd = &kp->kp_md;
 
 	d86.d86_data = instr;
-	d86.d86_get_byte = kinst_dis_get_byte;
+	d86.d86_get_byte = dtrace_dis_get_byte;
 	d86.d86_check_func = NULL;
 	if (dtrace_disx86(&d86, SIZE64) != 0) {
 		KINST_LOG("failed to disassemble instruction at: %p", *instr);