The branch main has been updated by markj:

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

commit 565518046c9e721ea6ff608d44f1e89d344e5e02
Author:     Mark Johnston <ma...@freebsd.org>
AuthorDate: 2022-02-23 14:57:41 +0000
Commit:     Mark Johnston <ma...@freebsd.org>
CommitDate: 2022-02-23 16:41:22 +0000

    libctf: Remove checks for CTFv1
    
    Per commit 7db423d69273 ("libctf: Rip out CTFv1 support") this support
    is obsolete.
    
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
---
 cddl/contrib/opensolaris/common/ctf/ctf_open.c  |  9 +++------
 cddl/contrib/opensolaris/common/ctf/ctf_types.c | 12 +++++-------
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_open.c 
b/cddl/contrib/opensolaris/common/ctf/ctf_open.c
index d64337a68bff..5ab06890d7f1 100644
--- a/cddl/contrib/opensolaris/common/ctf/ctf_open.c
+++ b/cddl/contrib/opensolaris/common/ctf/ctf_open.c
@@ -229,8 +229,7 @@ init_types(ctf_file_t *fp, const ctf_header_t *cth)
                        break;
                case CTF_K_STRUCT:
                case CTF_K_UNION:
-                       if (fp->ctf_version == CTF_VERSION_1 ||
-                           size < CTF_LSTRUCT_THRESH) {
+                       if (size < CTF_LSTRUCT_THRESH) {
                                ctf_member_t *mp = (ctf_member_t *)
                                    ((uintptr_t)tp + increment);
 
@@ -383,8 +382,7 @@ init_types(ctf_file_t *fp, const ctf_header_t *cth)
                        if (err != 0 && err != ECTF_STRTAB)
                                return (err);
 
-                       if (fp->ctf_version == CTF_VERSION_1 ||
-                           size < CTF_LSTRUCT_THRESH)
+                       if (size < CTF_LSTRUCT_THRESH)
                                vbytes = sizeof (ctf_member_t) * vlen;
                        else {
                                vbytes = sizeof (ctf_lmember_t) * vlen;
@@ -399,8 +397,7 @@ init_types(ctf_file_t *fp, const ctf_header_t *cth)
                        if (err != 0 && err != ECTF_STRTAB)
                                return (err);
 
-                       if (fp->ctf_version == CTF_VERSION_1 ||
-                           size < CTF_LSTRUCT_THRESH)
+                       if (size < CTF_LSTRUCT_THRESH)
                                vbytes = sizeof (ctf_member_t) * vlen;
                        else {
                                vbytes = sizeof (ctf_lmember_t) * vlen;
diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_types.c 
b/cddl/contrib/opensolaris/common/ctf/ctf_types.c
index 21b061cd9356..5b6b07655d82 100644
--- a/cddl/contrib/opensolaris/common/ctf/ctf_types.c
+++ b/cddl/contrib/opensolaris/common/ctf/ctf_types.c
@@ -33,8 +33,7 @@ ctf_get_ctt_size(const ctf_file_t *fp, const ctf_type_t *tp, 
ssize_t *sizep,
 {
        ssize_t size, increment;
 
-       if (fp->ctf_version > CTF_VERSION_1 &&
-           tp->ctt_size == CTF_LSIZE_SENT) {
+       if (tp->ctt_size == CTF_LSIZE_SENT) {
                size = CTF_TYPE_LSIZE(tp);
                increment = sizeof (ctf_type_t);
        } else {
@@ -75,7 +74,7 @@ ctf_member_iter(ctf_file_t *fp, ctf_id_t type, ctf_member_f 
*func, void *arg)
        if (kind != CTF_K_STRUCT && kind != CTF_K_UNION)
                return (ctf_set_errno(ofp, ECTF_NOTSOU));
 
-       if (fp->ctf_version == CTF_VERSION_1 || size < CTF_LSTRUCT_THRESH) {
+       if (size < CTF_LSTRUCT_THRESH) {
                const ctf_member_t *mp = (const ctf_member_t *)
                    ((uintptr_t)tp + increment);
 
@@ -425,8 +424,7 @@ ctf_type_align(ctf_file_t *fp, ctf_id_t type)
                if (LCTF_INFO_KIND(fp, tp->ctt_info) == CTF_K_STRUCT)
                        n = MIN(n, 1); /* only use first member for structs */
 
-               if (fp->ctf_version == CTF_VERSION_1 ||
-                   size < CTF_LSTRUCT_THRESH) {
+               if (size < CTF_LSTRUCT_THRESH) {
                        const ctf_member_t *mp = vmp;
                        for (; n != 0; n--, mp++) {
                                ssize_t am = ctf_type_align(fp, mp->ctm_type);
@@ -665,7 +663,7 @@ _ctf_member_info(ctf_file_t *fp, ctf_id_t type, const char 
*name, ulong_t off,
        if (kind != CTF_K_STRUCT && kind != CTF_K_UNION)
                return (ctf_set_errno(ofp, ECTF_NOTSOU));
 
-       if (fp->ctf_version == CTF_VERSION_1 || size < CTF_LSTRUCT_THRESH) {
+       if (size < CTF_LSTRUCT_THRESH) {
                const ctf_member_t *mp = (const ctf_member_t *)
                    ((uintptr_t)tp + increment);
 
@@ -849,7 +847,7 @@ ctf_type_rvisit(ctf_file_t *fp, ctf_id_t type, ctf_visit_f 
*func, void *arg,
 
        (void) ctf_get_ctt_size(fp, tp, &size, &increment);
 
-       if (fp->ctf_version == CTF_VERSION_1 || size < CTF_LSTRUCT_THRESH) {
+       if (size < CTF_LSTRUCT_THRESH) {
                const ctf_member_t *mp = (const ctf_member_t *)
                    ((uintptr_t)tp + increment);
 

Reply via email to